opnsense-src/sys/security/audit
Mark Johnston f78fe93085 audit: Fix short-circuiting in syscallenter()
syscallenter() has a slow path to handle syscall auditing and dtrace
syscall tracing.  It uses AUDIT_SYSCALL_ENTER() to check whether to take
the slow path, but this macro also has side effects: it writes the audit
log entry.  When systrace (dtrace syscall tracing) is enabled, this
would get short-circuited, and we end up not writing audit log entries.

Introduce a pure macro to check whether auditing is enabled, use it in
syscallenter() instead of AUDIT_SYSCALL_ENTER().

Reviewed by:	kib
Reported by:	Joe Duin <jd@firexfly.com>
Fixes:		2f7292437d ("Merge audit and systrace checks")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D48448
2025-01-14 14:19:28 +00:00
..
audit.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
audit.h audit: Fix short-circuiting in syscallenter() 2025-01-14 14:19:28 +00:00
audit_arg.c cred: kern_setgroups(): Internally use int as number of groups' type 2024-11-02 21:37:41 +01:00
audit_bsm.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
audit_bsm_db.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
audit_bsm_klib.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
audit_dtrace.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
audit_ioctl.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
audit_pipe.c kern: Make fileops and filterops tables const where possible 2024-11-26 21:04:21 +00:00
audit_private.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
audit_syscalls.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
audit_trigger.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
audit_worker.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
bsm_domain.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
bsm_errno.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
bsm_fcntl.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
bsm_socket_type.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
bsm_token.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00