[syzbot] memory leak in dev_exception_add
From: syzbot
Date: Tue Jul 13 2021 - 14:07:27 EST
Hello,
syzbot found the following issue on:
HEAD commit: 3dbdb38e Merge branch 'for-5.14' of git://git.kernel.org/p..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1518cffc300000
kernel config: https://syzkaller.appspot.com/x/.config?x=55ac6a927d7e3fe9
dashboard link: https://syzkaller.appspot.com/bug?extid=988c8a25ad1677559236
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1500e772300000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+988c8a25ad1677559236@xxxxxxxxxxxxxxxxxxxxxxxxx
BUG: memory leak
unreferenced object 0xffff88810d3a4300 (size 64):
comm "systemd", pid 1, jiffies 4294938536 (age 1351.150s)
hex dump (first 32 bytes):
01 00 00 00 03 00 00 00 02 00 07 00 00 00 00 00 ................
10 04 2b 0d 81 88 ff ff 22 01 00 00 00 00 ad de ..+.....".......
backtrace:
[<ffffffff81479633>] kmemdup+0x23/0x50 mm/util.c:128
[<ffffffff8217485f>] kmemdup include/linux/fortify-string.h:270 [inline]
[<ffffffff8217485f>] dev_exception_add+0x2f/0x160 security/device_cgroup.c:94
[<ffffffff82175812>] devcgroup_update_access security/device_cgroup.c:734 [inline]
[<ffffffff82175812>] devcgroup_access_write+0x8c2/0x9e0 security/device_cgroup.c:764
[<ffffffff813198bd>] cgroup_file_write+0x10d/0x260 kernel/cgroup/cgroup.c:3814
[<ffffffff81690535>] kernfs_fop_write_iter+0x1b5/0x270 fs/kernfs/file.c:296
[<ffffffff81560eb7>] call_write_iter include/linux/fs.h:2114 [inline]
[<ffffffff81560eb7>] new_sync_write+0x1d7/0x2b0 fs/read_write.c:518
[<ffffffff81564531>] vfs_write+0x351/0x400 fs/read_write.c:605
[<ffffffff8156481d>] ksys_write+0x9d/0x160 fs/read_write.c:658
[<ffffffff8439b235>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff8439b235>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84400068>] entry_SYSCALL_64_after_hwframe+0x44/0xae
BUG: memory leak
unreferenced object 0xffff88810d2b0400 (size 64):
comm "systemd", pid 1, jiffies 4294938537 (age 1351.140s)
hex dump (first 32 bytes):
01 00 00 00 05 00 00 00 02 00 07 00 00 00 00 00 ................
90 ac 3b 0d 81 88 ff ff 22 01 00 00 00 00 ad de ..;.....".......
backtrace:
[<ffffffff81479633>] kmemdup+0x23/0x50 mm/util.c:128
[<ffffffff8217485f>] kmemdup include/linux/fortify-string.h:270 [inline]
[<ffffffff8217485f>] dev_exception_add+0x2f/0x160 security/device_cgroup.c:94
[<ffffffff82175812>] devcgroup_update_access security/device_cgroup.c:734 [inline]
[<ffffffff82175812>] devcgroup_access_write+0x8c2/0x9e0 security/device_cgroup.c:764
[<ffffffff813198bd>] cgroup_file_write+0x10d/0x260 kernel/cgroup/cgroup.c:3814
[<ffffffff81690535>] kernfs_fop_write_iter+0x1b5/0x270 fs/kernfs/file.c:296
[<ffffffff81560eb7>] call_write_iter include/linux/fs.h:2114 [inline]
[<ffffffff81560eb7>] new_sync_write+0x1d7/0x2b0 fs/read_write.c:518
[<ffffffff81564531>] vfs_write+0x351/0x400 fs/read_write.c:605
[<ffffffff8156481d>] ksys_write+0x9d/0x160 fs/read_write.c:658
[<ffffffff8439b235>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff8439b235>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84400068>] entry_SYSCALL_64_after_hwframe+0x44/0xae
BUG: memory leak
unreferenced object 0xffff88810d3bac80 (size 64):
comm "systemd", pid 1, jiffies 4294938537 (age 1351.140s)
hex dump (first 32 bytes):
01 00 00 00 07 00 00 00 02 00 07 00 00 00 00 00 ................
50 84 31 0d 81 88 ff ff 22 01 00 00 00 00 ad de P.1.....".......
backtrace:
[<ffffffff81479633>] kmemdup+0x23/0x50 mm/util.c:128
[<ffffffff8217485f>] kmemdup include/linux/fortify-string.h:270 [inline]
[<ffffffff8217485f>] dev_exception_add+0x2f/0x160 security/device_cgroup.c:94
[<ffffffff82175812>] devcgroup_update_access security/device_cgroup.c:734 [inline]
[<ffffffff82175812>] devcgroup_access_write+0x8c2/0x9e0 security/device_cgroup.c:764
[<ffffffff813198bd>] cgroup_file_write+0x10d/0x260 kernel/cgroup/cgroup.c:3814
[<ffffffff81690535>] kernfs_fop_write_iter+0x1b5/0x270 fs/kernfs/file.c:296
[<ffffffff81560eb7>] call_write_iter include/linux/fs.h:2114 [inline]
[<ffffffff81560eb7>] new_sync_write+0x1d7/0x2b0 fs/read_write.c:518
[<ffffffff81564531>] vfs_write+0x351/0x400 fs/read_write.c:605
[<ffffffff8156481d>] ksys_write+0x9d/0x160 fs/read_write.c:658
[<ffffffff8439b235>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff8439b235>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84400068>] entry_SYSCALL_64_after_hwframe+0x44/0xae
BUG: memory leak
unreferenced object 0xffff88810d318440 (size 64):
comm "systemd", pid 1, jiffies 4294938537 (age 1351.140s)
hex dump (first 32 bytes):
01 00 00 00 08 00 00 00 02 00 07 00 00 00 00 00 ................
d0 aa 3b 0d 81 88 ff ff 22 01 00 00 00 00 ad de ..;.....".......
backtrace:
[<ffffffff81479633>] kmemdup+0x23/0x50 mm/util.c:128
[<ffffffff8217485f>] kmemdup include/linux/fortify-string.h:270 [inline]
[<ffffffff8217485f>] dev_exception_add+0x2f/0x160 security/device_cgroup.c:94
[<ffffffff82175812>] devcgroup_update_access security/device_cgroup.c:734 [inline]
[<ffffffff82175812>] devcgroup_access_write+0x8c2/0x9e0 security/device_cgroup.c:764
[<ffffffff813198bd>] cgroup_file_write+0x10d/0x260 kernel/cgroup/cgroup.c:3814
[<ffffffff81690535>] kernfs_fop_write_iter+0x1b5/0x270 fs/kernfs/file.c:296
[<ffffffff81560eb7>] call_write_iter include/linux/fs.h:2114 [inline]
[<ffffffff81560eb7>] new_sync_write+0x1d7/0x2b0 fs/read_write.c:518
[<ffffffff81564531>] vfs_write+0x351/0x400 fs/read_write.c:605
[<ffffffff8156481d>] ksys_write+0x9d/0x160 fs/read_write.c:658
[<ffffffff8439b235>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff8439b235>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84400068>] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1363.912106][ C1]
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxx.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches