From nobody Wed Jun 21 05:41:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QmC6z6l89z4g1js; Wed, 21 Jun 2023 05:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QmC6z6FH8z3jF7; Wed, 21 Jun 2023 05:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687326107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TMwXjOpmk8nQbeEuWV/IC/jPxBtUoNmUilUjtIpf7Qg=; b=OE3PgvjzFewuCf1cRYZK3zmdw1odAVzZK/jrCk8kfcIiOorQS9IRCCaJu0zKTYYNIg3GSU qPfIUlimydJ4NeLxttyX5amOi/eDvO8VEBzOOKYFv3En0oXVvFIZHMbEZmhJlOdoO3Z19i 1tjzMdEn35KxBeZetRXgGrFLaFZ+SjJNzPNV9lHigKtEzr0LiqtL4EA/swIVKJagEoAOAc qa5ZtrVYzx03huQB+XhrxZijifvkMghEOpM6DYRVtSNuSfqGKlnk6cG7jLU14Nt6hZ/iqb Uap957SdI6dm2lVmyHpi6poqHrAc6JyCX5FZZRDqc+PZpDPbJi26D8o9eeurlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687326107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TMwXjOpmk8nQbeEuWV/IC/jPxBtUoNmUilUjtIpf7Qg=; b=uEMw1EauWW/dtHysI/9spfS478aaTDjq72IexyKTVfY6iG0wjt8iYGyY9dct8/m91s2lex EbPmcdGGu/+gtc+IdW1ESpkNzueiSKkMFjQfHdNOdfijrEsNYhUGbbQn9K3DAVEfnzNIut mSx1K4m05JL92ezS+dApaFUfbkhWuDd9biXsfZhlqZ/xfSm2IouS6fhU3jyx4f80LN/jyr TBGfAImIFbFtqi0yqdLo4VjCf0/0h8YIcwkd94IN5Zy6c/60lQPYG1Ly6lbcYPvDcRF4QO EOuYh46xW8jRFdpjXzRg3P+1TR0PRp9xZ0VS075AsXmjK8vDkbPB0DVJkK6ekg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687326107; a=rsa-sha256; cv=none; b=wHsn2XKzoT6aVHWAGOrG5uE6kWClwqt3DKwL1k3K91lwGiB3lmhPTkKduWAMou/jup9kII hn/8UrrG6wNYaGUNhSccnDXcswssieiaMSbxb/1pIXXEdphzpeHIngTvpS5WNyGlJCdf0B Gs6/azhWdaYmx4EjM1Eg0HKScHwy65y3VSKRxbyvZEy1Xv5ln1j59RY7OcDBolgJmIr3UT qBI+eWpBeb1MWHK7QFuz0hes0dJkhSuANVXURkufQmJmkM5Edhh9gOE0F5U2BQcjDoph5x 13OwrsOZmYryF98Z6DQ9ZZ5PAypF+zL5OQgAyEj35mP6fwx8eXemQ6kTTBVw/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QmC6z581qzV5X; Wed, 21 Jun 2023 05:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35L5flni062704; Wed, 21 Jun 2023 05:41:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35L5flPa062703; Wed, 21 Jun 2023 05:41:47 GMT (envelope-from git) Date: Wed, 21 Jun 2023 05:41:47 GMT Message-Id: <202306210541.35L5flPa062703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: e63d8b8fa6d9 - releng/13.2 - mpr: fix copying of event_mask List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: e63d8b8fa6d98386cce58586d0184cbdf8928a85 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=e63d8b8fa6d98386cce58586d0184cbdf8928a85 commit e63d8b8fa6d98386cce58586d0184cbdf8928a85 Author: Mariusz Zaborski AuthorDate: 2023-04-21 07:50:16 +0000 Commit: Gordon Tetlow CommitDate: 2023-06-21 05:06:39 +0000 mpr: fix copying of event_mask Before the commit 6cc44223cb6717795afdac4348bbe7e2a968a07d the field event_mask was fully copied to the EventMasks field. After this commit the event_mask (uint8_t) is 4 times casted to EventMask (uint32_t). Because of that 24 bits of each event_mask array is lost. This commits brings back simple copying of field, and after words converting 32 bits field to the requested endian. I don't think we need more sophisticated method, as the array is of size 4 (for 32 bits version). Reviewed by: imp MFC after: 1 week Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D39562 (cherry picked from commit ea6597c38c77c7bfaae71259d8636cbb89add6a3) (cherry picked from commit e7a3a08febd01c95b74185bb971ec29cca64b8e1) Approved by: so Security: FreeBSD-EN-23:07.mpr --- sys/dev/mpr/mpr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 6f54b1f57950..c105174b0e21 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2764,8 +2764,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -2819,8 +2820,9 @@ mpr_reregister_events(struct mpr_softc *sc) bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL;