From owner-svn-src-head@freebsd.org Sun Jul 22 14:11:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6A50104CB35; Sun, 22 Jul 2018 14:11:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F98D765F4; Sun, 22 Jul 2018 14:11:53 +0000 (UTC) (envelope-from asomers@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 30A7C70F7; Sun, 22 Jul 2018 14:11:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6MEBr2r072044; Sun, 22 Jul 2018 14:11:53 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6MEBqpB072040; Sun, 22 Jul 2018 14:11:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201807221411.w6MEBqpB072040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 22 Jul 2018 14:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336604 - in head: sys/security/audit tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/security/audit tests/sys/audit X-SVN-Commit-Revision: 336604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2018 14:11:53 -0000 Author: asomers Date: Sun Jul 22 14:11:52 2018 New Revision: 336604 URL: https://svnweb.freebsd.org/changeset/base/336604 Log: Fix audit of chflagsat, lgetfh, and setfib These syscalls were always supposed to have been auditted, but due to oversights never were. PR: 228374 Reported by: aniketp Reviewed by: aniketp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16388 Modified: head/sys/security/audit/audit_bsm.c head/tests/sys/audit/file-attribute-access.c head/tests/sys/audit/file-attribute-modify.c head/tests/sys/audit/network.c Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Sun Jul 22 14:01:49 2018 (r336603) +++ head/sys/security/audit/audit_bsm.c Sun Jul 22 14:11:52 2018 (r336604) @@ -770,6 +770,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec case AUE_PROFILE: case AUE_RTPRIO: case AUE_SEMSYS: + case AUE_SETFIB: case AUE_SHMSYS: case AUE_SETPGRP: case AUE_SETRLIMIT: @@ -810,6 +811,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec case AUE_JAIL: case AUE_LUTIMES: case AUE_NFS_GETFH: + case AUE_LGETFH: case AUE_LSTAT: case AUE_LPATHCONF: case AUE_PATHCONF: @@ -851,6 +853,7 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec case AUE_CHFLAGS: case AUE_LCHFLAGS: + case AUE_CHFLAGSAT: if (ARG_IS_VALID(kar, ARG_FFLAGS)) { tok = au_to_arg32(2, "flags", ar->ar_arg_fflags); kau_write(rec, tok); Modified: head/tests/sys/audit/file-attribute-access.c ============================================================================== --- head/tests/sys/audit/file-attribute-access.c Sun Jul 22 14:01:49 2018 (r336603) +++ head/tests/sys/audit/file-attribute-access.c Sun Jul 22 14:11:52 2018 (r336604) @@ -383,9 +383,6 @@ ATF_TC_HEAD(lgetfh_success, tc) ATF_TC_BODY(lgetfh_success, tc) { - /* BSM conversion requested for unknown event 43061 */ - atf_tc_expect_fail("PR 228374: lgetfh(2) does not get audited in success mode"); - /* Symbolic link needs to exist to get a file-handle */ ATF_REQUIRE_EQ(0, symlink("symlink", path)); const char *regex = "lgetfh.*return,success"; @@ -409,9 +406,6 @@ ATF_TC_HEAD(lgetfh_failure, tc) ATF_TC_BODY(lgetfh_failure, tc) { - /* BSM conversion requested for unknown event 43061 */ - atf_tc_expect_fail("PR 228374: lgetfh(2) does not get audited in failure mode"); - const char *regex = "lgetfh.*return,failure"; FILE *pipefd = setup(fds, "fa"); /* Failure reason: symbolic link does not exist */ Modified: head/tests/sys/audit/file-attribute-modify.c ============================================================================== --- head/tests/sys/audit/file-attribute-modify.c Sun Jul 22 14:01:49 2018 (r336603) +++ head/tests/sys/audit/file-attribute-modify.c Sun Jul 22 14:11:52 2018 (r336604) @@ -701,9 +701,6 @@ ATF_TC_HEAD(chflagsat_success, tc) ATF_TC_BODY(chflagsat_success, tc) { - /* BSM conversion requested for unknown event 43209 */ - atf_tc_expect_fail("PR 228374: chflagsat(2) does not get audited in success mode"); - /* File needs to exist to call chflagsat(2) */ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); FILE *pipefd = setup(fds, auclass); @@ -727,9 +724,6 @@ ATF_TC_HEAD(chflagsat_failure, tc) ATF_TC_BODY(chflagsat_failure, tc) { - /* BSM conversion requested for unknown event 43209 */ - atf_tc_expect_fail("PR 228374: chflagsat(2) does not get audited in failure mode"); - FILE *pipefd = setup(fds, auclass); /* Failure reason: file does not exist */ ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, SF_IMMUTABLE, 0)); Modified: head/tests/sys/audit/network.c ============================================================================== --- head/tests/sys/audit/network.c Sun Jul 22 14:01:49 2018 (r336603) +++ head/tests/sys/audit/network.c Sun Jul 22 14:11:52 2018 (r336604) @@ -1097,9 +1097,6 @@ ATF_TC_HEAD(setfib_success, tc) ATF_TC_BODY(setfib_success, tc) { - /* BSM conversion requested for unknown event 43228 */ - atf_tc_expect_fail("PR 228374: setfib(2) does not get audited in success mode"); - pid = getpid(); snprintf(extregex, sizeof(extregex), "setfib.*%d.*return,success", pid); @@ -1123,9 +1120,6 @@ ATF_TC_HEAD(setfib_failure, tc) ATF_TC_BODY(setfib_failure, tc) { - /* BSM conversion requested for unknown event 43228 */ - atf_tc_expect_fail("PR 228374: setfib(2) does not get audited in failure mode"); - pid = getpid(); snprintf(extregex, sizeof(extregex), "setfib.*%d.*return,failure", pid);