From f7c188aeeb343fcf433b31c5617fe13884b48200 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sun, 15 Jul 2018 21:10:19 +0000 Subject: [PATCH] auditon(2): fix A_SETPOLICY with 64-bit values A_SETPOLICY is supposed to work with either 64 or 32-bit values, but due to a typo the 64-bit version has never worked correctly. Submitted by: aniketp Reviewed by: asomers, cem MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D16222 --- sys/security/audit/audit_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c index 15f6623ac515..89af1a7d2817 100644 --- a/sys/security/audit/audit_syscalls.c +++ b/sys/security/audit/audit_syscalls.c @@ -251,7 +251,7 @@ sys_auditon(struct thread *td, struct auditon_args *uap) case A_OLDSETPOLICY: case A_SETPOLICY: if (uap->length == sizeof(udata.au_policy64)) { - if (udata.au_policy & (~AUDIT_CNT|AUDIT_AHLT| + if (udata.au_policy & ~(AUDIT_CNT|AUDIT_AHLT| AUDIT_ARGV|AUDIT_ARGE)) return (EINVAL); audit_fail_stop = ((udata.au_policy64 & AUDIT_CNT) ==