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.129.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 0144F3F12F3 for ; Wed, 8 Jul 2026 15:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783525462; cv=none; b=MKzkJRD4uHJzB6VllbeqplBE0jRIhvGyhWGs7LzOM2zVo+eDj5xyMKplNrllHQALxxMfs1nLIdgaTNKxgOmabAelB8kEXqRiU7/jx55yhg5b3rQSnBHVpOXCl0UUj1LIjxAgJBjdjPlTwx3tJTWj6xN/gFBp8/02RQkDQWX+sIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783525462; c=relaxed/simple; bh=EjprHbZEqA58bW8lx74bb8pQ0t8Gj9FvOBQBXP3Oq/4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jHDu0Afvf4CLYYwSxKkBWntr9zp6bULItvwxsr1Mk/7Sar3bUZttrw7SoyWxHSVM39WWg20K9rN0soRP5aI2fUJsa3g/Sor9SUQmVHw0gKLgXLz1yRcZRvTdS1rfCG9zmBWBL+g/gHJJ17vdSystlZKHVfuzTixg82/ZzHkwyu4= 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=Ctvkxfbl; arc=none smtp.client-ip=170.10.129.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="Ctvkxfbl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783525458; 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=EgB1Ov3Lyqr7O1OL7XXi6otXvsRH9VbAuFLm8tRKevw=; b=CtvkxfbltjPfCZhDhNyriehkR51iLXe/o0/oSL2CaStXyJCeO9KBpjiAFUQhNCHeEWBqMu urQyain28muHX6bj0v0OqJTGYxHZ3Bnp2klaPv8edMuRDS0dOhsI8BSqipaxhmoQ/aXBPH EhUBTHi+yVYCNoC+/KbPjOvtqQbCUUk= Received: from mx-prod-mc-03.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-279-KLD0N21qOUqmcC-END4nFg-1; Wed, 08 Jul 2026 11:44:15 -0400 X-MC-Unique: KLD0N21qOUqmcC-END4nFg-1 X-Mimecast-MFC-AGG-ID: KLD0N21qOUqmcC-END4nFg_1783525453 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 490671955F24; Wed, 8 Jul 2026 15:44:13 +0000 (UTC) Received: from fedora (unknown [10.44.33.83]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 4046A180058F; Wed, 8 Jul 2026 15:44:09 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 8 Jul 2026 17:44:12 +0200 (CEST) Date: Wed, 8 Jul 2026 17:44:08 +0200 From: Oleg Nesterov To: "Dmitry V. Levin" Cc: Renzo Davoli , linux-kernel@vger.kernel.org, Andrew Morton , Shuah Khan , Alexey Gladkov , Eugene Syromyatnikov , Davide Berardi , strace-devel@lists.strace.io Subject: Re: [PATCH v4 1/2] ptrace: add PTRACE_SET_SYSCALL_INFO syscall skipping support Message-ID: References: <20260708090655.38432-1-renzo@cs.unibo.it> <20260708090655.38432-2-renzo@cs.unibo.it> <20260708153250.GA32399@strace.io> 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: <20260708153250.GA32399@strace.io> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 07/08, Dmitry V. Levin wrote: > > On Wed, Jul 08, 2026 at 11:06:54AM +0200, Renzo Davoli wrote: > > > System call suppression for PTRACE_SYSCALL_INFO_ENTRY is currently omitted > > because its implementation is architecture-dependent. On some architectures, > > the system call number and return value share the same register, making it > > difficult to suppress a system call without altering the return value. A > > portable implementation would require an audit of all supported architectures. > > I suggest the following wording for the explanation why > PTRACE_SYSCALL_INFO_ENTRY is not supported yet: > > System call suppression via PTRACE_SYSCALL_INFO_ENTRY is currently not > implemented. On some architectures (e.g. MIPS), when a system call > is skipped by setting the syscall number to -1 at the entry stop, the > architecture entry path unconditionally overwrites the return value > register with -ENOSYS before the tracer can set a custom return value > at the exit stop. Thanks! but looks a bit misleading or (quite possibly) I am confused... At least for MIPS, I think it should something like when a system call is skipped by setting the syscall number to -1 ... architecture entry path unconditionally overwrites the return value register with -ENOSYS ... _after_ (or even if ) the tracer has already set a custom return value No? Oleg.