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 A515C37C925 for ; Thu, 5 Mar 2026 14:49:59 +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=1772722200; cv=none; b=I+wlLjwmkMlGQLVEK1NUT7J5rsMFoO/T6/9nMMHp4p4pqfYs4HQErWFeQLe+R0HC0k6Vl4Hgl9W23xzzpVYTCq4xrqhPVBi7kX6Mz1vPbgCljdMJgoH3jNRCGGX65mFsIXQoQ0X7z9CNjl5K1CJ++JCg+7MuM/8I7reH9F6Cmk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772722200; c=relaxed/simple; bh=TpxMQC8x06Wn0Zp5LR+hR9F0kgu+Q/Dd7ZEJK8oJt18=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ka2ngIgn09RMuZwbBYtyEkIUCpinJSCaamgseFrEgWMv7hY3DFmWwxW6V3WuF1AjtPhlgEvO34VWLnJDOG/ADA4ehztKzcZDCQnwUMgQ8JwwNR80gOjdbGAphUdBfkMqbixUxM/IlxN1dowfhxDbwTBby0YYl2JL/Gu3IetX2U8= 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=E/eCJbJR; 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="E/eCJbJR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772722198; 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=M6dOvDC6ZsqfgTzl5sOOKWqKa2EpYtUemewgDtYzRbc=; b=E/eCJbJRMkd8ZuyVNReAa2h7KcAWjZJm6OLsUzrImZTWe78Z2sJ4Oo1gG1vU3X+QqwIcBG o+ywYHy/pliOLR+Dnqt+4r7bMdBQZMZJIetuGozFEr4ThSG83jZecT0FrOuExXI/u/LHVp UUsUnCAuL0DgGPnePcY5/1VxEd4eypM= 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-246-xXCzklqnNJCPAnzODX1h1w-1; Thu, 05 Mar 2026 09:49:53 -0500 X-MC-Unique: xXCzklqnNJCPAnzODX1h1w-1 X-Mimecast-MFC-AGG-ID: xXCzklqnNJCPAnzODX1h1w_1772722192 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 3140E1956053; Thu, 5 Mar 2026 14:49:52 +0000 (UTC) Received: from fedora (unknown [10.45.226.82]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id E20B23003E9E; Thu, 5 Mar 2026 14:49:49 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 5 Mar 2026 15:49:52 +0100 (CET) Date: Thu, 5 Mar 2026 15:49:48 +0100 From: Oleg Nesterov To: Max Ver Cc: Kees Cook , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Will Drewry Subject: Re: Process killed by seccomp looks live by tracer Message-ID: References: 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: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Hi Max, On 03/05, Max Ver wrote: > > >This is expected; PTRACE_GET_SYSCALL_INFO is at syscall entry before seccomp filtering has run. > > It also happens at the syscall exit. Take a look at the result, it > shows 'exit ok' twice. Why do you think this is wrong? (and I don't think this has something to do with seccomp, btw). > If we can agree on this is a bug, I suggest the kernel give a hint > about tracee exit in waitpid return value, what do you think? But the kernel already gives you a hint, no? Perhaps I missed your point, but see the change of your test-case below. Oleg. --- /tmp/PT.c~ 2026-03-05 15:18:18.397319905 +0100 +++ /tmp/PT.c 2026-03-05 15:40:11.044415647 +0100 @@ -15,6 +15,8 @@ #include #include #include +#include +#include void child () @@ -57,6 +59,14 @@ puts ("child exit"); exit (1); } + + if (WIFSIGNALED(status)) { + printf("signalled pid=%d sig=%d\n", pid, WTERMSIG(status)); + assert(kill(pid, 0) == -1 && errno == ESRCH); + exit(0); + } + + if (ptrace (PTRACE_GET_SYSCALL_INFO, pid, sizeof (struct ptrace_syscall_info), &info) == -1)