[PATCH v5 08/10] ARM: uaccess: add __{get,put}_kernel_nofault

Russell King (Oracle) linux at armlinux.org.uk
Wed Jan 12 10:08:17 PST 2022


On Wed, Jan 12, 2022 at 05:29:03PM +0000, Daniel Thompson wrote:
> On Mon, Jul 26, 2021 at 04:11:39PM +0200, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd at arndb.de>
> > 
> > These mimic the behavior of get_user and put_user, except
> > for domain switching, address limit checking and handling
> > of mismatched sizes, none of which are relevant here.
> > 
> > To work with pre-Armv6 kernels, this has to avoid TUSER()
> > inside of the new macros, the new approach passes the "t"
> > string along with the opcode, which is a bit uglier but
> > avoids duplicating more code.
> > 
> > As there is no __get_user_asm_dword(), I work around it
> > by copying 32 bit at a time, which is possible because
> > the output size is known.
> > 
> > Signed-off-by: Arnd Bergmann <arnd at arndb.de>
> 
> I've just been bisecting some regressions running the kgdbts tests on
> arm and this patch came up.

So the software PAN code is working :)

The kernel attempted to access an address that is in the userspace
domain (NULL pointer) and took an exception.

I suppose we should handle a domain fault more gracefully - what are
the required semantics if the kernel attempts a userspace access
using one of the _nofault() accessors?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!



More information about the linux-arm-kernel mailing list