Go to file
Andrew Cooper 692e6a0c35 x86/pkey: Fix undefined behaviour with PKRU_WD_BIT
commit 57690554ab upstream.

Both __pkru_allows_write() and arch_set_user_pkey_access() shift
PKRU_WD_BIT (a signed constant) by up to 30 bits, hitting the
sign bit.

Use unsigned constants instead.

Clearly pkey 15 has not been used in combination with UBSAN yet.

Noticed by code inspection only.  I can't actually provoke the
compiler into generating incorrect logic as far as this shift is
concerned.

[
  dhansen: add stable@ tag, plus minor changelog massaging,

           For anyone doing backports, these #defines were in
	   arch/x86/include/asm/pgtable.h before 784a46618f.
]

Fixes: 33a709b25a ("mm/gup, x86/mm/pkeys: Check VMAs and PTEs for protection keys")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20211216000856.4480-1-andrew.cooper3@citrix.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Xinghui Li <korantli@tencent.com>
2024-06-11 21:06:15 +08:00
Documentation ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
LICENSES LICENSES: Rename other to deprecated 2019-05-03 06:34:32 -06:00
arch x86/pkey: Fix undefined behaviour with PKRU_WD_BIT 2024-06-11 21:06:15 +08:00
block ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
certs ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
crypto ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
dist ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
drivers ice: update E810 100g nic driver 2024-06-11 21:05:23 +08:00
fs introduction of regset ->get() wrappers, switching ELF coredumps to those 2024-06-11 21:05:54 +08:00
include mm: Add a pasid member to struct mm_struct 2024-06-11 21:05:57 +08:00
init ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
ipc ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
kernel regset: new method and helpers for it 2024-06-11 21:05:54 +08:00
lib ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
mm x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid() 2024-06-11 21:05:59 +08:00
net ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
package ice: update E810 100g nic driver 2024-06-11 21:05:23 +08:00
samples ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
scripts ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
security ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
sound ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
tools ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
usr tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
virt KVM: SVM: avoid infinite loop on NPF from bad address 2024-06-11 21:05:42 +08:00
.clang-format clang-format: Update with the latest for_each macro list 2019-08-31 10:00:51 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
.gitignore ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS MAINTAINERS: Remove Simon as Renesas SoC Co-Maintainer 2019-10-10 08:12:51 -07:00
Kbuild kbuild: do not descend to ./Kbuild when cleaning 2019-08-21 21:03:58 +09:00
Kconfig docs: kbuild: convert docs to ReST and rename to *.rst 2019-06-14 14:21:21 -06:00
MAINTAINERS ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
Makefile ock: sync codes to ock 5.4.119-20.0009.21 2024-06-11 20:27:38 +08:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00
README.md tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
backport_remove_lists.txt tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00
tools_key.pub tkernel: add base tlinux kernel interfaces 2024-06-11 20:09:33 +08:00

README.md

Tencent Linux Kernel 4.0