• 公告ID (KylinSec-SA-2024-2962)

摘要:

In the Linux kernel, the following vulnerability has been resolved:

io_uring: fix memleak in io_init_wq_offload()

I got memory leak report when doing fuzz test:

BUG: memory leak
unreferenced object 0xffff888107310a80 (size 96):
comm "syz-executor.6", pid 4610, jiffies 4295140240 (age 20.135s)
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
backtrace:
[<000000001974933b&gt;] kmalloc include/linux/slab.h:591 [inline]
[<000000001974933b&gt;] kzalloc include/linux/slab.h:721 [inline]
[<000000001974933b&gt;] io_init_wq_offload fs/io_uring.c:7920 [inline]
[<000000001974933b&gt;] io_uring_alloc_task_context+0x466/0x640 fs/io_uring.c:7955
[<0000000039d0800d&gt;] __io_uring_add_tctx_node+0x256/0x360 fs/io_uring.c:9016
[<000000008482e78c&gt;] io_uring_add_tctx_node fs/io_uring.c:9052 [inline]
[<000000008482e78c&gt;] __do_sys_io_uring_enter fs/io_uring.c:9354 [inline]
[<000000008482e78c&gt;] __se_sys_io_uring_enter fs/io_uring.c:9301 [inline]
[<000000008482e78c&gt;] __x64_sys_io_uring_enter+0xabc/0xc20 fs/io_uring.c:9301
[<00000000b875f18f&gt;] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<00000000b875f18f&gt;] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80
[<000000006b0a8484&gt;] entry_SYSCALL_64_after_hwframe+0x44/0xae

CPU0 CPU1
io_uring_enter io_uring_enter
io_uring_add_tctx_node io_uring_add_tctx_node
__io_uring_add_tctx_node __io_uring_add_tctx_node
io_uring_alloc_task_context io_uring_alloc_task_context
io_init_wq_offload io_init_wq_offload
hash = kzalloc hash = kzalloc
ctx-&gt;hash_map = hash ctx-&gt;hash_map = hash <- one of the hash is leaked

When calling io_uring_enter() in parallel, the 'hash_map' will be leaked,
add uring_lock to protect 'hash_map'.

安全等级: Low

公告ID: KylinSec-SA-2024-2962

发布日期: 2024年7月3日

关联CVE: CVE-2021-47292  

  • 详细介绍

1. 漏洞描述

   

In the Linux kernel, the following vulnerability has been resolved:

io_uring: fix memleak in io_init_wq_offload()

I got memory leak report when doing fuzz test:

BUG: memory leak
unreferenced object 0xffff888107310a80 (size 96):
comm "syz-executor.6", pid 4610, jiffies 4295140240 (age 20.135s)
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
backtrace:
[<000000001974933b&gt;] kmalloc include/linux/slab.h:591 [inline]
[<000000001974933b&gt;] kzalloc include/linux/slab.h:721 [inline]
[<000000001974933b&gt;] io_init_wq_offload fs/io_uring.c:7920 [inline]
[<000000001974933b&gt;] io_uring_alloc_task_context+0x466/0x640 fs/io_uring.c:7955
[<0000000039d0800d&gt;] __io_uring_add_tctx_node+0x256/0x360 fs/io_uring.c:9016
[<000000008482e78c&gt;] io_uring_add_tctx_node fs/io_uring.c:9052 [inline]
[<000000008482e78c&gt;] __do_sys_io_uring_enter fs/io_uring.c:9354 [inline]
[<000000008482e78c&gt;] __se_sys_io_uring_enter fs/io_uring.c:9301 [inline]
[<000000008482e78c&gt;] __x64_sys_io_uring_enter+0xabc/0xc20 fs/io_uring.c:9301
[<00000000b875f18f&gt;] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<00000000b875f18f&gt;] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80
[<000000006b0a8484&gt;] entry_SYSCALL_64_after_hwframe+0x44/0xae

CPU0 CPU1
io_uring_enter io_uring_enter
io_uring_add_tctx_node io_uring_add_tctx_node
__io_uring_add_tctx_node __io_uring_add_tctx_node
io_uring_alloc_task_context io_uring_alloc_task_context
io_init_wq_offload io_init_wq_offload
hash = kzalloc hash = kzalloc
ctx-&gt;hash_map = hash ctx-&gt;hash_map = hash <- one of the hash is leaked

When calling io_uring_enter() in parallel, the 'hash_map' will be leaked,
add uring_lock to protect 'hash_map'.

2. 影响范围

cve名称 产品 组件 是否受影响
CVE-2021-47292 KY3.4-5A kernel Unaffected
CVE-2021-47292 V6 kernel Unaffected

3. 影响组件

    无

4. 修复版本

    无

5. 修复方法

   无

6. 下载链接

    无
上一篇:KylinSec-SA-2024-2961 下一篇:KylinSec-SA-2024-2963