Julian Anastasov
56e4ee82e8
ipvs: ignore IP_VS_SVC_F_HASHED flag when adding service
...
syzbot reported memory leak [1] when adding service with
HASHED flag. We should ignore this flag both from sockopt
and netlink provided data, otherwise the service is not
hashed and not visible while releasing resources.
[1]
BUG: memory leak
unreferenced object 0xffff888115227800 (size 512):
comm "syz-executor263", pid 8658, jiffies 4294951882 (age 12.560s)
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 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff83977188>] kmalloc include/linux/slab.h:556 [inline]
[<ffffffff83977188>] kzalloc include/linux/slab.h:686 [inline]
[<ffffffff83977188>] ip_vs_add_service+0x598/0x7c0 net/netfilter/ipvs/ip_vs_ctl.c:1343
[<ffffffff8397d770>] do_ip_vs_set_ctl+0x810/0xa40 net/netfilter/ipvs/ip_vs_ctl.c:2570
[<ffffffff838449a8>] nf_setsockopt+0x68/0xa0 net/netfilter/nf_sockopt.c:101
[<ffffffff839ae4e9>] ip_setsockopt+0x259/0x1ff0 net/ipv4/ip_sockglue.c:1435
[<ffffffff839fa03c>] raw_setsockopt+0x18c/0x1b0 net/ipv4/raw.c:857
[<ffffffff83691f20>] __sys_setsockopt+0x1b0/0x360 net/socket.c:2117
[<ffffffff836920f2>] __do_sys_setsockopt net/socket.c:2128 [inline]
[<ffffffff836920f2>] __se_sys_setsockopt net/socket.c:2125 [inline]
[<ffffffff836920f2>] __x64_sys_setsockopt+0x22/0x30 net/socket.c:2125
[<ffffffff84350efa>] do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
[<ffffffff84400068>] entry_SYSCALL_64_after_hwframe+0x44/0xae
Reported-and-tested-by: syzbot+e562383183e4b1766930@syzkaller.appspotmail.com
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2021-05-27 13:06:48 +02:00
..
2021-03-24 17:52:11 -07:00
2021-03-28 17:56:56 -07:00
2021-04-26 12:00:00 -07:00
2021-02-12 16:40:28 -08:00
2021-01-29 18:24:05 -08:00
2021-03-30 16:54:50 -07:00
2021-04-09 20:48:35 -07:00
2021-04-29 11:57:23 -07:00
2021-03-26 20:41:52 -07:00
2021-01-27 17:04:12 -08:00
2021-04-29 15:33:17 -07:00
2021-02-15 13:21:48 -08:00
2021-05-12 08:52:47 +02:00
2021-05-06 10:27:02 -07:00
2021-05-14 15:05:46 -07:00
2021-01-27 17:03:52 -08:00
2021-04-09 16:34:56 -07:00
2021-03-30 16:54:50 -07:00
2021-01-27 17:04:12 -08:00
2021-05-10 14:36:59 -07:00
2021-04-13 14:35:02 -07:00
2021-05-05 12:41:10 -07:00
2021-05-03 13:33:54 -07:00
2021-04-07 14:43:28 -07:00
2021-01-27 17:04:12 -08:00
2021-05-11 16:05:56 -07:00
2021-05-17 14:05:50 -07:00
2021-03-28 17:31:13 -07:00
2021-03-28 17:31:13 -07:00
2021-01-04 10:05:50 +01:00
2021-04-27 14:23:13 -07:00
2021-03-28 17:56:55 -07:00
2021-03-23 14:14:50 -07:00
2021-04-27 14:16:14 -07:00
2021-05-11 20:14:50 +02:00
2021-04-06 22:42:16 +02:00
2021-04-27 14:17:00 -07:00
2021-05-11 16:19:17 -07:00
2021-04-09 20:48:35 -07:00
2021-05-27 13:06:48 +02:00
2021-04-29 11:57:23 -07:00
2021-04-16 17:01:04 -07:00
2021-04-28 13:59:08 -07:00
2021-05-17 13:56:29 -07:00
2021-05-13 15:54:59 -07:00
2021-05-12 14:00:04 -07:00
2021-03-14 15:00:43 -07:00
2021-04-26 12:00:00 -07:00
2021-05-01 09:15:05 -07:00
2021-04-20 16:44:04 -07:00
2021-03-10 12:45:15 -08:00
2021-04-29 11:57:23 -07:00
2021-05-14 15:05:46 -07:00
2021-05-03 13:36:21 -07:00
2021-05-05 12:52:45 -07:00
2021-05-07 11:23:41 -07:00
2021-02-14 17:38:11 -08:00
2021-05-17 14:07:48 -07:00
2021-05-14 15:03:25 -07:00
2021-01-24 14:27:18 +01:00
2021-04-30 15:00:59 -07:00
2021-05-11 20:13:13 +02:00
2021-03-28 17:31:13 -07:00
2021-05-04 00:28:06 +02:00
2021-04-19 12:49:29 +02:00
2021-05-11 13:56:16 -07:00
2021-01-27 17:03:52 -08:00
2021-03-25 16:56:27 -07:00
2021-04-12 13:27:11 -07:00