git: 8fa808af6fb9 - stable/14 - freebsd32: Report errors when copying out oldlenp in __sysctl
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 02 Jan 2024 00:37:12 UTC
The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8fa808af6fb98fd6cf942f2dac13b35c264552bd commit 8fa808af6fb98fd6cf942f2dac13b35c264552bd Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2023-12-26 01:37:32 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-01-02 00:29:42 +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 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