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 4C83132B9B5 for ; Mon, 13 Jul 2026 20:45:39 +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=1783975540; cv=none; b=Ei7dofgSctg4t3/BR34Hmd+lTMr6zQImddzUbiDUndtG92T6Pug4pbWBTp32vajeCIMiCHzt8HOTZm5iB0vvlryJLdYwTeFQojVCoake/uDGSx7+2LWYYm7m5jEDIkG0B+91bihGdF9IlSirc9thH0XdL37lbn5ZjY4BgpKxUEE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783975540; c=relaxed/simple; bh=a+Gxk88qIaDe9JjQURMVGR2+nLGxrchpZG/mF7MJJ7A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lQ8WSYJoHQBXBvF93cKggNIhcjld38xCAjn0oaLr1Gp6VbAh8/6D2YobEr4XnVxV1fexe2SZZjFgEXYplzY5r09pI9EgTFZVslB69LjkpRuCvQw1LokSKJ1APogpXKrZXFZcGHyL105szZYP8qHllL2UHNqWve/Xrez7EiUNkyc= 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=WB1yXaNb; 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="WB1yXaNb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783975538; 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=QX2VePPE4wmUvuxgohIlU35SmDLi/dVIB4IBSL3SZ5M=; b=WB1yXaNbGVKpLaRKrh75nXzBwwFs4S3cTaDp9ebh3lh5ZjMiESU/6C9KVYHOId1SuM+Zv9 ODeXIANOvWro3CsRzm++JBgXbpA1KsituWQiWTkCvTLg4LCufDOUONq8Q9igH1FDTk0B8S QApJ9Cu6vQR6jWBl0iBvVWRw7t6bt4U= 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-611-HBIQVJQUP92Lo8lxK6hfzQ-1; Mon, 13 Jul 2026 16:45:34 -0400 X-MC-Unique: HBIQVJQUP92Lo8lxK6hfzQ-1 X-Mimecast-MFC-AGG-ID: HBIQVJQUP92Lo8lxK6hfzQ_1783975533 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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 A9DCD18004A9; Mon, 13 Jul 2026 20:45:32 +0000 (UTC) Received: from fedora (unknown [10.44.49.164]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id DBEB7765; Mon, 13 Jul 2026 20:45:28 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 13 Jul 2026 22:45:32 +0200 (CEST) Date: Mon, 13 Jul 2026 22:45:27 +0200 From: Oleg Nesterov To: Michal =?iso-8859-1?Q?Such=E1nek?= Cc: Renzo Davoli , linux-kernel@vger.kernel.org, Andrew Morton , Shuah Khan , Alexey Gladkov , Eugene Syromyatnikov , Davide Berardi , strace-devel@lists.strace.io, "Dmitry V . Levin" Subject: Re: [PATCH v5 0/2] PTRACE_SET_SYSCALL_INFO: add support for seccomp syscall skipping Message-ID: References: <20260709100949.94345-1-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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 Michal, thanks for your comments. On 07/10, Michal Suchánek wrote: > > this will not work at least on powerpc, and possibly s390x. > > On these architectures the syscall number and the syscall return value > share the same register. You know, PTRACE_{GET,SET}_SYSCALL_INFO code is not is not trivial in that it tries to provide the arch-neutral API to user-space, and thus we need help from experts who understand the non-x86 low level details. So perhaps you can provide more details to explain whats wrong with ppc? I too can't understand the problem. > However, the tracing hook in seccomp does not return anything, in > particular it does not change the return value of __secure_computing(). > > /* Allow the BPF to provide the event message */ > ptrace_event(PTRACE_EVENT_SECCOMP, data); Sorry, I don't understand. __secure_computing(SECCOMP_RET_TRACE) checks syscall_get_nr() checks syscall_get_nr() and returns -1 if this_syscall < 0. Note also SECCOMP_RET_USER_NOTIF, this path can skip syscall and it does syscall_set_return_value(). But yes, this path doesn't use syscall_set_nr(). > Other ways to rework the setting of the return value are possible. eg. > it was suggested to add a special field to pt_regs to hold the syscall > return value, and only copy it to the register at syscall exit. Or we can add PTRACE_SKIP_SYSCALL set by ptrace_set_syscall_info() and checked/cleared by ptrace_report_syscall_entry(). Although I'd like to avoid this at least right now. In short. Thanks again, but I can't understand your email. Please add more details? Oleg.