]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
x86/pkeys/selftests: Fix pkey exhaustion test off-by-one
authorDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 May 2018 17:13:50 +0000 (10:13 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Oct 2018 12:57:00 +0000 (14:57 +0200)
commitae3780450efe2302c06d8d60914b99c858c8e48c
treef93919729d85f76894d26450d808d8f7c184801d
parenta0c68652a50a3cace47d1d67e2fce668d61247e0
x86/pkeys/selftests: Fix pkey exhaustion test off-by-one

BugLink: http://bugs.launchpad.net/bugs/1794889
[ Upstream commit f50b4878329ab61d8e05796f655adeb6f5fb57c6 ]

In our "exhaust all pkeys" test, we make sure that there
is the expected number available.  Turns out that the
test did not cover the execute-only key, but discussed
it anyway.  It did *not* discuss the test-allocated
key.

Now that we have a test for the mprotect(PROT_EXEC) case,
this off-by-one issue showed itself.  Correct the off-by-
one and add the explanation for the case we missed.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Ellermen <mpe@ellerman.id.au>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ram Pai <linuxram@us.ibm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20180509171350.E1656B95@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/testing/selftests/x86/protection_keys.c