summaryrefslogtreecommitdiff
path: root/tools/perf/util/llvm-utils.c
diff options
context:
space:
mode:
authorDave Hansen <dave.hansen@linux.intel.com>2021-06-30 18:56:56 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 17:00:29 +0200
commit3d90dd991117187d1c1d796ba7cacff4b8ea9e67 (patch)
treee6692cd5c530c4e903351ac44962bd5ab3b065e4 /tools/perf/util/llvm-utils.c
parent661833f0b896d6117b2b0bfb2d4cb05a822b8c05 (diff)
selftests/vm/pkeys: handle negative sys_pkey_alloc() return code
[ Upstream commit bf68294a2ec39ed7fec6a5b45d52034e6983157a ] The alloc_pkey() sefltest function wraps the sys_pkey_alloc() system call. On success, it updates its "shadow" register value because sys_pkey_alloc() updates the real register. But, the success check is wrong. pkey_alloc() considers any non-zero return code to indicate success where the pkey register will be modified. This fails to take negative return codes into account. Consider only a positive return value as a successful call. Link: https://lkml.kernel.org/r/20210611164157.87AB4246@viggo.jf.intel.com Fixes: 5f23f6d082a9 ("x86/pkeys: Add self-tests") Reported-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Cc: Ram Pai <linuxram@us.ibm.com> Cc: Sandipan Das <sandipan@linux.ibm.com> Cc: Florian Weimer <fweimer@redhat.com> Cc: "Desnes A. Nunes do Rosario" <desnesn@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Hocko <mhocko@kernel.org> Cc: Michal Suchanek <msuchanek@suse.de> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/util/llvm-utils.c')
0 files changed, 0 insertions, 0 deletions