From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D3A0495508; Tue, 14 Jul 2026 15:01:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784041306; cv=none; b=R73uZqCv6TAt16BIYnZqp23ijHHF0QI5c2Ebf0K6bx0xlj3fmMY8EvQQg7/U3Bq1HaqDrC3zxxvFz4k9DYQ4/SOZI6R0LLh6nuMMjeDDFozchxqubK30ItGcq/SWNPybAalCDfsdZ3y6uBRDJg/JEa6P3a6HgwfU8rIXebBxS20= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784041306; c=relaxed/simple; bh=EmmyWZm10MxfD3BlGoJp3HxtvcNSXCgH3pg/D8g5558=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=f89t+O4AffAUfCXWR7IaffLUQLGb7Wn47V6AFx70TQnb6/gAahOHlhcF81yXj7Sv7IcjeWG6ufbE8GN9Iujc2QPBxXSCgwGc6rAcWAjZ1RdLD9PJ0/4Z4q5/oxzzfOFDCNusftkcTCEP0VZAdWMvwpnQctCIpMpMHNuyeg1l2Vk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3t3E5+9R; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=VkljUVv1; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3t3E5+9R"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VkljUVv1" Date: Tue, 14 Jul 2026 15:01:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1784041302; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=exmDTarMI96oClZvSOu2zFFsLG13M0lfwVRhs1cddr4=; b=3t3E5+9RDK3bOHbAFhok5Gy2JNT9cXx96I3uT293hudXuQ2b8gBvLLh4s12N916X93dBYi DSy5rSGWLwpexSZcv3lPTSebT2L8WIcYgiwyEc47O/bELECT27MLjm1R53zP3VWqWiM6Oe 9EOj07B4pa00U3qPKaM2lpA+5eWpKsFMhet7Z7xYGfl9orMHUU9mTsMnMpGatY+g22N7m6 6ruhcB8Do81/NTggmLYmvr93oyjytZmJe1cBD/FYumHq58RtTomg/2wdL/hDb48IL/UxyZ SWjm83WzahOTb+aaCOeRVM0AD9C7ZSYxj8VP/mQChcguvlhn/x69LlBmjpXHxg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1784041302; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=exmDTarMI96oClZvSOu2zFFsLG13M0lfwVRhs1cddr4=; b=VkljUVv12wEKE80CkjIIX3cLgcCyV8nqt9/wk3ulwkE2bW79U3iG0oBPgbZ0CrCltZcT0w SSIrBehtf5cQCWDg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/entry] entry: Rework syscall_audit_enter() Cc: Thomas Gleixner , msuchanek@suse.de, Jinjie Ruan , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260712141346.576865340@kernel.org> References: <20260712141346.576865340@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178404130062.1844600.10010580992481727771.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the core/entry branch of tip: Commit-ID: ff2b9a905930db22494690d219724822db443d7a Gitweb: https://git.kernel.org/tip/ff2b9a905930db22494690d219724822db4= 43d7a Author: Thomas Gleixner AuthorDate: Sun, 12 Jul 2026 23:25:17 +02:00 Committer: Thomas Gleixner 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 Tested-by: Michal Such=C3=A1nek Reviewed-by: Jinjie Ruan 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_per= mit_entry(struct pt_re =20 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); =20 static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsign= ed 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 =3D trace_syscall_enter(regs, syscall); =20 - syscall_enter_audit(regs, syscall); + if (unlikely(audit_context())) + syscall_enter_audit(regs); =20 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 =20 +#include #include =20 #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 =3D 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