opnsense-src/sys/security
Mark Johnston b04cafe569 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().

Approved by:	so
Security:	FreeBSD-EN-25:02.audit
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

(cherry picked from commit f78fe930854cac6eed55859b45e0a7b5d87189d6)
(cherry picked from commit 4b9ba274d7)
2025-02-03 09:26:37 +01:00
..
audit audit: Fix short-circuiting in syscallenter() 2025-02-03 09:26:37 +01:00
mac sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
mac_biba cr_canseejailproc(): New privilege, no direct check for UID 0 2023-10-17 16:42:58 -03:00
mac_bsdextended sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_ddb mac_ddb: Fix the show rman validator. 2022-08-12 10:20:05 -07:00
mac_ifoff sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_ipacl sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_lomac cr_canseejailproc(): New privilege, no direct check for UID 0 2023-10-17 16:42:58 -03:00
mac_mls sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_none sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_ntpd sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_partition sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_pimd sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_portacl sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_priority Thread creation privilege for realtime group 2021-12-15 00:01:58 +02:00
mac_seeotheruids sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_stub sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_test sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_veriexec veriexec: Simplify the initialization of loader tunable 2023-11-13 11:56:57 +08:00
mac_veriexec_parser sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00