CVE-2022-49870
JSON

7.1high

capabilities: fix undefined behavior in bit shift for CAP_TO_MASK

Severity
7.1high CVSS:3.1 by NVD
Exploit likelihood
0.29% (higher than 14% of CVEs)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: capabilities: fix undefined behavior in bit shift for CAP_TO_MASK Shifting signed 32-bit value by 31 bits is undefined, so changing significant bit to unsigned. The UBSAN warning calltrace like below: UBSAN: shift-out-of-bounds in security/commoncap.c:1252:2 left shift of 1 by 31 places cannot be represented in type 'int' Call Trace: <TASK> dump_stack_lvl+0x7d/0xa5 dump_stack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c cap_task_prctl+0x561/0x6f0 security_task_prctl+0x5a/0xb0 __x64_sys_prctl+0x61/0x8f0 do_syscall_64+0x58/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK>

Affected

Product or packageVersionsReported by
Linux Linuxfrom e338d263a76af78fe8f38a72131188b58fceb591 before 5b79fa628e2ab789e629a83cd211ef9b4c1a593e, from e338d263a76af78fe8f38a72131188b58fceb591 before 65b0bc7a0690861812ade523d19f82688ab819dc, from e338d263a76af78fe8f38a72131188b58fceb591 before dbaab08c8677d598244d21afb7818e44e1c5d826, from e338d263a76af78fe8f38a72131188b58fceb591 before 5661f111a1616ac105ec8cec81bff99b60f847ac, from e338d263a76af78fe8f38a72131188b58fceb591 before fcbd2b336834bd24e1d9454ad5737856470c10d7, from e338d263a76af78fe8f38a72131188b58fceb591 before 151dc8087b5609e53b069c068e3f3ee100efa586, from e338d263a76af78fe8f38a72131188b58fceb591 before 27bdb134c043ff32c459d98f16550d0ffa0b3c34, from e338d263a76af78fe8f38a72131188b58fceb591 before 46653972e3ea64f79e7f8ae3aa41a4d3fdb70a13 and 1 more
Not affected: before 2.6.25, from 4.9.334 up to 4.9.*, from 4.14.300 up to 4.14.*, from 4.19.267 up to 4.19.*, from 5.4.225 up to 5.4.*, from 5.10.155 up to 5.10.*
CVE List
linux linux_kernelfrom 2.6.25 before 4.9.334, from 4.10 before 4.14.300, from 4.15 before 4.19.267, from 4.20 before 5.4.225, from 5.5 before 5.10.155, from 5.11 before 5.15.79, from 5.16 before 6.0.9, 6.1NVD

Classification

CWE-125

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: capabilities: fix undefined behavior in bit shift for CAP_TO_MASK Shifting signed 32-bit value by 31 bits is undefined, so changing significant bit to unsigned. The UBSAN warning calltrace like below: UBSAN: shift-out-of-bounds in security/commoncap.c:1252:2 left shift of 1 by 31 places cannot be represented in type 'int' Call Trace: <TASK> dump_stack_lvl+0x7d/0xa5 dump_stack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c cap_task_prctl+0x561/0x6f0 security_task_prctl+0x5a/0xb0 __x64_sys_prctl+0x61/0x8f0 do_syscall_64+0x58/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK>

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: capacidades: corregir comportamiento indefinido en el cambio de bits para CAP_TO_MASK El cambio de un valor con signo de 32 bits por 31 bits no está definido, por lo que se cambia el bit significativo a sin signo. El seguimiento de llamadas de advertencia de UBSAN como se muestra a continuación: UBSAN: desplazamiento fuera de los límites en security/commoncap.c:1252:2 El desplazamiento a la izquierda de 1 por 31 lugares no se puede representar en el tipo 'int' Seguimiento de llamadas: dump_stack_lvl+0x7d/0xa5 dump_stack+0x15/0x1b ubsan_epilogue+0xe/0x4e __ubsan_handle_shift_out_of_bounds+0x1e7/0x20c cap_task_prctl+0x561/0x6f0 security_task_prctl+0x5a/0xb0 __x64_sys_prctl+0x61/0x8f0 do_syscall_64+0x58/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd

References

Sources

SourceRecordLicence
CVE ListCVE-2022-49870 changed 2026-11-05CVE Terms of Use
NVDCVE-2022-49870 changed 2026-11-05Public domain