Re: [PATCH v12 20/22] selftests/vm: testcases must restore pkey-permissions

From: Dave Hansen
Date: Fri Mar 16 2018 - 18:32:54 EST


On 02/21/2018 05:55 PM, Ram Pai wrote:
> Generally the signal handler restores the state of the pkey register
> before returning. However there are times when the read/write operation
> can legitamely fail without invoking the signal handler. Eg: A
> sys_read() operaton to a write-protected page should be disallowed. In
> such a case the state of the pkey register is not restored to its
> original state. The test case is responsible for restoring the key
> register state to its original value.

Oh, that's a good point.

Could we just do this in a common place, though? Like reset the
register after each test? Seems more foolproof.