From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0628C44501 for ; Fri, 10 Jul 2026 11:17:01 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4gxTn76Dp5z2yS4; Fri, 10 Jul 2026 21:16:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1783682219; cv=none; b=jg9Rw8cOPpd3MzZwJyzZtFbc4GrtIofyuoFiYKwyKZQVkEVpjMD7IVz5esj+t2MS4ngWtg4+6ZiKIfOKuBKNmfAEdS0MMxZr6R5cjT0ArzNFCVsByEjtRin10xLhp1YQ4721PFuLRTPFfPNrtOFm0pQwH+rA2fYru7lU0HQyQ1bNa2KTAV/JmkWFV+NWBDCaq7PG2l34qIGRGyF6Q/ObaMWygFPZmPDdjsu9sOoMHjBMrSwZb68LxsWbZ8lYaYLVihvcIRWL49hd8j9jpveRZm51gd+2Zc7FO2T5uXspTDIjSj405Ft7LCpGYMK4WNp497y74zsjAASpoERm0D1b3Q== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1783682219; c=relaxed/relaxed; bh=hft+KFsru/NQK2GFVwrW+rNgrjQeb+hZeEo2ASl1/i4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: In-Reply-To:Content-Type:Content-Disposition; b=l7S4IfHzxehlP2rQWFQ1K3h4kK6yQCZqm0KO6g6NSiAGgM1swlqaIDWiJBUtMk1+hCITLLcep1ZKXY7sPprA6OXGMcJWeHxK8sJDvmf0S4D0BK1QogJNbs8ht/L7o1fFMBZsaioIGAnicbTpP0f+cni4sV9a4dKWeT5c30d12n+rkWfQHRlVuj8SRqpwWw72ZjT01nt0ifIoeqqV+13aLwyzys4OxZLtStUsujMQnWUjSAb3Tml1BV+l1V0JeZE153U4gB2r0/XI8Cg7nC3Cmw9neUeUt/2GXqqIq6ONFLo4ABub0FQT0gO++HUqEydorvRFTWrPuISHNWLL0xI7HQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=erxMrZ8B; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=erxMrZ8B; dkim-atps=neutral; spf=pass (client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=oleg@redhat.com; receiver=lists.ozlabs.org) smtp.mailfrom=redhat.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=erxMrZ8B; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=erxMrZ8B; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=oleg@redhat.com; receiver=lists.ozlabs.org) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4gxTn60Cfzz2xlt for ; Fri, 10 Jul 2026 21:16:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783682212; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hft+KFsru/NQK2GFVwrW+rNgrjQeb+hZeEo2ASl1/i4=; b=erxMrZ8B+0om/leJuMoony5qGSfFzhZ4D294OiFUNU1L8C4dax+Iwtz2PuH3wsknKZa3m/ 00D0eYso050Dlh1fz/PEym8AjBY1B/72WEiL/AKSJn4NqsQXekq2rVzm571uEYcv93sCUy HCQJkZgolhOVsPtCCtd0hujc/BRrEjo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783682212; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hft+KFsru/NQK2GFVwrW+rNgrjQeb+hZeEo2ASl1/i4=; b=erxMrZ8B+0om/leJuMoony5qGSfFzhZ4D294OiFUNU1L8C4dax+Iwtz2PuH3wsknKZa3m/ 00D0eYso050Dlh1fz/PEym8AjBY1B/72WEiL/AKSJn4NqsQXekq2rVzm571uEYcv93sCUy HCQJkZgolhOVsPtCCtd0hujc/BRrEjo= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-640-1rPiqdCGMI-DqX1kFaFhcQ-1; Fri, 10 Jul 2026 07:16:50 -0400 X-MC-Unique: 1rPiqdCGMI-DqX1kFaFhcQ-1 X-Mimecast-MFC-AGG-ID: 1rPiqdCGMI-DqX1kFaFhcQ_1783682205 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D3A3E1800BDF; Fri, 10 Jul 2026 11:16:41 +0000 (UTC) Received: from fedora (unknown [10.44.49.164]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 4B2CE195419E; Fri, 10 Jul 2026 11:16:21 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 10 Jul 2026 13:16:41 +0200 (CEST) Date: Fri, 10 Jul 2026 13:16:20 +0200 From: Oleg Nesterov To: Michal =?iso-8859-1?Q?Such=E1nek?= Cc: Thomas Gleixner , LKML , Peter Zijlstra , Arnd Bergmann , Richard Henderson , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Brian Cain , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , Dinh Nguyen , Helge Deller , Yoshinori Sato , "David S. Miller" , Andreas Larsson , Chris Zankel , linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, Michael Ellerman , Shrikanth Hegde , linuxppc-dev@lists.ozlabs.org, Kees Cook , Huacai Chen , loongarch@lists.linux.dev, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Sven Schnelle , linux-s390@vger.kernel.org, x86@kernel.org, Mark Rutland , Jinjie Ruan , Andy Lutomirski , Richard Weinberger , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [patch 12/18] ptrace, treewide: Rename ptrace_report_syscall_entry() to ptrace_report_syscall_permit_entry() Message-ID: References: <20260707181957.433213175@kernel.org> <20260707190254.280015701@kernel.org> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: 7VQFykvogYt5M0hwtrGn6s1SuTeE4L7jvO58Fu-tpXI_1783682205 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 07/10, Michal Suchánek wrote: > > > --- a/arch/alpha/kernel/ptrace.c > > +++ b/arch/alpha/kernel/ptrace.c > > @@ -375,7 +375,7 @@ asmlinkage unsigned long syscall_trace_e > > struct pt_regs *regs = current_pt_regs(); > > > > if (test_thread_flag(TIF_SYSCALL_TRACE) && > > - ptrace_report_syscall_entry(regs)) { > > + !ptrace_report_syscall_permit_entry(regs)) { > > syscall_set_nr(current, regs, -1); > > Why is this done here? > > Presumably the ptrace_report_syscall_entry returns false here becasue > the tracer put -1 into whatever register specifies the syscall number > (or it was there to start with) which was then read back, compared to > -1, leading to returning false. Now it's set to -1 again? I don't know why arch/alpha/ does syscall_set_nr(-1). But note that ptrace_report_syscall_entry() doesn't even check whether the syscall number was changed. It only checks fatal_signal_pending(). Oleg.