syzbot


memory leak in get_sg_table

Status: upstream: reported C repro on 2023/12/31 23:38
Subsystems: dri media
[Documentation on labels]
Reported-by: syzbot+9b4adfed366b14496e7e@syzkaller.appspotmail.com
First crash: 121d, last: 121d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [dri?] [media?] memory leak in get_sg_table 3 (7) 2024/01/01 04:27
Last patch testing requests (5)
Created Duration User Patch Repo Result
2024/03/23 15:31 15m retest repro upstream report log
2024/01/11 01:05 10m retest repro upstream report log
2024/01/01 04:01 24m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fbafc3e621c3 OK log
2024/01/01 02:43 22m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fbafc3e621c3 report log
2024/01/01 02:25 18m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log

Sample crash report:
Warning: Permanently added '10.128.0.162' (ED25519) to the list of known hosts.
executing program
executing program
BUG: memory leak
unreferenced object 0xffff88810af03840 (size 16):
  comm "syz-executor111", pid 5038, jiffies 4294942820 (age 13.250s)
  hex dump (first 16 bytes):
    80 8b 89 0b 81 88 ff ff 04 00 00 00 04 00 00 00  ................
  backtrace:
    [<ffffffff816346ed>] kmemleak_alloc_recursive include/linux/kmemleak.h:42 [inline]
    [<ffffffff816346ed>] slab_post_alloc_hook mm/slab.h:766 [inline]
    [<ffffffff816346ed>] slab_alloc_node mm/slub.c:3478 [inline]
    [<ffffffff816346ed>] __kmem_cache_alloc_node+0x2dd/0x3f0 mm/slub.c:3517
    [<ffffffff8157f315>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1098
    [<ffffffff82cfd7fa>] kmalloc include/linux/slab.h:600 [inline]
    [<ffffffff82cfd7fa>] kzalloc include/linux/slab.h:721 [inline]
    [<ffffffff82cfd7fa>] get_sg_table.isra.0+0x2a/0xe0 drivers/dma-buf/udmabuf.c:93
    [<ffffffff82cfd943>] begin_cpu_udmabuf+0x63/0xa0 drivers/dma-buf/udmabuf.c:156
    [<ffffffff82cf114b>] dma_buf_begin_cpu_access+0x3b/0xc0 drivers/dma-buf/dma-buf.c:1402
    [<ffffffff82cf1d90>] dma_buf_ioctl+0x550/0x660 drivers/dma-buf/dma-buf.c:475
    [<ffffffff816bf4a2>] vfs_ioctl fs/ioctl.c:51 [inline]
    [<ffffffff816bf4a2>] __do_sys_ioctl fs/ioctl.c:871 [inline]
    [<ffffffff816bf4a2>] __se_sys_ioctl fs/ioctl.c:857 [inline]
    [<ffffffff816bf4a2>] __x64_sys_ioctl+0xf2/0x140 fs/ioctl.c:857
    [<ffffffff84b71e2f>] do_syscall_x64 arch/x86/entry/common.c:52 [inline]
    [<ffffffff84b71e2f>] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:83
    [<ffffffff84c0008b>] entry_SYSCALL_64_after_hwframe+0x63/0x6b

BUG: memory leak
unreferenced object 0xffff88810b898b80 (size 128):
  comm "syz-executor111", pid 5038, jiffies 4294942820 (age 13.250s)
  hex dump (first 32 bytes):
    c0 09 2a 04 00 ea ff ff 00 00 00 00 00 10 00 00  ..*.............
    00 70 82 0a 01 00 00 00 00 10 00 00 00 00 00 00  .p..............
  backtrace:
    [<ffffffff816346ed>] kmemleak_alloc_recursive include/linux/kmemleak.h:42 [inline]
    [<ffffffff816346ed>] slab_post_alloc_hook mm/slab.h:766 [inline]
    [<ffffffff816346ed>] slab_alloc_node mm/slub.c:3478 [inline]
    [<ffffffff816346ed>] __kmem_cache_alloc_node+0x2dd/0x3f0 mm/slub.c:3517
    [<ffffffff8157f9bb>] __do_kmalloc_node mm/slab_common.c:1006 [inline]
    [<ffffffff8157f9bb>] __kmalloc+0x4b/0x150 mm/slab_common.c:1020
    [<ffffffff8251661f>] kmalloc_array include/linux/slab.h:637 [inline]
    [<ffffffff8251661f>] sg_kmalloc lib/scatterlist.c:167 [inline]
    [<ffffffff8251661f>] get_next_sg lib/scatterlist.c:402 [inline]
    [<ffffffff8251661f>] sg_alloc_append_table_from_pages+0x35f/0x770 lib/scatterlist.c:526
    [<ffffffff82516abc>] sg_alloc_table_from_pages_segment+0x8c/0x120 lib/scatterlist.c:586
    [<ffffffff82cfd82e>] sg_alloc_table_from_pages include/linux/scatterlist.h:477 [inline]
    [<ffffffff82cfd82e>] get_sg_table.isra.0+0x5e/0xe0 drivers/dma-buf/udmabuf.c:96
    [<ffffffff82cfd943>] begin_cpu_udmabuf+0x63/0xa0 drivers/dma-buf/udmabuf.c:156
    [<ffffffff82cf114b>] dma_buf_begin_cpu_access+0x3b/0xc0 drivers/dma-buf/dma-buf.c:1402
    [<ffffffff82cf1d90>] dma_buf_ioctl+0x550/0x660 drivers/dma-buf/dma-buf.c:475
    [<ffffffff816bf4a2>] vfs_ioctl fs/ioctl.c:51 [inline]
    [<ffffffff816bf4a2>] __do_sys_ioctl fs/ioctl.c:871 [inline]
    [<ffffffff816bf4a2>] __se_sys_ioctl fs/ioctl.c:857 [inline]
    [<ffffffff816bf4a2>] __x64_sys_ioctl+0xf2/0x140 fs/ioctl.c:857
    [<ffffffff84b71e2f>] do_syscall_x64 arch/x86/entry/common.c:52 [inline]
    [<ffffffff84b71e2f>] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:83
    [<ffffffff84c0008b>] entry_SYSCALL_64_after_hwframe+0x63/0x6b


Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/27 23:34 upstream fbafc3e621c3 fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-gce-leak memory leak in get_sg_table
* Struck through repros no longer work on HEAD.