]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/lam: Test get_user() LAM pointer handling
authorMaciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Mon, 27 Jan 2025 15:31:57 +0000 (16:31 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 22 Feb 2025 12:17:07 +0000 (13:17 +0100)
commit782b819827ee84532f3069e37aa091c1be00fa44
tree05349d8fdb6735c8019a47537dc43b58e918e42c
parent51f909dcd178655b104d979a6870535268724498
selftests/lam: Test get_user() LAM pointer handling

Recent change in how get_user() handles pointers:

  https://lore.kernel.org/all/20241024013214.129639-1-torvalds@linux-foundation.org/

has a specific case for LAM. It assigns a different bitmask that's
later used to check whether a pointer comes from userland in get_user().

Add test case to LAM that utilizes a ioctl (FIOASYNC) syscall which uses
get_user() in its implementation. Execute the syscall with differently
tagged pointers to verify that valid user pointers are passing through
and invalid kernel/non-canonical pointers are not.

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/1624d9d1b9502517053a056652d50dc5d26884ac.1737990375.git.maciej.wieczor-retman@intel.com
tools/testing/selftests/x86/lam.c