diff options
| author | Dave Hansen <[email protected]> | 2020-01-22 16:53:46 +0000 |
|---|---|---|
| committer | Borislav Petkov <[email protected]> | 2020-02-24 19:25:21 +0000 |
| commit | 16171bffc829272d5e6014bad48f680cb50943d9 (patch) | |
| tree | 949d53c86860ed8ad63f68917f3c68df88bb9842 /tools/perf/util/scripting-engines/trace-event-python.c | |
| parent | x86/fpu/xstate: Warn when checking alignment of disabled xfeatures (diff) | |
| download | kernel-16171bffc829272d5e6014bad48f680cb50943d9.tar.gz kernel-16171bffc829272d5e6014bad48f680cb50943d9.zip | |
x86/pkeys: Add check for pkey "overflow"
Alex Shi reported the pkey macros above arch_set_user_pkey_access()
to be unused. They are unused, and even refer to a nonexistent
CONFIG option.
But, they might have served a good use, which was to ensure that
the code does not try to set values that would not fit in the
PKRU register. As it stands, a too-large 'pkey' value would
be likely to silently overflow the u32 new_pkru_bits.
Add a check to look for overflows. Also add a comment to remind
any future developer to closely examine the types used to store
pkey values if arch_max_pkey() ever changes.
This boots and passes the x86 pkey selftests.
Reported-by: Alex Shi <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions
