mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Thomas Gleixner <tglx@kernel.org>,
	msuchanek@suse.de, Jinjie Ruan <ruanjinjie@huawei.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: core/entry] entry: Rework syscall_audit_enter()
Date: Tue, 14 Jul 2026 15:01:40 -0000	[thread overview]
Message-ID: <178404130062.1844600.10010580992481727771.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260712141346.576865340@kernel.org>

The following commit has been merged into the core/entry branch of tip:

Commit-ID:     ff2b9a905930db22494690d219724822db443d7a
Gitweb:        https://git.kernel.org/tip/ff2b9a905930db22494690d219724822db443d7a
Author:        Thomas Gleixner <tglx@kernel.org>
AuthorDate:    Sun, 12 Jul 2026 23:25:17 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 14 Jul 2026 16:57:16 +02:00

entry: Rework syscall_audit_enter()

Move it out of line and let it reread the syscall number on it's own. That
makes the low level entry code denser and allows to move the reread to the
call site of syscall_trace_enter() once the tracer is fixed up.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Michal Suchánek <msuchanek@suse.de>
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20260712141346.576865340@kernel.org
---
 include/linux/entry-common.h  | 14 +++-----------
 kernel/entry/syscall-common.c | 12 ++++++++++++
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index 299f13c..78cfeeb 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -60,16 +60,7 @@ static __always_inline bool arch_ptrace_report_syscall_permit_entry(struct pt_re
 
 long trace_syscall_enter(struct pt_regs *regs, long syscall);
 void trace_syscall_exit(struct pt_regs *regs, long ret);
-
-static inline void syscall_enter_audit(struct pt_regs *regs, long syscall)
-{
-	if (unlikely(audit_context())) {
-		unsigned long args[6];
-
-		syscall_get_arguments(current, regs, args);
-		audit_syscall_entry(syscall, args[0], args[1], args[2], args[3]);
-	}
-}
+void syscall_enter_audit(struct pt_regs *regs);
 
 static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned long work,
 						long syscall)
@@ -114,7 +105,8 @@ static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned l
 	if (unlikely(work & SYSCALL_WORK_SYSCALL_TRACEPOINT))
 		syscall = trace_syscall_enter(regs, syscall);
 
-	syscall_enter_audit(regs, syscall);
+	if (unlikely(audit_context()))
+		syscall_enter_audit(regs);
 
 	return syscall;
 }
diff --git a/kernel/entry/syscall-common.c b/kernel/entry/syscall-common.c
index cd4967a..b3cde6f 100644
--- a/kernel/entry/syscall-common.c
+++ b/kernel/entry/syscall-common.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 
+#include <linux/audit.h>
 #include <linux/entry-common.h>
 
 #define CREATE_TRACE_POINTS
@@ -21,3 +22,14 @@ void trace_syscall_exit(struct pt_regs *regs, long ret)
 {
 	trace_sys_exit(regs, ret);
 }
+
+#ifdef CONFIG_AUDITSYSCALL
+void syscall_enter_audit(struct pt_regs *regs)
+{
+	long syscall = syscall_get_nr(current, regs);
+	unsigned long args[6];
+
+	syscall_get_arguments(current, regs, args);
+	__audit_syscall_entry(syscall, args[0], args[1], args[2], args[3]);
+}
+#endif

  parent reply	other threads:[~2026-07-14 15:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 21:25 [patch 0/4] entry: Rework syscall skip logic Thomas Gleixner
2026-07-12 21:25 ` [patch 1/4] entry: Rework syscall_audit_enter() Thomas Gleixner
2026-07-13  1:33   ` Jinjie Ruan
2026-07-14 15:01   ` tip-bot2 for Thomas Gleixner [this message]
2026-07-14 15:23   ` Radu Rendec
2026-07-12 21:25 ` [patch 2/4] entry: Rework trace_syscall_enter() Thomas Gleixner
2026-07-13  1:36   ` Jinjie Ruan
2026-07-14 15:01   ` [tip: core/entry] " tip-bot2 for Thomas Gleixner
2026-07-14 15:28   ` [patch 2/4] " Radu Rendec
2026-07-12 21:25 ` [patch 3/4] entry: Make return type of syscall_trace_enter() bool Thomas Gleixner
2026-07-13  1:40   ` Jinjie Ruan
2026-07-14 15:01   ` [tip: core/entry] " tip-bot2 for Thomas Gleixner
2026-07-14 15:41   ` [patch 3/4] " Radu Rendec
2026-07-12 21:25 ` [patch 4/4] entry, treewide: Make syscall_enter_from_user_mode[_work]() indicate syscall execution Thomas Gleixner
2026-07-13  8:44   ` Michal Suchánek
2026-07-13 17:00     ` Michal Suchánek
2026-07-13 22:20     ` Thomas Gleixner
2026-07-14  7:29       ` Michal Suchánek
2026-07-14  8:40         ` Michal Suchánek
2026-07-14 15:01   ` [tip: core/entry] " tip-bot2 for Thomas Gleixner
2026-07-14 18:57   ` [patch 4/4] " Radu Rendec
2026-07-14 12:27 ` [patch 0/4] entry: Rework syscall skip logic Michal Suchánek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178404130062.1844600.10010580992481727771.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=msuchanek@suse.de \
    --cc=ruanjinjie@huawei.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox