Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-16 Thread Christophe Leroy
Le 15/02/2022 à 10:12, Arnd Bergmann a écrit : > On Tue, Feb 15, 2022 at 9:17 AM Ard Biesheuvel wrote: >> On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: >>> From: Arnd Bergmann >>> >> >> With set_fs() out of the picture, wouldn't it be sufficient to check >> that bit #55 is clear? (the

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Mark Rutland
On Tue, Feb 15, 2022 at 09:30:41AM +, David Laight wrote: > From: Ard Biesheuvel > > Sent: 15 February 2022 08:18 > > > > On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: > > > > > > From: Arnd Bergmann > > > > > > arm64 has an inline asm implementation of access_ok() that is derived from

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Mark Rutland
On Mon, Feb 14, 2022 at 05:34:46PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > arm64 has an inline asm implementation of access_ok() that is derived from > the 32-bit arm version and optimized for the case that both the limit and > the size are variable. With set_fs() gone, the limit

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Mark Rutland
On Tue, Feb 15, 2022 at 10:39:46AM +0100, Arnd Bergmann wrote: > On Tue, Feb 15, 2022 at 10:21 AM Ard Biesheuvel wrote: > > On Tue, 15 Feb 2022 at 10:13, Arnd Bergmann wrote: > > > > arm64 also has this leading up to the range check, and I think we'd no > > longer need it: > > > > if

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Mark Rutland
On Tue, Feb 15, 2022 at 10:21:16AM +0100, Ard Biesheuvel wrote: > On Tue, 15 Feb 2022 at 10:13, Arnd Bergmann wrote: > > > > On Tue, Feb 15, 2022 at 9:17 AM Ard Biesheuvel wrote: > > > On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: > > > > From: Arnd Bergmann > > > > > > > > > > With

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Arnd Bergmann
On Tue, Feb 15, 2022 at 10:21 AM Ard Biesheuvel wrote: > On Tue, 15 Feb 2022 at 10:13, Arnd Bergmann wrote: > > arm64 also has this leading up to the range check, and I think we'd no > longer need it: > > if (IS_ENABLED(CONFIG_ARM64_TAGGED_ADDR_ABI) && > (current->flags & PF_KTHREAD

RE: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread David Laight
From: Ard Biesheuvel > Sent: 15 February 2022 08:18 > > On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: > > > > From: Arnd Bergmann > > > > arm64 has an inline asm implementation of access_ok() that is derived from > > the 32-bit arm version and optimized for the case that both the limit and

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Ard Biesheuvel
On Tue, 15 Feb 2022 at 10:13, Arnd Bergmann wrote: > > On Tue, Feb 15, 2022 at 9:17 AM Ard Biesheuvel wrote: > > On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: > > > From: Arnd Bergmann > > > > > > > With set_fs() out of the picture, wouldn't it be sufficient to check > > that bit #55 is

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Arnd Bergmann
On Tue, Feb 15, 2022 at 9:17 AM Ard Biesheuvel wrote: > On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > With set_fs() out of the picture, wouldn't it be sufficient to check > that bit #55 is clear? (the bit that selects between TTBR0 and TTBR1) > That would

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-15 Thread Ard Biesheuvel
On Mon, 14 Feb 2022 at 17:37, Arnd Bergmann wrote: > > From: Arnd Bergmann > > arm64 has an inline asm implementation of access_ok() that is derived from > the 32-bit arm version and optimized for the case that both the limit and > the size are variable. With set_fs() gone, the limit is always

Re: [PATCH 08/14] arm64: simplify access_ok()

2022-02-14 Thread Robin Murphy
On 2022-02-14 16:34, Arnd Bergmann wrote: From: Arnd Bergmann arm64 has an inline asm implementation of access_ok() that is derived from the 32-bit arm version and optimized for the case that both the limit and the size are variable. With set_fs() gone, the limit is always constant, and the

[PATCH 08/14] arm64: simplify access_ok()

2022-02-14 Thread Arnd Bergmann
From: Arnd Bergmann arm64 has an inline asm implementation of access_ok() that is derived from the 32-bit arm version and optimized for the case that both the limit and the size are variable. With set_fs() gone, the limit is always constant, and the size usually is as well, so just using the