From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 1A6ED2701B6 for ; Sun, 12 Jul 2026 21:28:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783891684; cv=none; b=LxN2UbddaygRx9Gm71o9jdo77ffgXYzB1/Aoqyfu1Ck8bqu32KeO+v0gRFeiUieitNz0bEUUkwAuZdQgzm6bEoBgN7s+U5PRB3WjMvVpazccgeOXCremgU/mE2+oDwjv/knRti7wyNP8EuHG43shmDqE+thVEar9uu/nCCzwEdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783891684; c=relaxed/simple; bh=FTabt0p6OUBIXgxGPhka9dYcFu+RjNk/+q/0ndP5BIo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p9Y1SvwMda9/Il0RT2kjXmJ3j8E+djCAInk2zmQuw/FyHgtqaAbgAVCj7QsIWoax+k2i9b8r5LtbrlYqFvTrPExbLMuzEZjROOSfmyPXl4DGs8S4q2LyU7hoFmlfz21t+w/J8hGmbjdkCZGlj0F1aDW7uYmd+yKWP/EcYuM6y0E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bng38U+R; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bng38U+R" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783891680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8e01pt38fyqBBiPKwXX6Ga5cwdge0ok/kxnqJ9JKk38=; b=bng38U+RSLejJvUtCFwW7jk17wHyvYliL88Ct7DNEpMJd2loDxgxIXsFUVJkzUu2Wqa9vC 4oX5iP1m+OIPZ6UGlZn9jpnixweY+cw4hjEIX716Mx3Tw94nG982eaM4dFDm3Os+YOGG/0 k0WFhXfsHFUsh7f5tna0cjWXkClOmMM= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-448-zxhJe5hgO_W8RNNqMKc6Cg-1; Sun, 12 Jul 2026 17:27:54 -0400 X-MC-Unique: zxhJe5hgO_W8RNNqMKc6Cg-1 X-Mimecast-MFC-AGG-ID: zxhJe5hgO_W8RNNqMKc6Cg_1783891672 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 51263195605E; Sun, 12 Jul 2026 21:27:51 +0000 (UTC) Received: from fedora (unknown [10.44.49.164]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id E5BAD1800594; Sun, 12 Jul 2026 21:27:46 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 12 Jul 2026 23:27:50 +0200 (CEST) Date: Sun, 12 Jul 2026 23:27:45 +0200 From: Oleg Nesterov To: Thomas Bogendoerfer 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: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On 07/10, Thomas Bogendoerfer wrote: > > On Tue, Jul 07, 2026 at 06:04:56PM +0200, Oleg Nesterov wrote: > > > > 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. Thanks! Obviously, I can't know if this patch is correct. I can't even understand why syscall_trace_enter() has to do syscall_set_return_value(ENOSYS) because I don't understand the mips asm callers. But I agree, this should fix the problems we discussed in this thread. Thank you, Oleg. > 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 ] >