Date: Fri, 17 Apr 2020 02:09:31 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360031 - head/sys/security/audit Message-ID: <202004170209.03H29VRx015116@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Fri Apr 17 02:09:31 2020 New Revision: 360031 URL: https://svnweb.freebsd.org/changeset/base/360031 Log: audit_canon_path_vp: don't panic if cdir == NULL cdir may have simply failed to resolve (e.g. fget_cap failure in namei leading to NULL dp passed to AUDIT_ARG_UPATH*_VP); restore the pre-rS358191 behavior of setting cpath[0] = '\0' and bailing out instead of panicking. This was found by inadvertently running the libc/c063 tests with auditing enabled, resulting in a panic. Reviewed by: mjg (committed version actually his) Differential Revision: https://reviews.freebsd.org/D24445 Modified: head/sys/security/audit/audit_bsm_klib.c Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Fri Apr 17 01:52:27 2020 (r360030) +++ head/sys/security/audit/audit_bsm_klib.c Fri Apr 17 02:09:31 2020 (r360031) @@ -433,10 +433,15 @@ audit_canon_path_vp(struct thread *td, struct vnode *r __func__, __FILE__, __LINE__); copy = path; - if (*path == '/') + if (*path == '/') { vp = rdir; - else + } else { + if (cdir == NULL) { + cpath[0] = '\0'; + return; + } vp = cdir; + } MPASS(vp != NULL); /* * NB: We require that the supplied array be at least MAXPATHLEN bytes
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004170209.03H29VRx015116>