opnsense-src/sys/security
Mark Johnston 4b9ba274d7 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

(cherry picked from commit f78fe930854cac6eed55859b45e0a7b5d87189d6)
2025-01-17 13:18:51 +00:00
..
audit audit: Fix short-circuiting in syscallenter() 2025-01-17 13:18:51 +00:00
mac MAC: syscalls: mac_label_copyin(): 32-bit compatibility 2025-01-16 19:06:56 +01:00
mac_biba MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_bsdextended MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_ddb mac_ddb: Fix the show rman validator. 2022-08-12 10:20:05 -07:00
mac_do MAC/do: allow to call setuid if real user id is 0 2024-06-27 10:47:06 +02:00
mac_ifoff MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_ipacl MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_lomac MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_mls MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_none sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mac_ntpd MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_partition MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_pimd MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_portacl MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_priority MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_seeotheruids MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_stub MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_test MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_veriexec MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes 2025-01-16 19:06:55 +01:00
mac_veriexec_parser sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00