From nobody Tue Jan 02 01:12:54 2024 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 4T3vwl0q2Vz563FV; Tue, 2 Jan 2024 01:12:55 +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 4T3vwl00K5z3ZKw; Tue, 2 Jan 2024 01:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704157975; 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=T1ULlm2JlI6fxHtOGdbaNmO5caqfwmBEPg/DqFXX/Hw=; b=jj0xsU1DoY/NiMwds1H57LHH8EvMQxZ0PORtngI1GS+IHyJybYLVjXLE3HGYWJvqPl13XL uxkEbRzMDJM72lOITs8WotHyS4iK7DCtyFky7DZ1WIl7o9fwCm4KdtERqtTPQd7GeQTDpH COCnw301e0peIVHqP4+DlBbk3BtgCrE3k9AdKjYWNzX/2TKt9iUt8G+zH7oSZRseW91F3+ tGmWfCTCVvJeQxux2JM2Pl8ZbDjY+LwX1JvRfYy12ecqMKIT0H2fTwwEgDj+TbCd4SbD1y 1E88pLVfhrc5TrCPg3jBpTm4uQzYUrc1s0OJd+4AdMk9SQjSNiSTxPzV1jg+5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704157975; a=rsa-sha256; cv=none; b=j4s8FNh7e+KsM1o0OuPgs2SnWatw7nmsWwNmfORbzcKaHb/TR06dQHK7CitADmjZm+ei5/ l9bnN3cMA2qTVIc7PayQXRrxh0cvv12zEEaQSpOV8bYQJvwEsYSDpLI5EuSxGhMtdsog6S 2BTzvJh4DjYwjqe5sQLm/gy/oZwb9P/KMKCis2lNruI42jmLXGAoyPb5t0geMtT9UuvQXx s9EUCIjLq+OKksI26Qup5WMxrZ3iAKMYh5vIgqWLxXwQmKZGUK8tD/cvTTnQWozXSa8P8D DyKKija+Io6YVeft7g7wJT+AJY4IqL6Fwu9FBz1G7IkIkvcox/OX6hx6YwGwMw== 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=1704157975; 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=T1ULlm2JlI6fxHtOGdbaNmO5caqfwmBEPg/DqFXX/Hw=; b=bszaRXtLKWRqBI8t0Hgh5fAs99QltnQppAZloFekW72F8vBhwdInDQfzWY/1WjHkYxUOgz 7hY+UgjYFiByazbpvLoXuDzPJPXGZExvrM7wHqNEXwp2h15OtwvhWkWcE/GR1q4PPmyYsM lxStWhHolS254POKHpDTmlZkdai45FTTYXZxMzX9JsGIKApyAwZNiL8GUmw2AKMELNxauj miLX4fuANTcFI1O3zupxdsYSMsY3dDkzBQvjYTDP3u4otHWWf0pUbB1bIyFjZvliqYMwL9 NAxILnD59hBGMp8uIVK+USbD6Hc34O447UeRJCqrqJuKNojimgICfOBcn3KbUQ== 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 4T3vwk68wkzgTc; Tue, 2 Jan 2024 01:12:54 +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 4021CsFL054566; Tue, 2 Jan 2024 01:12:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4021CsC8054563; Tue, 2 Jan 2024 01:12:54 GMT (envelope-from git) Date: Tue, 2 Jan 2024 01:12:54 GMT Message-Id: <202401020112.4021CsC8054563@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: 573b117f6e30 - stable/13 - freebsd32: Report errors when copying out oldlenp in __sysctl 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: 573b117f6e30b8839bec4a778c37d60d88d980f5 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=573b117f6e30b8839bec4a778c37d60d88d980f5 commit 573b117f6e30b8839bec4a778c37d60d88d980f5 Author: Mark Johnston AuthorDate: 2023-12-26 01:37:32 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 01:12:44 +0000 freebsd32: Report errors when copying out oldlenp in __sysctl This matches the native implementation's behaviour. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43101 (cherry picked from commit 81eb7baa69e983fe159d254a4ed47d9c00396801) --- sys/compat/freebsd32/freebsd32_misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 65b7ddf83e3d..cd6a4c2dc3df 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2543,9 +2543,9 @@ freebsd32___sysctl(struct thread *td, struct freebsd32___sysctl_args *uap) uap->new, uap->newlen, &j, SCTL_MASK32); if (error) return (error); - if (uap->oldlenp) - suword32(uap->oldlenp, j); - return (0); + if (uap->oldlenp != NULL && suword32(uap->oldlenp, j) != 0) + error = EFAULT; + return (error); } int