From nobody Sat Jul 25 02:13:43 2026 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 5039F478E42; Mon, 20 Jul 2026 18:43:49 +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=1784573032; cv=none; b=JTTKoTKJUlpE19xxsqxPkEwMMLoI+SmmTujsjanA2Jj7Aq+63ps5rrRa7iD3fsK6kcDpFJl0tqM7QdJZVqgXSz4v2mNfmCWAe9+KZeJWevdyOTKdK61wiUPNA8vUvm7pcolpwAa2eCgEla9cLhJE5Ga95pE9X5NGcL6B6hoQa20= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784573032; c=relaxed/simple; bh=O9aJHSlsDbBW8pWqYQN6mrVArZvjVk09skoQekHOjcE=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=gqfreUKfV90RMDcWpLx7E+yQWO6FqgfkU+OZ07/Dt3mlLvdq/+3QNO6yHlTI2ty230YctMhVDPONycTGuazW31gd/kThFGk3X1Ic2YADAoyMsNhFSI3nqc81LSrmV4Lrx7FEenpsx5tMUco1GnEiEsQvHIDtq27FUt6r0Jbw8jY= 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=356AWARq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wkZrFIs7; 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="356AWARq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wkZrFIs7" Date: Mon, 20 Jul 2026 18:43:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1784573021; 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=7MGxg/1an3k/O1kQlDoBzGOqXxx0MpKDfkwpWzRiiDw=; b=356AWARqhMtYy7x5B3dG0Z3a+m58BApuoQl4vReNKRVJ5As9+9kOa10mNqVOOXIbNJ9QEx 7sMk103W/dL9zaYKOfGunp0N0E2RzHGBmjyov9U8y0NstSnY096gYOCfAVDBsRckO8xSax jEDPpvArBeYMpzvpnYcPE+yYhdGINp2c8sJMDMyLGfa3ydaSeL87UyJqfhFa8uZ44TQgd4 zrQlaGiknITqEHFcstnyHXoijdIDQTJlBRh6EwlBYBxEWtBzzbJuTzKMUPbqojO7jhi0Y2 0jPinBLnRQLW4mYBYaAe3lrNrWmtyKjFPiD0aSqhQyBGr/1C1qsLP9jIYB5diA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1784573021; 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=7MGxg/1an3k/O1kQlDoBzGOqXxx0MpKDfkwpWzRiiDw=; b=wkZrFIs7RftAC7ce1XGj+a6VNVsEEV7K1iICbshnThQfv//FBEo2UP7Lcp+irk6C260+zM BeTcrs0woGLfwCCg== 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: <178457302028.2943223.3184917083109592493.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: 6f25517010ddd3f8080d7e06b9b1cb1b64b73772 Gitweb: https://git.kernel.org/tip/6f25517010ddd3f8080d7e06b9b1cb1b6= 4b73772 Author: Thomas Gleixner AuthorDate: Sun, 12 Jul 2026 23:25:17 +02:00 Committer: Thomas Gleixner CommitterDate: Mon, 20 Jul 2026 20:38:40 +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. To prevent the compiler from putting audit_context() out of line and thereby breaking dead code elimination, mark audit_context() __always_inline. 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_p= ermit_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, unsi= gned 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