提交 de113256 编写于 作者: R Ram Pai 提交者: Michael Ellerman

powerpc/pkeys: Deny read/write/execute by default

Deny all permissions on all keys, with some exceptions. pkey-0 must
allow all permissions, or else everything comes to a screaching halt.
Execute-only key must allow execute permission.

Fixes: cf43d3b2 ("powerpc: Enable pkey subsystem")
Cc: stable@vger.kernel.org # v4.16+
Signed-off-by: NRam Pai <linuxram@us.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 a57a04c7
...@@ -124,12 +124,10 @@ int pkey_initialize(void) ...@@ -124,12 +124,10 @@ int pkey_initialize(void)
/* register mask is in BE format */ /* register mask is in BE format */
pkey_amr_mask = ~0x0ul; pkey_amr_mask = ~0x0ul;
pkey_iamr_mask = ~0x0ul; pkey_amr_mask &= ~(0x3ul << pkeyshift(0));
for (i = 0; i < (pkeys_total - os_reserved); i++) { pkey_iamr_mask = ~0x0ul;
pkey_amr_mask &= ~(0x3ul << pkeyshift(i)); pkey_iamr_mask &= ~(0x3ul << pkeyshift(0));
pkey_iamr_mask &= ~(0x1ul << pkeyshift(i));
}
pkey_uamor_mask = ~0x0ul; pkey_uamor_mask = ~0x0ul;
pkey_uamor_mask &= ~(0x3ul << pkeyshift(0)); pkey_uamor_mask &= ~(0x3ul << pkeyshift(0));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册