]> git.baikalelectronics.ru Git - kernel.git/commit
audit: don't deref the syscall args when checking the openat2 open_how::flags
authorPaul Moore <paul@paul-moore.com>
Wed, 9 Feb 2022 19:49:38 +0000 (14:49 -0500)
committerPaul Moore <paul@paul-moore.com>
Wed, 9 Feb 2022 21:04:26 +0000 (16:04 -0500)
commitd2bacd3bb15ce923412cbd2898b6c9763db30032
tree87ccbb01f4c5d75eac090a45840bfc64f39446ce
parent23df86eaa271d627a95dd27520a72d4f2f1d66bb
audit: don't deref the syscall args when checking the openat2 open_how::flags

As reported by Jeff, dereferencing the openat2 syscall argument in
audit_match_perm() to obtain the open_how::flags can result in an
oops/page-fault.  This patch fixes this by using the open_how struct
that we store in the audit_context with audit_openat2_how().

Independent of this patch, Richard Guy Briggs posted a similar patch
to the audit mailing list roughly 40 minutes after this patch was
posted.

Cc: stable@vger.kernel.org
Fixes: a2387823560c ("audit: add support for the openat2 syscall")
Reported-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/auditsc.c