From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 41EA0239E7E; Mon, 2 Mar 2026 16:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772467646; cv=none; b=reeuRA+VSJhonI8Q5VyBiWxP80uEhu2YAMIMkQVlwSFU+3cmYLKsgsVCcZpeD5+QbsVB0IdAmz/yZ6spwRutGyTK/LTVhkI9bpBbA9gyyA6tdD/m9PtinzZmR7EBb6gpveH1tEJ9MOpZnUdvxvvzTvS/WERX2WIXWWe+nhokA+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772467646; c=relaxed/simple; bh=Q4f5IphZs1HK0nenixYFPe8rEaCz8xjgoIeWN6zDZUo=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=N35w4jyFQLjxT7lavDk9XeqLyKxpDR3kwoofeqW3ueyak3QjcbOyqMEbq4/9d4/6am4QLhtKWNX7d6CEDLAtN8fJzKCAZdAe5ymK+Ox/GTZQYRnOgxj9WJT/duErdjNZ0pFn48kLk1iHrY4KRwhcvyA0WX5fam0D6b7xFfOOGWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IMLp9T97; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IMLp9T97" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88AD7C19423; Mon, 2 Mar 2026 16:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772467645; bh=Q4f5IphZs1HK0nenixYFPe8rEaCz8xjgoIeWN6zDZUo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=IMLp9T97Z1WGqMa4vKl8aLMG1SCE+RTETM4LF9HiMKYx4UrsyfNc9AmTDAGMeQxpx atWX3a+51jxWTnQfRmsvdiTbUN5rkz4n69cFBN9Vaugs7LwCYmh6fDHvK5BH95218S WjTE7/IyxVl5IgiZ9xplzxjGM5hkgVvNAXL1Z1enx+z/+fXCcGFwXMTuwRFFzTqiGk S9kzt7FFHlwJc14uSgPaUHzirBOUCLO109ioqQTYkZsBASo9Vte2pZwBVGSWpTn/BA OyyNKXo2fT5eBtBhIb63i0iitx6BOkgqZj36M2Gp4ZCV608BRToV1uBjtWBe/i8M7c IezwEcB5TWUBA== Message-ID: <5cef9283-c718-4832-9ef6-71f1722cb8e1@kernel.org> Date: Mon, 2 Mar 2026 17:07:14 +0100 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 next 5/5] signal: Use scoped_user_access() instead of __put/get_user() To: david.laight.linux@gmail.com, Alexander Viro , Andre Almeida , Andrew Cooper , Christian Borntraeger , Christian Brauner , Christophe Leroy , Darren Hart , Davidlohr Bueso , Heiko Carstens , Jan Kara , Julia Lawall , Linus Torvalds , linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, LKML , Madhavan Srinivasan , Mathieu Desnoyers , Michael Ellerman , Nicholas Piggin , Nicolas Palix , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Russell King , Sven Schnelle , Thomas Gleixner , x86@kernel.org, Kees Cook , akpm@linux-foundation.org References: <20260302132755.1475451-1-david.laight.linux@gmail.com> <20260302132755.1475451-6-david.laight.linux@gmail.com> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <20260302132755.1475451-6-david.laight.linux@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 02/03/2026 à 14:27, david.laight.linux@gmail.com a écrit : > From: David Laight > > Mechanically change the access_ok() and __get/put_user() to use > scoped_user_read/write_access() and unsafe_get/put_user(). > > This generates better code with fewer STAC/CLAC pairs. > > It also ensures that access_ok() is called near the user accesses. > I failed to find the one for __save_altstack(). On arm64 it's done in get_sigframe() it seems. > > Looking at the change, perhaps there should be aliases: > #define scoped_put_user unsafe_put_user > #define scoped_get_user unsafe_get_user Might be confusing to have two macros doing exactly the same thing. And the churn might be unnecessary on some code that already widely use unsafe_xxx macros and that we want to convert to scoped user access, like for instance arch/powerpc/kernel/signal_32.c Christophe