From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 76EEB1E5702 for ; Sat, 27 Jun 2026 04:43:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782535427; cv=none; b=rO5NU0dPmMuD3UDH1xwG1/QGZRJRDRFxHJX+R6tXV3kVmFY+8fTykGtDOW0T/5/W+r43bUZBntjpCwQeoOl3/zkjwVpAqfOHyfCs7b4B1X2x030cfcqmAsJqM0yp3k3D2mbp7Sb1BYDd/7EHIcLOt8s26pMbWiJqBlJsmUFS7sU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782535427; c=relaxed/simple; bh=vO/bu1bkqYFAa72dXKGjo23OL+Ao0WNevZEiMN+/Srk=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=mlQ4ver1HZeQpK3YtRjrcUM1tFZfLa+Y2dL661BJUF/YlVwVQpVGEEztwJe6g1xLlSRYqlc6ZVvGrGrkpKE0HYUkuV2UXmKQwGnvWlQySOV1uamJVlbwpKg+vc7hfyU+f8jT5/hBsq6/uXKw7h0xAqRn3tGGeh9lJXo8YrysMTY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=sS73z00q; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="sS73z00q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5D7A1F000E9; Sat, 27 Jun 2026 04:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1782535426; bh=VTHBMgLRsJ8I4B5XDuSy1XEC3oI8SAw7TJAZm1NPnKc=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=sS73z00qlkOua9wcrNHLEJ8lZun2b/oyDm0pzR0uffbXq9iHpQ2NdQu0IkgEAokcN k/1auQmJ1C3A0DRAsPshTeoVfV2Q8tzXHIVwUdOvClcSeCHBPG+sgG/fMaIIzQbABq ZvEDxBRpj8Dzya75bJriUZueekOtJvecjsi4dCZc= Date: Fri, 26 Jun 2026 21:43:45 -0700 From: Andrew Morton To: Cong Wang Cc: Andy Lutomirski , Kees Cook , linux-kernel@vger.kernel.org, Will Drewry , Christian Brauner , linux-mm@kvack.org Subject: Re: [PATCH v4 0/6] seccomp: non-cooperative pinned-memfd argument redirect Message-Id: <20260626214345.5590f05f946872a7a9565c41@linux-foundation.org> In-Reply-To: <20260627012219.1079851-1-xiyou.wangcong@gmail.com> References: <20260627012219.1079851-1-xiyou.wangcong@gmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Fri, 26 Jun 2026 18:22:13 -0700 Cong Wang wrote: > The seccomp user-notification SECCOMP_USER_NOTIF_FLAG_CONTINUE response > carries an inherent TOCTOU: once the supervisor decides to let a syscall > continue, the target (or a CLONE_VM peer) can rewrite the memory behind a > pointer argument before the kernel reads it. This is documented in the > UAPI header and is why the notifier "cannot be used to implement a > security policy" today. > > The cooperative way around this is for the target to map a shared memfd > and mseal() it during a trusted setup window, so the supervisor can hand > the kernel an immutable buffer. That window does not exist for the common > fork()+execve() sandbox model, where the supervisor wants to confine an > uncooperative (or legacy) binary it did not write. > > This series lets the supervisor close the TOCTOU without any target-side > cooperation: AI review went crazy over this. I hope there's something useful in there: https://sashiko.dev/#/patchset/20260627012219.1079851-1-xiyou.wangcong@gmail.com