CVE-2022-49985 Information
Description
In the Linux kernel the following vulnerability has been resolved:
bpf: Don’t use tnum_range on array range checking for poke descriptors
Hsin-Wei reported a KASAN splat triggered by their BPF runtime fuzzer which is based on a customized syzkaller:
BUG: KASAN: slab-out-of-bounds in bpf_int_jit_compile+0x1257/0x13f0
Read of size 8 at addr ffff888004e90b58 by task syz-executor.0/1489
CPU: 1 PID: 1489 Comm: syz-executor.0 Not tainted 5.19.0 1
Hardware name: QEMU Standard PC (i440FX + PIIX 1996) BIOS
1.13.0-1ubuntu1.1 04/01/2014
Call Trace:
The problem here is that a range of tnum_range(0 map->max_entries - 1) has limited ability to represent the concrete tight range with the tnum as the set of resulting states from value + mask can result in a superset of the actual intended range and as such a tnum_in(range reg->var_off) check may yield true when it shouldn’t for example tnum_range(0 2) would result in 00XX -> v = 0000 m = 0011 such that the intended set of 0 1 2 is here represented by a less precise superset of 0 1 2 3. As the register is known const scalar really just use the concrete reg->var_off.value for the upper index check.
Reference
https://git.kernel.org/stable/c/4f672112f8665102a5842c170be1713f8ff95919 https://git.kernel.org/stable/c/a36df92c7ff7ecde2fb362241d0ab024dddd0597 https://git.kernel.org/stable/c/a657182a5c5150cdfacb6640aad1d2712571a409 https://git.kernel.org/stable/c/e8979807178434db8ceaa84dfcd44363e71e50bb
Related CNNVD
CNNVD-202506-2272 (Published: 2025-06-18)
Share on: