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 AC88833985A for ; Thu, 2 Jul 2026 08:43:42 +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=1782981824; cv=none; b=TDiCOq9CIFS/e2KpanN7i/UBVTnI9p1AHDHggJ7aWtiECFB6lmcUmYOpoj3/KeoJp3bapZfdJb/PJl0yTpvNLV54FqSmiRwYKjgp8BHoBleO7VDFZP8vopaGBhAG/1DgqKsb3wd2G2HQAB8vqV1OOmIbbdr8dxsNPVZyegSv2uQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782981824; c=relaxed/simple; bh=vTrhLwslQkJXIcgcAE+PiUKRc7QCsPH5miQ+C6pB4kU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b65V6b5bmOqU+H0JJxy//fJB9IDQAQnMT2BbW4wWuwuZv5cVWlY3g7SycLl5fNCcAQQlgRPukc3j4Plk+MjwhhQgsgWHf7abnCcdF4KrTvP1WKp7oZPeRkUrSVXF7SqMiEvOZGLTQn8XbkVgbJNMqb8Z3IfxpEP+ucswL+QTWcM= 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=JGAHGgjH; 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="JGAHGgjH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782981821; 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=y9/bDbc2VVPOkpsRZtewLUkgsDsaXy89gdEdz4vgc7g=; b=JGAHGgjHS1V/7HdWPqZdOhHzHqIrrMis11GG/Sd6WWYpvLBqh/fvYYkb5LDQJ2OiReJtIF 6LiZjByqAG+kCdRaqsym/sdOugcztIxn2QqjCSrMFxHr64xRRxWQrksI9W4SqVrKPZNwXy Hat9e8woOscEmOH8GMehD/BM8Jca9pI= Received: from mx-prod-mc-01.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-656-ZOrMD-hvOziNG2MQtn-Omw-1; Thu, 02 Jul 2026 04:43:38 -0400 X-MC-Unique: ZOrMD-hvOziNG2MQtn-Omw-1 X-Mimecast-MFC-AGG-ID: ZOrMD-hvOziNG2MQtn-Omw_1782981816 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 657921945CA7; Thu, 2 Jul 2026 08:43:35 +0000 (UTC) Received: from fedora (unknown [10.44.32.200]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id C0D9D180056E; Thu, 2 Jul 2026 08:43:31 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 2 Jul 2026 10:43:34 +0200 (CEST) Date: Thu, 2 Jul 2026 10:43:29 +0200 From: Oleg Nesterov To: Renzo Davoli Cc: linux-kernel@vger.kernel.org, Andrew Morton , Shuah Khan , Alexey Gladkov , Eugene Syromyatnikov , Mike Frysinger , Davide Berardi , strace-devel@lists.strace.io, Dmitry Levin Subject: Re: [PATCH 1/5] ptrace: add PTRACE_SYSCALL_INFO_SECCOMP_SKIP Message-ID: References: <20260701150558.330348-1-renzo@cs.unibo.it> <20260701150558.330348-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: <20260701150558.330348-2-renzo@cs.unibo.it> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On 07/01, Renzo Davoli wrote: > > --- a/include/uapi/linux/ptrace.h > +++ b/include/uapi/linux/ptrace.h > @@ -79,6 +79,7 @@ struct seccomp_metadata { > #define PTRACE_SYSCALL_INFO_ENTRY 1 > #define PTRACE_SYSCALL_INFO_EXIT 2 > #define PTRACE_SYSCALL_INFO_SECCOMP 3 > +#define PTRACE_SYSCALL_INFO_SECCOMP_SKIP 4 > > struct ptrace_syscall_info { > __u8 op; /* PTRACE_SYSCALL_INFO_* */ > diff --git a/kernel/ptrace.c b/kernel/ptrace.c > index d041645d9d17..ff763c87e4f7 100644 > --- a/kernel/ptrace.c > +++ b/kernel/ptrace.c > @@ -1119,12 +1119,22 @@ ptrace_set_syscall_info_exit(struct task_struct *child, struct pt_regs *regs, > return 0; > } > > +static int > +ptrace_set_syscall_info_seccomp_skip(struct task_struct *child, > + struct pt_regs *regs, > + struct ptrace_syscall_info *info) > +{ > + syscall_set_nr(child, regs, -1); > + return ptrace_set_syscall_info_exit(child, regs, info); > +} Rather than add the new PTRACE_SYSCALL_INFO_SECCOMP_SKIP, can't we teach ptrace_set_syscall_info_seccomp() to treat info->entry.nr == -1 as "skip" ? Note that ptrace_set_syscall_info_seccomp() -> ptrace_set_syscall_info_entry() already does syscall_set_nr(). And perhaps the changelog should say more about motivation... See also https://sashiko.dev/#/patchset/20260701150558.330348-1-renzo%40cs.unibo.it Oleg.