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
This commit is contained in:
Alan Somers 2018-07-15 21:10:19 +00:00
parent 89463812e3
commit f7c188aeeb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336319

View File

@ -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) ==