From nobody Tue Dec 26 02:04:12 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 4SzdP85hpDz55Kg4; Tue, 26 Dec 2023 02:04:12 +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 4SzdP857Sdz4JnB; Tue, 26 Dec 2023 02:04:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703556252; 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=iqyAU2bt7zAV1ibyhWQZ8lpUChHeOx9yRNRoS7F55Qs=; b=UFsmxO5Ajou9R3CvEEi6v+Vi7Dl/h5uZ2i/DNvyvE30Gu9aMRc/tfOgGHgebp+iijOqqlF SntSDjIt0zi5Tkwld+oOdGKdjxf8ESN5NXFtENJR07YdHiUJr5ncqK1eF6vFqEhgQLkMy9 uvyJh41KVhVVsd7q09Jknx+98pg4A+b4Mv9mtxB2Myr4abwedS6dsh4qgr3RP3I89wG5M4 UWMsx8B6iQdjMv06ozMtpzUDeylu9Hcln+CQnSRB2+gKQC6dhTpfV/0aPEO9//aF/Vjl0f XJTEu0gMZI4OtILNZfzr8AqoTZ1NEYUohmzxZKEMHE+O+NFWsBDHtRUEddRvyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703556252; a=rsa-sha256; cv=none; b=YVgF8MMW8F2gLKs2INNmJqzOx3u73zDYeBSNQRI+IM3Tmlr8qFp9OM//PdLOq1UvXSw0a7 hHY1HYCPH6ZZS54gNtZTaH/WAIWZn4fgt5GFrc6pEQm1NVo+w2c4KGhiTGVBm6MxU/USy8 8+RaqMmKYDoZP/lJrRM7dGBhzJDbsZZ3it1Hy3zw7ppbbX8dzigMSQu8FRhFAwxVV9lpKh V9MhVHgMRDA1Gx6kY++YSAeVK8VR1vofgrILbE3RkACGml/bW2/V/Q5KRWVhJYkiiwuxKj 0/oulot6l+kE6Z4KdIjfivpocp0QdtbWk4kdD6S+el4xpq8FXqd8RtmVfEFeVQ== 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=1703556252; 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=iqyAU2bt7zAV1ibyhWQZ8lpUChHeOx9yRNRoS7F55Qs=; b=rlntJs+vMfHdY1xxJ9Fa+S12b1fa1N7XaY8QLmVOFk4NS+t74UWVl+KXMh/3YlG7iqWxQ3 ddY7aMrlIZ+fYy4AdAgVeUWAgoNhNX2Nd1r41ngDtwUKkhv41DH0fFqkuj2cDqv+c7y4OO fRaPZXIXpDYJwd6FS/+c6AouZDd1jJfidA8lVNLD64+YnPca23r1GhWYJ3rGk5XIzpqGxi 0QM60EGrjHOZeWajue+NiQuCip7YDvOjJm8vv5y9v7kUeyESvKc9XuR7G/sAbUc8jH4P85 htL6HZiVSUv9X6gezmfzrezoFmJZ++cdANoCG6EQQzNU1kVEd9Xht6MdoGNLJw== 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 4SzdP84F60zbh9; Tue, 26 Dec 2023 02:04:12 +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 3BQ24C3Q002683; Tue, 26 Dec 2023 02:04:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BQ24C2V002681; Tue, 26 Dec 2023 02:04:12 GMT (envelope-from git) Date: Tue, 26 Dec 2023 02:04:12 GMT Message-Id: <202312260204.3BQ24C2V002681@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: 81eb7baa69e9 - main - freebsd32: Report errors when copying out oldlenp in __sysctl 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: 81eb7baa69e983fe159d254a4ed47d9c00396801 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=81eb7baa69e983fe159d254a4ed47d9c00396801 commit 81eb7baa69e983fe159d254a4ed47d9c00396801 Author: Mark Johnston AuthorDate: 2023-12-26 01:37:32 +0000 Commit: Mark Johnston CommitDate: 2023-12-26 02:04:00 +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 --- 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 5aafc459d60a..41f456d67e5b 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2675,9 +2675,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