From nobody Thu Dec 28 03:11:18 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 4T0tng0b67z552YP; Thu, 28 Dec 2023 03:11:19 +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 4T0tnf6FPZz3b3T; Thu, 28 Dec 2023 03:11:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703733078; 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=lh8/SopQ25o5M1cL5ekN6vLnj+G+itfLG9F/OXpIynk=; b=tcxNctPudePMJqCSj02bSE9uSNFWaGPUwYf8Y+VPX1ex0cdAAI2xAlsMmgDLBlUVjCKxs7 TbqAV2Y4i2crLsQVKFe1Dl6gJrlhzC736HlNkpYfcPZSmfJybyST+xYjK5pPywXGYmykE9 tn3mLRJU/gBA4TzLNg7CvrQg8bpWsEzAIskh2e3Th8t6C+e4XqTiUew8uOuXZFtLLu4skl 0du51rAYlj8Vu/xMt7xd3zLX23IDhoqKLCtNibH8wtoUVT5N7rp52fJIPL9/DQ1yBvAHvZ TJ/Ej1MuOdxMu+aTHxWCaBoc5Qu8fHlLxjBCflrL+deLendK5gLkWUmvel+TRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703733078; a=rsa-sha256; cv=none; b=YWwatJHhh0Dy+aCR5RtsqkW9LWLF4IH8X3ag5XwEk5BmW+4aG/LwMwKGQVaGmNVCCMl8cH ZXGaiorceyADQWerjN3fimntEgCBORz5OUp0GfAsvqNvfRO7SVcGi1npS6lvglWS3WPECU JicRL9L6BbnQJRFuTQCsFaWSvUr2od24tHFAb7wzxN/39jmYqkFAx+Fb+zq1fp/k/iE8fO 26wjnsuffKM7ozhSWvyYoZUEHYCsIpQP4xHFyOHqFtpdzyi6KDLJ0dANd3jGgf/VxXKMzG HtwTXWp4ifDbwrKMBuDau0Xe6LTzY6tCJAs2utz0pF2JBn71R/Qu4ZQHdx37Vg== 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=1703733078; 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=lh8/SopQ25o5M1cL5ekN6vLnj+G+itfLG9F/OXpIynk=; b=t1mx8tF6zq4xixWvdpC4748bD3sCpdl/Hma+TV2feFp+BNrT+8SiCEI1poDujiIYDOLSCN 9kKaZsgOVSciLN2ttw8IrznWOWFQ/WYg/jUhTUAuQKr3GMNktgJqE9kaFxwht6hEONDnYt FaLTBMCpxdmfi58GZ6ZMLITRf5crkA3mhitbBgeAr1s++QfraVzU7yNglhW/Y9+9UDbuTQ 8uAiH98Sru4FQ70E/A6zLF2xWVJzociXbb7qjRRX6mf9l8lMPpMPgg9jF+xfxxo2tFC1Lj l0rYliJ7LWj97S31fwyvDB0vlXdUjL9jFWCDJjj+lSxXvLOYat3/dzEUtPjQWA== 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 4T0tnf4fn7z14vq; Thu, 28 Dec 2023 03:11:18 +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 3BS3BIxj053269; Thu, 28 Dec 2023 03:11:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BS3BIk6053266; Thu, 28 Dec 2023 03:11:18 GMT (envelope-from git) Date: Thu, 28 Dec 2023 03:11:18 GMT Message-Id: <202312280311.3BS3BIk6053266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c2ae37ad0ca9 - stable/13 - freebsd32: Fix error handling for suword32() calls 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c2ae37ad0ca9e77f9ddbdcaf0f3fc6ed4f5a5e53 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c2ae37ad0ca9e77f9ddbdcaf0f3fc6ed4f5a5e53 commit c2ae37ad0ca9e77f9ddbdcaf0f3fc6ed4f5a5e53 Author: Mark Johnston AuthorDate: 2023-12-21 16:51:29 +0000 Commit: Mark Johnston CommitDate: 2023-12-28 03:04:23 +0000 freebsd32: Fix error handling for suword32() calls suword32() returns -1 upon an error, not an errno value. MFC after: 1 week (cherry picked from commit bd1654ce92569bbfbe513749db08cdd781b3a036) --- 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 a5fb8f64a0fd..4a32e996cc75 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 d708efcf91fe..65b7ddf83e3d 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2568,9 +2568,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); }