powerpc fixes for 5.8 #5

One fix for a regression in our pkey handling, which exhibits as PROT_EXEC
 mappings taking continuous page faults.
 
 Thanks to:
   Jan Stancek, Aneesh Kumar K.V.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAl8AgLcTHG1wZUBlbGxl
 cm1hbi5pZC5hdQAKCRBR6+o8yOGlgPPVD/9ocLMHUsHTOtZCpSjJ/FcQILDapUty
 /TRutcDxS8YYEyvUn+Azhsezigr+raeHsiqw7qA9xk763RfCmGNb35GyTGgA/93L
 XLN7P04O8tQSz5Nm9AGB2d0HOD7Y/ihabtQ9dZf6SYwEupfP5reA39uj/11gqOlP
 6iHhzf0hyjREojy/fjsP+4J5FSukkmte/d2HiRfgwyfAkWvhCsp3cqu7wtciD/8g
 kCyl2TY0vpbaRaW6jGNwZD9pp6rVOQzc13F+ery6oqKuVdpmg3ormrBXtE+oATXS
 IX4qsO3nRO/nuImaWFW9nkM3s4RNMjNYYWwjC6XrqD6IqlLUgxsESorI6ShvCuiA
 kwI2auSxqesdmBNOpVB0qvdShKyVO1Xcy2ImGgHq0YNgwKpkR8e8xKqJKIXxBHOj
 jGHneLrH2NzJMIQOwdCPVjoxoQdIcIs2B5L20bCVvtAEtSr4rSPeTpxPEdbikiKv
 tQP2eRO9n2LNSxX8+aLdfytzOThS9LDDUa+zAaWl94lNNzcLnCvMjnRoYYHoISq4
 x+ncTs1h1j2Z7GmYCLAEOUUuLyDR7HXszxVtIQYK1MHcFz+prcorlKNTZ4ai4Azu
 eMDMJvavmXhkAmCkqL6W8CoWsK1sBDdcS2iBWm+EAsyhIHum2YJWDZb4O5bzNQxK
 1HBgRcjpsDUWQQ==
 =c2Xc
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-5.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 "One fix for a regression in our pkey handling, which exhibits as
  PROT_EXEC mappings taking continuous page faults.

  Thanks to: Jan Stancek, Aneesh Kumar K.V"

* tag 'powerpc-5.8-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/mm/pkeys: Make pkey access check work on execute_only_key
This commit is contained in:
Linus Torvalds 2020-07-04 14:46:11 -07:00
commit 9bc0b029a8

View File

@ -353,9 +353,6 @@ static bool pkey_access_permitted(int pkey, bool write, bool execute)
int pkey_shift;
u64 amr;
if (!is_pkey_enabled(pkey))
return true;
pkey_shift = pkeyshift(pkey);
if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift)))
return true;