From nobody Thu Dec 21 16:59:50 2023 X-Original-To: dev-commits-src-main@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 4SwxVv0fPxz550dc; Thu, 21 Dec 2023 16:59:51 +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 4SwxVt6mRTz3QT9; Thu, 21 Dec 2023 16:59:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703177991; 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=8BB6Pt1hvHBEcRZTTRI3OsramhN14a5ikPx7QChmZrY=; b=bRGHkB7vMHefvvPZRhmcLsNPQfw3suUNzL4s2+rbKft0bggkKJbaqiljhX8unHg3cCn+XO dpswayTR75pCL0O1MPwXe9ugXUHqimRZ7eufsow4Zciueyxe93GcmxczCkdlyfU89QL4D5 3+5jw5q2G1Z9aMIKFOb60duwM84HvymbQp4fSnigf1T9KtsqHHY+Vq2Q7eQh3nJBrLiXS7 6t3bnXDwvkogL4pDUh1ebfEH/Lks7KaRsgxB8w+WPM5SI36tgfD03gntKvKOqY0uDW5zjk duUu+uHO9ol9Yus1r3g1GqJbWPYb/6eiLAIJewLLfO1RN2ExsQHK5vIs96qx2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703177991; a=rsa-sha256; cv=none; b=bJ/0QjLnF5Ot+4ZwJTepUUVmIf32CO7lurys8ArGaZybBdAsWG+sa+9teiCRjneu1PQ6UV ykOcRmowTBF1F+fJurYDUXbcTuxK8Y6GZyn2O6cNGWx/2xN2r3zaqHexkBMODAPL7yt3fM 0w0VeKK1I3W1JwbU4GA3OdJP52lj3ixJXhVxES7rmvq24ZM1FJF4clNj9ah1MWQFsad0lZ Db2b2+qlm0KafoY1e8NuvIY+nBJ+eUU9RdZjajJpr8CcCE8Z1M2gbVJktK0wyLR8VrtPmZ 5nsAnZgKaZYTxxNKaY3kV49kCFuAej3TKwRnzrTRTLT0DSxBUFzqeqCZOJERCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703177990; 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=8BB6Pt1hvHBEcRZTTRI3OsramhN14a5ikPx7QChmZrY=; b=aDgdP0CV2EimNJOmXf0aM/EEW2SOniZ2P6nOCYMIhLUXR+dpfMp0htoyVLWmF/uCIDvQJw jmxOq3Opd6AcU7q6EUKPfShZZpoEKa97Ya6ajKZzIsCSqdzosDh98tJZtFC/sBWub75l1x noL7rSrRBBwcnyL0O4/fcEh0gVa4yYeH1axzxzhEUnobsnLKPa5T8V1w8qn6aQ9cfLYMQb eXJ2GRVFUB3rXqpnDlErkNcrVY2Vx/4wwWzUsRkAGv7a+U/g0BXsj95dA17TMPQmGjTepD vZGo5/wP2s7nQygRy5I//HXOPEPFZSu469lqf1mPqZfnz8lQI7NpAlaMDBn6uQ== 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 4SwxVt5ny3zgTp; Thu, 21 Dec 2023 16:59:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLGxoT0099912; Thu, 21 Dec 2023 16:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLGxo9S099909; Thu, 21 Dec 2023 16:59:50 GMT (envelope-from git) Date: Thu, 21 Dec 2023 16:59:50 GMT Message-Id: <202312211659.3BLGxo9S099909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bd1654ce9256 - main - freebsd32: Fix error handling for suword32() calls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd1654ce92569bbfbe513749db08cdd781b3a036 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bd1654ce92569bbfbe513749db08cdd781b3a036 commit bd1654ce92569bbfbe513749db08cdd781b3a036 Author: Mark Johnston AuthorDate: 2023-12-21 16:51:29 +0000 Commit: Mark Johnston CommitDate: 2023-12-21 16:54:05 +0000 freebsd32: Fix error handling for suword32() calls suword32() returns -1 upon an error, not an errno value. MFC after: 1 week --- sys/compat/freebsd32/freebsd32_capability.c | 5 +++-- sys/compat/freebsd32/freebsd32_misc.c | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_capability.c b/sys/compat/freebsd32/freebsd32_capability.c index 82db5da5898a..681e511a59de 100644 --- a/sys/compat/freebsd32/freebsd32_capability.c +++ b/sys/compat/freebsd32/freebsd32_capability.c @@ -117,9 +117,10 @@ freebsd32_cap_ioctls_get(struct thread *td, cmds = fdep->fde_ioctls; if (cmds32 != NULL && cmds != NULL) { for (i = 0; i < MIN(fdep->fde_nioctls, maxcmds); i++) { - error = suword32(&cmds32[i], cmds[i]); - if (error != 0) + if (suword32(&cmds32[i], cmds[i]) != 0) { + error = EFAULT; goto out; + } } } if (fdep->fde_nioctls == -1) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 2f5cf95b4e4a..5aafc459d60a 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2700,9 +2700,8 @@ freebsd32___sysctlbyname(struct thread *td, &oldlen, uap->new, uap->newlen, &rv, SCTL_MASK32, 1); if (error != 0) return (error); - if (uap->oldlenp != NULL) - error = suword32(uap->oldlenp, rv); - + if (uap->oldlenp != NULL && suword32(uap->oldlenp, rv) != 0) + error = EFAULT; return (error); }