From owner-svn-src-all@freebsd.org Fri Apr 17 02:09:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF16A2CE3F2; Fri, 17 Apr 2020 02:09:31 +0000 (UTC) (envelope-from kevans@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 493KKR5Y9xz4PJq; Fri, 17 Apr 2020 02:09:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9E2C1AD36; Fri, 17 Apr 2020 02:09:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03H29VQW015117; Fri, 17 Apr 2020 02:09:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03H29VRx015116; Fri, 17 Apr 2020 02:09:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202004170209.03H29VRx015116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 17 Apr 2020 02:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360031 - head/sys/security/audit X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/security/audit X-SVN-Commit-Revision: 360031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2020 02:09:31 -0000 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