From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796227604; b=W4mjf6TedzEhYY7VXaKOHSVD2+GcPsuuMujz59s3A4EBymweZEMYNoRnH7w9lLzRJPIZ toRK3EY5Jjc7sGPVVIL0InBGReFk6Pf8Rk8IdRo1vFxMuIpZeGU9UNnzhipsFUAKPF3su aFA1O2l2Dvu5EWX+/KMnuzUm7q8bNIE02aTtkfXL2gz/p4YyCGRsZKpniEdbi37qfrWWj cUYxR5tmiXmOgT803lp3hP107n3IaFLoXfS47W4sN0VfbBaEOgnXmIlpA6Ptq5ZdEUtia ZOPPyioGH76+9Oy5UjkPgyxXaORTg7H1/MwpQtzm22NWpO2qJQqEUqchs53bH8t6evg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796227604; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=d6UFakdXganQDtJe83SFYjvbBNrcBBcnp5XxIkXwk0Q=; b=MefkormvJi4n/a6AGwcGH2AcY2BeM1Jot3rfVzC5OXdC5imeNsI4qQGAD5f5Eud81KdX lXPPlSoslyNFvSsFRZHRktR8z/SzbnBVWp5ekxLaHrgU8smDfWii2SfXMVtllxuRumLBg keiuZmq+7/7MfBmPlJQRZwnLHwx2itQ1aP4z/8lusXWSl0OLf/ZuivDtVooieYfTkzJIs 9pkK2LYuI/boO30rnNlZ16Yi1/Njl1CSSsxYaheP/cIzDZras7gOH5W9fLUTyGxn0kuzz P0T8Zmok6ZyWDuZAfgJWRD6pMQvmpJKHQQ01w7Nb4yY5E0m2Ah14xwzp8N8MMp2y7uA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="hWp/7PUF"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFBE3606A31A; Wed, 2 Dec 2026 16:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hWp/7PUF Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6484F1F00896; Wed, 2 Dec 2026 16:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796227604; bh=d6UFakdXganQDtJe83SFYjvbBNrcBBcnp5XxIkXwk0Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=hWp/7PUFtg6BHZ65SUbT4bOKeDRyd/1EcMeHjUJg6VPgjn4Sg/dRY1CuOlgbnWzpm NaXUUtBvtUHoHwDKR3wdPeRNvA7csSf+FQGStIaPpzIv+PYPOIOzOjM9E8AF4dVykS E6ejfL2h5yDVTLdeYIE0L2DndozTpD6pxA7FKjj6F3kE44G2FhUriUUKwrFaeFCEyg rMoDIV/0ZqOrjDeGdrJE8PCWzvd9QmpHSF/Owp0X0IXx1AHt7yU2c+QtSdrqdGwNsT ZByJh8k2bXq+2dDxM8mJNqHgJ6igcfhDA3diHYA+z3XaZEYr8T4v9PWJ2vP3oRKF/N hfYkYin5eVRlA== Message-ID: Date: Wed, 2 Dec 2026 17:06:30 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 00/12] uaccess: Refuse and warn on user accesses when current->mm is NULL To: Dave Hansen , James Houghton , Andrew Morton , Alexander Viro , Arnd Bergmann Cc: Sean Christopherson , Paolo Bonzini , Jim Mattson , Jens Axboe , David Hildenbrand , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Madhavan Srinivasan , Chris Zankel , Max Filippov , Dinh Nguyen , Simon Schuster , David Sterba , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , KP Singh , Matt Bobrowski , Peter Zijlstra , Arnaldo Carvalho de Melo , Namhyung Kim , Steven Rostedt , Masami Hiramatsu , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, io-uring@vger.kernel.org References: <20261202023920.595207-1-jthoughton@google.com> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 02/12/2026 à 16:24, Dave Hansen a écrit : > On 12/2/26 07:04, Christophe Leroy (CS GROUP) wrote: >> Also about the masked user access path, the principle of that path is to >> be branch-less, the whole purpose was the remove the test/branch from >> access_ok(). With your new check it is not anymore branch-less > > Branches themselves are OK. The problem branches are around access > checks because they potentially allow transient execution paths to skip > the checking. > > In this case, the new check forces a return before any accesses happen > or any bounds checks are done. If the new check was incorrectly > speculated, we'd just have transient execution doing what the > *architectural* path is allowed to do today. > > I _think_ that's OK, at least from a spectre v1 perspective. But it > could definitely use some more eyeballs on it. Thanks for the explanation. > > I do agree with you about the code size concerns. > Behind the code size, my worry is that for a simple get_user() with is more or less a simple memory read, we end up with 3 memory reads because we first need to read paca->__current, then paca->__current->mm Other point, is current->mm == NULL the only problematic situation ? No risk to have ->mm not NULL yet not the right one ? Isn't it this that had to be fixed by commit 2520694e6048 ("KVM: Reject user accesses to guest memory if current->mm != kvm->mm") ? Christophe