In the Linux kernel, the following vulnerability has been resolved:
bpf: Use VMMAP instead of VMALLOC for ringbuf
After commit 2fd3fb0be1d1 ("kasan, vmalloc: unpoison VMALLOC pages after mapping"), non-VMALLOC mappings will be marked as accessible in _getvmareanode() when KASAN is enabled. But now the flag for ringbuf area is VMALLOC, so KASAN will complain out-of-bound access after vmap() returns. Because the ringbuf area is created by mapping allocated pages, so use VMMAP instead.
After the change, info in /proc/vmallocinfo also changes from [start]-[end] 24576 ringbufmapalloc+0x171/0x290 vmalloc user to [start]-[end] 24576 ringbufmapalloc+0x171/0x290 vmap user
[
{
"signature_version": "v1",
"signature_type": "Line",
"id": "CVE-2022-48714-b0558076",
"target": {
"file": "kernel/bpf/ringbuf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b293dcc473d22a62dc6d78de2b15e4f49515db56",
"digest": {
"threshold": 0.9,
"line_hashes": [
"1331549256368949368334005534948221492",
"103271353061302797017848937926442551313",
"317343065441120226642425552145358923114",
"208471469823214520633072830467538548383"
]
},
"deprecated": false
},
{
"signature_version": "v1",
"signature_type": "Function",
"id": "CVE-2022-48714-cc224c58",
"target": {
"function": "bpf_ringbuf_area_alloc",
"file": "kernel/bpf/ringbuf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6304a613a97d6dcd49b93fbad31e9f39d1e138d6",
"digest": {
"length": 949.0,
"function_hash": "44345574485246003168035363489503716610"
},
"deprecated": false
},
{
"signature_version": "v1",
"signature_type": "Line",
"id": "CVE-2022-48714-d4f40fb1",
"target": {
"file": "kernel/bpf/ringbuf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6304a613a97d6dcd49b93fbad31e9f39d1e138d6",
"digest": {
"threshold": 0.9,
"line_hashes": [
"1331549256368949368334005534948221492",
"103271353061302797017848937926442551313",
"317343065441120226642425552145358923114",
"208471469823214520633072830467538548383"
]
},
"deprecated": false
},
{
"signature_version": "v1",
"signature_type": "Function",
"id": "CVE-2022-48714-f9402af1",
"target": {
"function": "bpf_ringbuf_area_alloc",
"file": "kernel/bpf/ringbuf.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b293dcc473d22a62dc6d78de2b15e4f49515db56",
"digest": {
"length": 890.0,
"function_hash": "103143424286519794538887788977220674000"
},
"deprecated": false
}
]