From nobody Sat Jul 25 02:12:28 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 DE16143991E; Mon, 20 Jul 2026 18:43:46 +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=1784573028; cv=none; b=lf8MPmATcqwnFnpXZb5N1FeKu76apkEbPFvA03zWFSb/+e2qgEw8BM6Nb/8zGN23dEpZRj7PXoIRYaRr2Dt5NpFY1XOsU1oqanz3wVaMtxallZc3IHUKcvRpK5DWdhAMH/CBIycnk8ySx+W8RbDjID++TePwDeqqAaDlo47EwVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784573028; c=relaxed/simple; bh=bptE2MOgrDrhwQZaPUgT0KItFVgo4weZbcgzezAS9xA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=uEO7pLQ327XfABgaXBWOCp0aBPjzWnLzJHlaISiqaVkvRnTFbyhQ7ZGYuvV7w6689K4jcWcQr3/m69d11uQti09M8ryaa7jAocTdiLlaQj3dKCUQnWX6CQev9xkGGj+u4PDYNwNLEz8K9fQ96wKySy/FRM1CsLbl0WZe8C+nfUQ= 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=xTmYwTeJ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ypj+UAaz; 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="xTmYwTeJ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ypj+UAaz" Date: Mon, 20 Jul 2026 18:43:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1784573018; 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=Gn+mc/HdMrHdgjlvJWgIU+Z8WSf9ix5tPUYoS1nOnv4=; b=xTmYwTeJnDsmMs+2ZJLUeb824aVLlzmVZWBFQmGEF24SGq2VgQv6PtnVLIkIcmQGQfTIWh ybZveVSy4mMZuCcohlgEe9Qt+poMYWABxwWETzFtPyMSPUVctqgRE5Ov0RuPE7g06MCmEQ 1CYew7YNnl/iibdcYuVD6jgip7BDh9NmBQeS1+WqYzU3i8BY/fy2IOJWmnKZPWPdiyulMG bmpeHuLQ34T8VvzO/o3H28y9OYx+s0cpnQADJO8jMouCRWWZ3wAXSqkBq4QUcSgB8UtXxm xcmvepqzuVOsgFWT7vR1D6UAka4MEzF9FgTVUJGJt1IcQgAAFDVHoGCI5eKmTQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1784573018; 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=Gn+mc/HdMrHdgjlvJWgIU+Z8WSf9ix5tPUYoS1nOnv4=; b=ypj+UAazuh21JV/1wYQucAtsM0Q125bRvUNcH2tWGa17kKjXFqWlks0HxWlaVLOxsPwv1B zkus5cwR0TIjcyDQ== 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: Make return type of syscall_trace_enter() bool Cc: Thomas Gleixner , msuchanek@suse.de, Jinjie Ruan , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260712141346.699072205@kernel.org> References: <20260712141346.699072205@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178457301715.2943223.7613865423067605564.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: 71ff30013f19ca46c2c72c25731c32b6cc7b5620 Gitweb: https://git.kernel.org/tip/71ff30013f19ca46c2c72c25731c32b6c= c7b5620 Author: Thomas Gleixner AuthorDate: Sun, 12 Jul 2026 23:25:27 +02:00 Committer: Thomas Gleixner CommitterDate: Mon, 20 Jul 2026 20:38:40 +02:00 entry: Make return type of syscall_trace_enter() bool This prepares for changing the return types of syscall_enter_from_user_mode[_work]() to bool, which in turn separates the decision of invoking the syscall from the syscall number, which might have been changed in the call by ptrace, seccomp, tracing. Signed-off-by: Thomas Gleixner Tested-by: Michal Such=C3=A1nek Reviewed-by: Jinjie Ruan Link: https://patch.msgid.link/20260712141346.699072205@kernel.org --- include/linux/entry-common.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h index 38d1484..df221d9 100644 --- a/include/linux/entry-common.h +++ b/include/linux/entry-common.h @@ -72,7 +72,7 @@ static __always_inline long syscall_trace_enter(struct pt= _regs *regs, unsigned l */ if (work & SYSCALL_WORK_SYSCALL_USER_DISPATCH) { if (syscall_user_dispatch(regs)) - return -1L; + return false; } =20 /* @@ -87,7 +87,7 @@ static __always_inline long syscall_trace_enter(struct pt= _regs *regs, unsigned l if (work & (SYSCALL_WORK_SYSCALL_TRACE | SYSCALL_WORK_SYSCALL_EMU)) { if (!arch_ptrace_report_syscall_permit_entry(regs) || (work & SYSCALL_WORK_SYSCALL_EMU)) - return -1L; + return false; =20 /* ptrace might have changed work flags */ work =3D READ_ONCE(current_thread_info()->syscall_work); @@ -96,7 +96,7 @@ static __always_inline long syscall_trace_enter(struct pt= _regs *regs, unsigned l /* Do seccomp after ptrace, to catch any tracer changes. */ if (work & SYSCALL_WORK_SECCOMP) { if (!__seccomp_permit_syscall()) - return -1L; + return false; } =20 if (unlikely(work & SYSCALL_WORK_SYSCALL_TRACEPOINT)) @@ -105,8 +105,7 @@ static __always_inline long syscall_trace_enter(struct = pt_regs *regs, unsigned l if (unlikely(audit_context())) syscall_enter_audit(regs); =20 - /* Either of the above might have changed the syscall number */ - return syscall_get_nr(current, regs); + return true; } =20 /** @@ -136,8 +135,13 @@ static __always_inline long syscall_enter_from_user_mo= de_work(struct pt_regs *re { unsigned long work =3D READ_ONCE(current_thread_info()->syscall_work); =20 - if (work & SYSCALL_WORK_ENTER) - syscall =3D syscall_trace_enter(regs, work, syscall); + if (work & SYSCALL_WORK_ENTER) { + if (!syscall_trace_enter(regs, work, syscall)) + return -1L; + + /* Reread the syscall number as it might have been modified */ + syscall =3D syscall_get_nr(current, regs); + } =20 return syscall; }