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: d71fa5c976
("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
2021-02-17 11:02:25 +01:00
2020-04-07 10:43:42 -07:00
2021-03-04 11:38:46 +01:00
2020-11-02 10:10:39 -05:00
2021-03-17 17:06:36 +01:00
2021-03-17 17:06:34 +01:00
2021-03-30 14:31:54 +02:00
2021-03-25 09:04:18 +01:00
2021-03-04 11:37:37 +01:00
2020-10-16 11:11:19 -07:00
2021-03-04 11:37:47 +01:00
2021-02-03 23:28:40 +01:00
2021-03-04 11:38:41 +01:00
2021-03-04 11:38:35 +01:00
2021-03-17 17:06:35 +01:00
2021-03-25 09:04:16 +01:00
2021-03-30 14:32:00 +02:00
2020-03-25 11:50:48 +01:00
2020-10-16 11:11:19 -07:00
2020-07-16 12:35:15 -07:00
2020-12-30 11:54:18 +01:00
2020-12-30 11:54:18 +01:00
2020-12-30 11:54:18 +01:00
2020-08-26 09:10:39 -04:00
2020-08-17 20:26:58 -04:00
2020-08-23 17:36:59 -05:00
2020-08-04 14:20:26 -07:00
2020-07-30 11:15:58 -07:00
2020-10-13 09:17:34 -07:00
2020-08-23 17:36:59 -05:00
2020-06-11 15:14:36 +02:00
2020-09-01 09:58:03 +02:00
2020-11-27 00:10:39 +11:00
2020-08-12 10:58:01 -07:00
2020-04-15 11:21:54 +02:00
2020-05-20 14:44:21 -05:00
2021-01-30 13:55:18 +01:00
2020-04-07 10:43:42 -07:00
2020-11-19 11:58:16 -08:00
2021-03-30 14:31:52 +02:00
2021-03-25 09:04:16 +01:00
2020-06-06 23:42:01 +09:00
2020-10-13 09:17:34 -07:00
2020-11-02 12:14:19 -08:00
2020-05-28 10:54:15 +02:00
2021-03-25 09:04:18 +01:00
2020-10-25 14:51:49 -07:00
2021-01-09 13:46:24 +01:00
2020-08-12 10:58:02 -07:00
2021-02-03 23:28:37 +01:00
2021-03-04 11:37:50 +01:00
2020-10-05 13:37:03 +02:00
2020-08-12 10:58:01 -07:00
2021-03-04 11:38:35 +01:00
2021-02-07 15:37:17 +01:00
2020-04-27 02:07:40 -04:00
2021-03-04 11:38:41 +01:00
2021-03-25 09:04:11 +01:00
2021-03-25 09:04:11 +01:00
2021-03-25 09:04:11 +01:00
2020-09-01 09:58:03 +02:00
2020-07-08 11:14:22 +02:00
2020-09-04 17:51:55 +10:00
2020-11-14 11:26:04 -08:00
2020-10-29 17:22:59 -05:00
2020-10-16 11:11:19 -07:00
2021-01-09 13:46:24 +01:00
2020-11-17 12:53:22 -08:00
2020-10-16 11:11:19 -07:00
2020-11-14 11:26:03 -08:00
2020-07-27 14:31:12 -04:00
2020-10-16 11:11:22 -07:00
2020-10-16 11:11:18 -07:00
2020-08-24 18:38:38 -07:00
2020-08-07 11:33:25 -07:00
2021-03-04 11:38:32 +01:00
2020-11-02 12:14:19 -08:00
2021-03-04 11:37:51 +01:00
2021-02-07 15:37:17 +01:00
2020-09-16 15:18:56 +02:00
2020-09-19 13:13:39 -07:00
2020-09-18 14:24:16 +01:00
2021-03-30 14:31:53 +02:00
2020-10-26 12:12:27 +01:00
2020-10-18 09:27:10 -07:00
2020-10-25 11:44:16 -07:00
2021-03-17 17:06:25 +01:00
2020-10-17 15:05:30 -06:00
2020-10-02 19:11:12 -07:00
2020-06-29 12:01:45 -07:00
2021-03-04 11:38:03 +01:00
2020-04-07 21:51:27 +02:00
2020-10-06 10:31:52 -07:00
2020-10-16 11:11:19 -07:00
2020-06-04 19:06:24 -07:00
2021-03-30 14:32:03 +02:00
2020-04-27 02:07:40 -04:00
2020-05-09 13:57:12 +02:00
2020-08-17 09:39:18 -07:00
2020-11-14 11:26:03 -08:00
2021-02-07 15:37:17 +01:00