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 D84F1C44501 for ; Fri, 10 Jul 2026 11:41:24 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4gxVKH04v0z2yS4; Fri, 10 Jul 2026 21:41:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1783683682; cv=none; b=kW9t6sbEvY6yt2u8zyrxgEUtz0hTOeMCTCNn+vQt4Ws0MVTjzFiTnowJL5IWAttJ+wUeUadInjGO7HILxLLPXM9hQhL3zCY4jHV5XNg1m/sYrASdkNcgy231bYs3LjDh4NFUcKXAWf+SulEWr2H2+kiuZSO75rLNwPr2RuvImMJBOGZt3d6gVlMIrUgOQNUTazJ14dXfOWdiN8/oAVLESqcHDmPokRlEt0+EHIHydf10O2cIPQJvdmQ4Pcb8YDiHvc7VC5uBzMZZsL3RuUStXjL49hOfnV++DYNg6+xxnAw5yOqG/IOsGxB0E4TY9K0F/N2c41CdzdCb3ss80whm3A== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1783683682; c=relaxed/relaxed; bh=okIzKFIsL/4R4vmkR+TFByt5pFrNsTBzPM+Bl8mNt+c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: In-Reply-To:Content-Type:Content-Disposition; b=Bne/P6dG1dQ17EsH8u1W89MzGQa2r4PD3KuAL4S24cZ9wKL1PmdqYxk70eujRnbJKA+MsWE/kekAOqORabNlE2yzU5IZpXfcBo0N3Yr+Gf+CglhiQzlhRsc74Eb5A3QULWdyX7zxKcmb+x4njK5DlG39OIG9YI3bkLcMIMykZUh3qlqGuaOuT0U9UcbJClQD3PQFS6D7qwE5ito+/41+jEb36Z9WZTzb/W0+mYlgZ07c5gOxOJbuz4+f6T2ZLWMyxCKCL4ttmguY6lANPTaj7uWACX3wrziFt2nR481cEhNnbs3fQs5PAB0qN6fONoaMOkaYwo8flefN6RBp2Kg1Nw== 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=dl6rvXoM; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dl6rvXoM; dkim-atps=neutral; spf=pass (client-ip=170.10.129.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=dl6rvXoM; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dl6rvXoM; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.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.129.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 4gxVKF40LFz2xlt for ; Fri, 10 Jul 2026 21:41:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783683677; 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=okIzKFIsL/4R4vmkR+TFByt5pFrNsTBzPM+Bl8mNt+c=; b=dl6rvXoMHysiIMesUnyTW8UOwPR5zHyl4AxM0CTLALeBaWBUh54jOgeI9X0fFGvPa/rQMF JW1q9+dpShfSdrw+VV9Tajj7szM6hXOj6dbflOUouXtITmk5spqzxuMhYLmma6/AZ3M+3i qk5ReqeiABr3cU6yyg9WfnclrK9s4mU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783683677; 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=okIzKFIsL/4R4vmkR+TFByt5pFrNsTBzPM+Bl8mNt+c=; b=dl6rvXoMHysiIMesUnyTW8UOwPR5zHyl4AxM0CTLALeBaWBUh54jOgeI9X0fFGvPa/rQMF JW1q9+dpShfSdrw+VV9Tajj7szM6hXOj6dbflOUouXtITmk5spqzxuMhYLmma6/AZ3M+3i qk5ReqeiABr3cU6yyg9WfnclrK9s4mU= Received: from mx-prod-mc-06.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-21-qfsr_rx-O6mPQrP7hF_qjQ-1; Fri, 10 Jul 2026 07:41:12 -0400 X-MC-Unique: qfsr_rx-O6mPQrP7hF_qjQ-1 X-Mimecast-MFC-AGG-ID: qfsr_rx-O6mPQrP7hF_qjQ_1783683667 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B188F1800844; Fri, 10 Jul 2026 11:41:03 +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 8F127195419F; Fri, 10 Jul 2026 11:40:45 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 10 Jul 2026 13:41:03 +0200 (CEST) Date: Fri, 10 Jul 2026 13:40:43 +0200 From: Oleg Nesterov To: Michal =?iso-8859-1?Q?Such=E1nek?= Cc: Thomas Gleixner , LKML , Peter Zijlstra , 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 Henderson , Russell King , Catalin Marinas , Guo Ren , Geert Uytterhoeven , Thomas Bogendoerfer , Helge Deller , Yoshinori Sato , Richard Weinberger , Chris Zankel , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, linux-csky@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, Arnd Bergmann , Vineet Gupta , Will Deacon , Brian Cain , Michal Simek , Dinh Nguyen , "David S. Miller" , Andreas Larsson , linux-snps-arc@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [patch 13/18] entry: Make trace_syscall_enter() return type bool Message-ID: References: <20260707181957.433213175@kernel.org> <20260707190254.338083894@kernel.org> <87se5tqkyp.ffs@fw13> 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: gTsZzFcJiiJYm8eg-fgZStRr-NyL5qiJUv_RMqbwQEo_1783683667 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: > > On Wed, Jul 08, 2026 at 10:34:38PM +0200, Thomas Gleixner wrote: > > > > 1) The set in stone rule is that if the entry code returns -1L as the > > syscall number then the architecture code has to skip the syscall > > invocation _and_ is not supposed to change the return value. > > Which stone? > > Pics or it did not happen. > > > > > 2) There is no guarantee and never has been that any of the involved > > mechanisms (ptrace, seccomp, tracing) will change the return value > > when it sets the syscall number to -1L. > > For ptrace to correctly emulate a syscall it needs to set the syscall nr > to an invalid value on entry, and the desired result if the syscall on > exit AFAICT. I can only say that ptrace users do want to skip the syscall and set the return value on entry. See [PATCH v5 1/2] ptrace: add PTRACE_SET_SYSCALL_INFO syscall skipping support https://lore.kernel.org/all/20260709100949.94345-2-renzo@cs.unibo.it/ The changelog explains that currently this doesn't work because among the arches which define HAVE_ARCH_TRACEHOOK (at least) arch/mips is broken in this regard. Oleg.