On Tue, 11 Jun 2024 at 05:02, Kees Cook <[email protected]> wrote: > > When reworking the range checking for get_user(), the get_user_8() case > on 32-bit wasn't zeroing the high register. (The jump to bad_get_user_8 > was accidentally dropped.) Restore the correct error handling > destination (and rename the jump to using the expected ".L" prefix). > > While here, switch to using a named argument ("size") for the call > template ("%c4" to "%c[size]") as already used in the other call > templates in this file. > > Found after moving the usercopy selftests to KUnit: > > # usercopy_test_invalid: EXPECTATION FAILED at > lib/usercopy_kunit.c:278 > Expected val_u64 == 0, but > val_u64 == -60129542144 (0xfffffff200000000) > > Reported-by: David Gow <[email protected]> > Closes: > https://lore.kernel.org/all/CABVgOSn=tb=lj9sxhut4_9mtjjkvxsq-ikdxc4kgho4cfkv...@mail.gmail.com > Fixes: b19b74bc99b1 ("x86/mm: Rework address range check in get_user() and > put_user()") > Signed-off-by: Kees Cook <[email protected]> > --- > Cc: Thomas Gleixner <[email protected]> > Cc: Ingo Molnar <[email protected]> > Cc: Borislav Petkov <[email protected]> > Cc: Dave Hansen <[email protected]> > Cc: [email protected] > Cc: "H. Peter Anvin" <[email protected]> > Cc: Sean Christopherson <[email protected]> > Cc: Peter Zijlstra <[email protected]> > Cc: Arnd Bergmann <[email protected]> > Cc: "Kirill A. Shutemov" <[email protected]> > Cc: Qiuxu Zhuo <[email protected]> > Cc: Nadav Amit <[email protected]> > Cc: Masahiro Yamada <[email protected]> > ---
Thanks: this fixes it here, both under qemu and on real hardware. Tested-by: David Gow <[email protected]> -- David
smime.p7s
Description: S/MIME Cryptographic Signature
