From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F59F408624; Fri, 10 Jul 2026 12:35:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.175.24.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783686913; cv=none; b=laqMGxAz9XsDv68NEnOVQE54M+CWnhW0jBfBgPQBEy3YKHpcU6rhKyxYppFTF8i7iWtwff3VYugp2Vr04bPueK7UYm1eXrdsj21qij78qScmL+ABSDaF05pdL0aRWEUAbKw2vmuocfuPQH+PoCKDjuHWvjJ0zphSvxFZi9nKQB4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783686913; c=relaxed/simple; bh=PDjmw8awt2votmGhlvXDI/eRek6m+eCHuXWEHwR/8K0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EkOWMtkq4Grq/np0+OlCGA0hQVqE+XMDNdjlPKSoVYDh2XTBIkadl+jhyPVFJsH/a2XcJ0VmgLRzguCWjW2o2k79W0k3lCtL+7s5TymRugGj1qB4EGrqm4M5LHDIF0u/YgdjP5kHqPzuDc0V3eNOCvxHOYrpkoXt11WCJQ+tZaQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de; spf=pass smtp.mailfrom=alpha.franken.de; arc=none smtp.client-ip=193.175.24.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 1wiARS-0005Rr-00; Fri, 10 Jul 2026 14:34:54 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 937DBC00E8; Fri, 10 Jul 2026 14:34:45 +0200 (CEST) Date: Fri, 10 Jul 2026 14:34:45 +0200 From: Thomas Bogendoerfer To: Oleg Nesterov Cc: Renzo Davoli , linux-kernel@vger.kernel.org, Andrew Morton , Shuah Khan , Alexey Gladkov , Eugene Syromyatnikov , Davide Berardi , strace-devel@lists.strace.io, "Dmitry V . Levin" , "open list:MIPS" Subject: Re: [PATCH v2 1/2] ptrace: PTRACE_SET_SYSCALL_INFO syscall skipping support Message-ID: References: <20260704142643.692754-1-renzo@cs.unibo.it> <20260704142643.692754-2-renzo@cs.unibo.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jul 07, 2026 at 06:04:56PM +0200, Oleg Nesterov wrote: > On 07/07, Renzo Davoli wrote: > > > > On Sun, Jul 05, 2026 at 04:38:05PM +0200, Oleg Nesterov wrote: > > > OK, lets only allow the _SECCOMP -> _EXIT transition for now. > > done in v3. > > > But will it work on MIPS? > > > > IMHO yes, it will (would). > > Agreed, it is not that I think it won't... but it would be nice to have an ACK > from arch/mips maintainers. syscall_trace_enter() is called from MIPS asm code > which I obviously can't understand. current code works for SECCOMP and with below untested change it should work for PTRACE_SYSCALL, too. Thomas. diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 3f4c94c88124..87102a03b6ea 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -1321,8 +1321,12 @@ long arch_ptrace(struct task_struct *child, long request, */ asmlinkage long syscall_trace_enter(struct pt_regs *regs) { + long syscall; + user_exit(); + syscall = current_thread_info()->syscall; + if (test_thread_flag(TIF_SYSCALL_TRACE)) { if (ptrace_report_syscall_entry(regs)) return -1; @@ -1342,7 +1346,7 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs) * Negative syscall numbers are mistaken for rejected syscalls, but * won't have had the return value set appropriately, so we do so now. */ - if (current_thread_info()->syscall < 0) + if (syscall < 0) syscall_set_return_value(current, regs, -ENOSYS, 0); return current_thread_info()->syscall; } -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]