Kernel bug: memory leak in ni_add_subrecord
Subsystem: ntfs3
Status: fixed

Crash report:
BUG: memory leak
unreferenced object 0xffff888110bef280 (size 128):
  comm "syz.0.17", pid 6082, jiffies 4294944677
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 48 37 28 81 88 ff ff  .........H7(....
  backtrace (crc 126a088f):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    __kmalloc_cache_noprof+0x3a6/0x5b0 mm/slub.c:5762
    kmalloc_noprof include/linux/slab.h:957 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    ni_add_subrecord+0x31/0x180 fs/ntfs3/frecord.c:317
    ntfs_look_free_mft+0xf0/0x790 fs/ntfs3/fsntfs.c:715
    ni_ins_attr_ext+0x40c/0x6a0 fs/ntfs3/frecord.c:988
    ni_insert_attr+0x1d1/0x480 fs/ntfs3/frecord.c:1091
    ni_insert_resident+0x85/0x140 fs/ntfs3/frecord.c:1475
    ni_add_name+0x15b/0x2e0 fs/ntfs3/frecord.c:2987
    ni_rename+0x4c/0x100 fs/ntfs3/frecord.c:3026
    ntfs_rename+0x46c/0x5d0 fs/ntfs3/namei.c:332
    vfs_rename+0x94b/0x1340 fs/namei.c:5216
    do_renameat2+0x5f5/0x870 fs/namei.c:5364
    __do_sys_rename fs/namei.c:5411 [inline]
    __se_sys_rename fs/namei.c:5409 [inline]
    __x64_sys_rename+0x42/0x50 fs/namei.c:5409
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff888109093400 (size 1024):
  comm "syz.0.17", pid 6082, jiffies 4294944677
  hex dump (first 32 bytes):
    46 49 4c 45 2a 00 03 00 00 00 00 00 00 00 00 00  FILE*...........
    03 00 00 00 30 00 01 00 88 02 00 00 00 04 00 00  ....0...........
  backtrace (crc 7197c55e):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    __do_kmalloc_node mm/slub.c:5645 [inline]
    __kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5658
    kmalloc_noprof include/linux/slab.h:961 [inline]
    mi_init+0x2b/0x50 fs/ntfs3/record.c:105
    mi_format_new+0x40/0x220 fs/ntfs3/record.c:422
    ni_add_subrecord+0x6b/0x180 fs/ntfs3/frecord.c:321
    ntfs_look_free_mft+0xf0/0x790 fs/ntfs3/fsntfs.c:715
    ni_ins_attr_ext+0x40c/0x6a0 fs/ntfs3/frecord.c:988
    ni_insert_attr+0x1d1/0x480 fs/ntfs3/frecord.c:1091
    ni_insert_resident+0x85/0x140 fs/ntfs3/frecord.c:1475
    ni_add_name+0x15b/0x2e0 fs/ntfs3/frecord.c:2987
    ni_rename+0x4c/0x100 fs/ntfs3/frecord.c:3026
    ntfs_rename+0x46c/0x5d0 fs/ntfs3/namei.c:332
    vfs_rename+0x94b/0x1340 fs/namei.c:5216
    do_renameat2+0x5f5/0x870 fs/namei.c:5364
    __do_sys_rename fs/namei.c:5411 [inline]
    __se_sys_rename fs/namei.c:5409 [inline]
    __x64_sys_rename+0x42/0x50 fs/namei.c:5409
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff888110bef680 (size 128):
  comm "syz.0.18", pid 6093, jiffies 4294944686
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 48 37 28 81 88 ff ff  .........H7(....
  backtrace (crc ada06205):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    __kmalloc_cache_noprof+0x3a6/0x5b0 mm/slub.c:5762
    kmalloc_noprof include/linux/slab.h:957 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    ni_add_subrecord+0x31/0x180 fs/ntfs3/frecord.c:317
    ntfs_look_free_mft+0xf0/0x790 fs/ntfs3/fsntfs.c:715
    ni_ins_attr_ext+0x40c/0x6a0 fs/ntfs3/frecord.c:988
    ni_insert_attr+0x1d1/0x480 fs/ntfs3/frecord.c:1091
    ni_insert_resident+0x85/0x140 fs/ntfs3/frecord.c:1475
    ni_add_name+0x15b/0x2e0 fs/ntfs3/frecord.c:2987
    ni_rename+0x4c/0x100 fs/ntfs3/frecord.c:3026
    ntfs_rename+0x46c/0x5d0 fs/ntfs3/namei.c:332
    vfs_rename+0x94b/0x1340 fs/namei.c:5216
    do_renameat2+0x5f5/0x870 fs/namei.c:5364
    __do_sys_rename fs/namei.c:5411 [inline]
    __se_sys_rename fs/namei.c:5409 [inline]
    __x64_sys_rename+0x42/0x50 fs/namei.c:5409
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff8881135d2000 (size 1024):
  comm "syz.0.18", pid 6093, jiffies 4294944686
  hex dump (first 32 bytes):
    46 49 4c 45 2a 00 03 00 00 00 00 00 00 00 00 00  FILE*...........
    03 00 00 00 30 00 01 00 88 02 00 00 00 04 00 00  ....0...........
  backtrace (crc 7197c55e):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    __do_kmalloc_node mm/slub.c:5645 [inline]
    __kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5658
    kmalloc_noprof include/linux/slab.h:961 [inline]
    mi_init+0x2b/0x50 fs/ntfs3/record.c:105
    mi_format_new+0x40/0x220 fs/ntfs3/record.c:422
    ni_add_subrecord+0x6b/0x180 fs/ntfs3/frecord.c:321
    ntfs_look_free_mft+0xf0/0x790 fs/ntfs3/fsntfs.c:715
    ni_ins_attr_ext+0x40c/0x6a0 fs/ntfs3/frecord.c:988
    ni_insert_attr+0x1d1/0x480 fs/ntfs3/frecord.c:1091
    ni_insert_resident+0x85/0x140 fs/ntfs3/frecord.c:1475
    ni_add_name+0x15b/0x2e0 fs/ntfs3/frecord.c:2987
    ni_rename+0x4c/0x100 fs/ntfs3/frecord.c:3026
    ntfs_rename+0x46c/0x5d0 fs/ntfs3/namei.c:332
    vfs_rename+0x94b/0x1340 fs/namei.c:5216
    do_renameat2+0x5f5/0x870 fs/namei.c:5364
    __do_sys_rename fs/namei.c:5411 [inline]
    __se_sys_rename fs/namei.c:5409 [inline]
    __x64_sys_rename+0x42/0x50 fs/namei.c:5409
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

BUG: memory leak
unreferenced object 0xffff888110bef780 (size 128):
  comm "syz.0.19", pid 6099, jiffies 4294944695
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 30 25 0f 81 88 ff ff  .........0%.....
  backtrace (crc 6428af85):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4979 [inline]
    slab_alloc_node mm/slub.c:5284 [inline]
    __kmalloc_cache_noprof+0x3a6/0x5b0 mm/slub.c:5762
    kmalloc_noprof include/linux/slab.h:957 [inline]
    kzalloc_noprof include/linux/slab.h:1094 [inline]
    ni_add_subrecord+0x31/0x180 fs/ntfs3/frecord.c:317
    ntfs_look_free_mft+0xf0/0x790 fs/ntfs3/fsntfs.c:715
    ni_ins_attr_ext+0x40c/0x6a0 fs/ntfs3/frecord.c:988
    ni_insert_attr+0x1d1/0x480 fs/ntfs3/frecord.c:1091
    ni_insert_resident+0x85/0x140 fs/ntfs3/frecord.c:1475
    ni_add_name+0x15b/0x2e0 fs/ntfs3/frecord.c:2987
    ni_rename+0x4c/0x100 fs/ntfs3/frecord.c:3026
    ntfs_rename+0x46c/0x5d0 fs/ntfs3/namei.c:332
    vfs_rename+0x94b/0x1340 fs/namei.c:5216
    do_renameat2+0x5f5/0x870 fs/namei.c:5364
    __do_sys_rename fs/namei.c:5411 [inline]
    __se_sys_rename fs/namei.c:5409 [inline]
    __x64_sys_rename+0x42/0x50 fs/namei.c:5409
    do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
    do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF