In the Linux kernel, the following vulnerability has been resolved:
tee: add overflow check in registershmhelper()
With special lengths supplied by user space, registershmhelper() has an integer overflow when calculating the number of pages covered by a supplied user space memory region.
This causes internalgetuserpagesfast() a helper function of pinuserpages_fast() to do a NULL pointer dereference:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 Modules linked in: CPU: 1 PID: 173 Comm: opteeexamplea Not tainted 5.19.0 #11 Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 pc : internalgetuserpagesfast+0x474/0xa80 Call trace: internalgetuserpagesfast+0x474/0xa80 pinuserpagesfast+0x24/0x4c registershmhelper+0x194/0x330 teeshmregisteruserbuf+0x78/0x120 teeioctl+0xd0/0x11a0 _arm64sysioctl+0xa8/0xec invokesyscall+0x48/0x114
Fix this by adding an an explicit call to accessok() in teeshmregisteruser_buf() to catch an invalid user space address early.
[
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 728.0,
"function_hash": "28443167699853937140995905201144173213"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@58c008d4d398f792ca67f35650610864725518fd",
"target": {
"file": "drivers/tee/tee_shm.c",
"function": "tee_shm_register_user_buf"
},
"id": "CVE-2022-50080-0242ffd0"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"265984770103937900484163199271551282892",
"335648614922668004229568885028754206355",
"163582933476025735185999655981004348281"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b37e0f17653c00b586cdbcdf0dbca475358ecffd",
"target": {
"file": "drivers/tee/tee_core.c"
},
"id": "CVE-2022-50080-24fe06e8"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2331.0,
"function_hash": "206407403184100341777693781820110640887"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@578c349570d2a912401963783b36e0ec7a25c053",
"target": {
"file": "drivers/tee/tee_shm.c",
"function": "tee_shm_register"
},
"id": "CVE-2022-50080-825668f6"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"244746315607355994601871202319532291365",
"320085526601381889113345421851798113717",
"289975255218322047916177943283907324310"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@578c349570d2a912401963783b36e0ec7a25c053",
"target": {
"file": "drivers/tee/tee_shm.c"
},
"id": "CVE-2022-50080-94851a45"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 559.0,
"function_hash": "279533331725148918643918055278514281657"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b37e0f17653c00b586cdbcdf0dbca475358ecffd",
"target": {
"file": "drivers/tee/tee_core.c",
"function": "tee_ioctl_shm_register"
},
"id": "CVE-2022-50080-a0b37280"
}
]