Thread (9 messages) 9 messages, 7 authors, 2023-03-09

Re: [PATCH v4 2/2] selftests/powerpc: Add a test for execute-only memory

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2022-08-20 06:30:58
Also in: linux-hardening

Nicholas Miehlbradt [off-list ref] writes:
On 17/8/2022 4:15 pm, Jordan Niethe wrote:
quoted
On Wed, 2022-08-17 at 15:06 +1000, Russell Currey wrote:
quoted
From: Nicholas Miehlbradt <redacted>

This selftest is designed to cover execute-only protections
on the Radix MMU but will also work with Hash.

The tests are based on those found in pkey_exec_test with modifications
to use the generic mprotect() instead of the pkey variants.
Would it make sense to rename pkey_exec_test to exec_test and have this test be apart of that?
I think might make it unnecessarily complex. The checks needed when 
testing with pkeys would mean that it would be necessary to check if 
pkeys are enabled and choose which set of tests to run depending on the 
result. The differences are substantial enough that it would be 
challenging to combine them into a single set of tests.
Yeah I think I agree. Having each test stand on its own is nice for
debugging also.

In general I'm less bothered about code duplication in tests. We should
try and share code where we can, but it's more important that we have
tests at all, rather than blocking new tests because they duplicate some
code from another test.

So I'm inclined to merge this as-is, we can always refactor it to share
code in future if we think there's enough commonality to warrant it.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help