Zqiang
ccd5565fee
bpf: Fix umd memory leak in copy_process()
...
[ Upstream commit f60a85cad677c4f9bb4cadd764f1d106c38c7cf8 ]
The syzbot reported a memleak as follows:
BUG: memory leak
unreferenced object 0xffff888101b41d00 (size 120):
comm "kworker/u4:0", pid 8, jiffies 4294944270 (age 12.780s)
backtrace:
[<ffffffff8125dc56>] alloc_pid+0x66/0x560
[<ffffffff81226405>] copy_process+0x1465/0x25e0
[<ffffffff81227943>] kernel_clone+0xf3/0x670
[<ffffffff812281a1>] kernel_thread+0x61/0x80
[<ffffffff81253464>] call_usermodehelper_exec_work
[<ffffffff81253464>] call_usermodehelper_exec_work+0xc4/0x120
[<ffffffff812591c9>] process_one_work+0x2c9/0x600
[<ffffffff81259ab9>] worker_thread+0x59/0x5d0
[<ffffffff812611c8>] kthread+0x178/0x1b0
[<ffffffff8100227f>] ret_from_fork+0x1f/0x30
unreferenced object 0xffff888110ef5c00 (size 232):
comm "kworker/u4:0", pid 8414, jiffies 4294944270 (age 12.780s)
backtrace:
[<ffffffff8154a0cf>] kmem_cache_zalloc
[<ffffffff8154a0cf>] __alloc_file+0x1f/0xf0
[<ffffffff8154a809>] alloc_empty_file+0x69/0x120
[<ffffffff8154a8f3>] alloc_file+0x33/0x1b0
[<ffffffff8154ab22>] alloc_file_pseudo+0xb2/0x140
[<ffffffff81559218>] create_pipe_files+0x138/0x2e0
[<ffffffff8126c793>] umd_setup+0x33/0x220
[<ffffffff81253574>] call_usermodehelper_exec_async+0xb4/0x1b0
[<ffffffff8100227f>] ret_from_fork+0x1f/0x30
After the UMD process exits, the pipe_to_umh/pipe_from_umh and
tgid need to be released.
Fixes: d71fa5c9763c ("bpf: Add kernel module with user mode driver that populates bpffs.")
Reported-by: syzbot+44908bb56d2bfe56b28e@syzkaller.appspotmail.com
Signed-off-by: Zqiang <qiang.zhang@windriver.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210317030915.2865-1-qiang.zhang@windriver.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-30 14:32:03 +02:00
..
2021-03-30 14:32:03 +02:00
2020-10-11 10:21:04 -07:00
2021-03-30 14:31:56 +02:00
2021-03-04 11:37:33 +01:00
2020-09-19 01:12:35 +02:00
2021-03-04 11:37:29 +01:00
2020-04-06 21:54:10 +02:00
2020-11-06 13:15:21 -08:00
2020-01-09 08:46:18 -08:00
2020-08-25 15:37:41 -07:00
2020-10-02 15:00:49 -07:00
2021-02-10 09:29:12 +01:00
2020-10-29 20:01:46 -07:00
2020-09-28 23:30:42 +02:00
2021-03-04 11:37:33 +01:00
2019-06-05 17:36:38 +02:00
2019-06-05 17:36:38 +02:00
2020-03-13 12:49:52 -07:00
2020-11-05 19:55:57 -08:00
2021-01-23 16:03:59 +01:00
2020-09-22 16:45:34 -07:00
2020-07-25 20:16:36 -07:00
2020-08-28 15:41:30 +02:00
2020-10-29 20:01:46 -07:00
2020-08-28 15:41:30 +02:00
2020-08-28 15:41:30 +02:00
2020-08-21 14:01:39 -07:00
2020-08-01 20:38:28 -07:00
2020-02-17 16:53:49 +01:00
2020-10-06 00:04:11 +02:00
2020-10-06 00:04:11 +02:00
2020-07-25 20:16:32 -07:00
2020-08-28 15:41:30 +02:00
2020-09-30 11:50:35 -07:00
2020-08-28 15:41:30 +02:00
2021-02-17 11:02:25 +01:00
2021-01-27 11:55:07 +01:00
2020-09-21 21:50:24 +02:00
2021-01-19 18:27:28 +01:00
2020-03-30 14:59:53 -07:00
2020-09-29 13:09:23 -07:00
2021-03-20 10:43:43 +01:00