From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F73B36B048 for ; Wed, 8 Jul 2026 15:32:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.107.17.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783524773; cv=none; b=jcxuReQXev74Ruf8CMc4OThG7cv7hV6VSy6A3Sdwt9gmn69NO9IABGihrcHPjSBdqPnkynHdSLBd3uvgQwrFsUezTDT0Wvw7pjp/29oRa/t0hq1D0nhkGfckGMtcFdtpn5hFd53WmhpXJIw2th9vrcFKlkIOs63w27VUwq2w60U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783524773; c=relaxed/simple; bh=Kxgx3o2WdAI8QSar5JhjYu9cf5wPzowVZmt/zfEMJkU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mwI6Hcmxv2dhAyX7yjpib98Ua+NMJh4CtITbRorTbfIM/wtVqLv4adXtrp6RrzmmV21mLRXQXtGp4Bg4gQAk6EBaCUxC9nxIRAXrCVVAdzI63APw3GBWDCVoYi4HZxcCLDpvCoB5MzUWS4llsDP8TXC3qgj3PcxiJDobbce7Qmw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strace.io; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=194.107.17.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strace.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 742DB72C8CC; Wed, 8 Jul 2026 18:32:50 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 467667CCB3A; Wed, 8 Jul 2026 18:32:50 +0300 (IDT) Date: Wed, 8 Jul 2026 18:32:50 +0300 From: "Dmitry V. Levin" To: Renzo Davoli Cc: linux-kernel@vger.kernel.org, Andrew Morton , Oleg Nesterov , 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: <20260708153250.GA32399@strace.io> References: <20260708090655.38432-1-renzo@cs.unibo.it> <20260708090655.38432-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: <20260708090655.38432-2-renzo@cs.unibo.it> On Wed, Jul 08, 2026 at 11:06:54AM +0200, Renzo Davoli wrote: > Extend PTRACE_SET_SYSCALL_INFO to support skipping a system call triggered > via seccomp. > > When a tracer retrieves a ptrace_syscall_info structure with 'op' set to > PTRACE_SYSCALL_INFO_SECCOMP, it can now choose to skip the system call. > To do this, the tracer changes 'op' to PTRACE_SYSCALL_INFO_EXIT and > populates the exit union fields (rval and is_error) to define the return > value and error status for the tracee. > > 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. A portable implementation of entry-based syscall suppression would require an audit of all supported architectures to ensure the tracer-provided return value is preserved. -- ldv