Date: Sat, 20 Jun 2020 04:39:52 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r362426 - stable/11/sys/kern Message-ID: <202006200439.05K4dqLQ041610@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sat Jun 20 04:39:52 2020 New Revision: 362426 URL: https://svnweb.freebsd.org/changeset/base/362426 Log: MFC r311286: The callers of kern_getfsstat(UIO_SYSSPACE) expect that *buf always returns memory which must be freed, regardless of the error. Assign NULL to *buf in case we are not going to allocate any memory due to invalid mode. Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Sat Jun 20 04:27:38 2020 (r362425) +++ stable/11/sys/kern/vfs_syscalls.c Sat Jun 20 04:39:52 2020 (r362426) @@ -409,6 +409,8 @@ kern_getfsstat(struct thread *td, struct statfs **buf, case MNT_NOWAIT: break; default: + if (bufseg == UIO_SYSSPACE) + *buf = NULL; return (EINVAL); } restart:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006200439.05K4dqLQ041610>