Eric Dumazet
362da40c50
mld: fix memory leak in mld_del_delrec()
...
[ Upstream commit a84d016479896b5526a2cc54784e6ffc41c9d6f6 ]
Similar to the fix done for IPv4 in commit e5b1c6c6277d
("igmp: fix memory leak in igmpv3_del_delrec()"), we need to
make sure mca_tomb and mca_sources are not blindly overwritten.
Using swap() then a call to ip6_mc_clear_src() will take care
of the missing free.
BUG: memory leak
unreferenced object 0xffff888117d9db00 (size 64):
comm "syz-executor247", pid 6918, jiffies 4294943989 (age 25.350s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 fe 88 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<000000005b463030>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
[<000000005b463030>] slab_post_alloc_hook mm/slab.h:522 [inline]
[<000000005b463030>] slab_alloc mm/slab.c:3319 [inline]
[<000000005b463030>] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3548
[<00000000939cbf94>] kmalloc include/linux/slab.h:552 [inline]
[<00000000939cbf94>] kzalloc include/linux/slab.h:748 [inline]
[<00000000939cbf94>] ip6_mc_add1_src net/ipv6/mcast.c:2236 [inline]
[<00000000939cbf94>] ip6_mc_add_src+0x31f/0x420 net/ipv6/mcast.c:2356
[<00000000d8972221>] ip6_mc_source+0x4a8/0x600 net/ipv6/mcast.c:449
[<000000002b203d0d>] do_ipv6_setsockopt.isra.0+0x1b92/0x1dd0 net/ipv6/ipv6_sockglue.c:748
[<000000001f1e2d54>] ipv6_setsockopt+0x89/0xd0 net/ipv6/ipv6_sockglue.c:944
[<00000000c8f7bdf9>] udpv6_setsockopt+0x4e/0x90 net/ipv6/udp.c:1558
[<000000005a9a0c5e>] sock_common_setsockopt+0x38/0x50 net/core/sock.c:3139
[<00000000910b37b2>] __sys_setsockopt+0x10f/0x220 net/socket.c:2084
[<00000000e9108023>] __do_sys_setsockopt net/socket.c:2100 [inline]
[<00000000e9108023>] __se_sys_setsockopt net/socket.c:2097 [inline]
[<00000000e9108023>] __x64_sys_setsockopt+0x26/0x30 net/socket.c:2097
[<00000000f4818160>] do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:296
[<000000008d367e8f>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: 1666d49e1d41 ("mld: do not remove mld souce list info when set link down")
Fixes: 9c8bb163ae78 ("igmp, mld: Fix memory leak in igmpv3/mld_del_delrec()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-10 10:31:04 +01:00
..
2018-10-03 17:01:42 -07:00
2019-08-04 09:33:28 +02:00
2019-05-16 19:43:46 +02:00
2019-04-20 09:07:53 +02:00
2019-04-27 09:34:40 +02:00
2019-06-22 08:17:21 +02:00
2019-08-04 09:33:15 +02:00
2019-08-04 09:33:32 +02:00
2019-09-06 10:19:31 +02:00
2019-05-08 07:19:07 +02:00
2019-07-10 09:55:33 +02:00
2019-08-11 12:22:15 +02:00
2019-09-10 10:31:04 +01:00
2018-09-19 22:47:15 +02:00
2019-04-03 06:24:14 +02:00
2018-02-25 11:05:44 +01:00
2018-07-22 14:27:39 +02:00
2019-02-12 19:45:00 +01:00
2017-02-18 15:11:43 +01:00
2019-03-19 13:14:08 +01:00
2019-05-02 09:32:06 +02:00
2019-09-10 10:31:04 +01:00
2019-09-10 10:31:04 +01:00
2017-05-25 15:44:41 +02:00
2018-09-15 09:43:01 +02:00
2018-03-31 18:11:34 +02:00
2019-04-17 08:36:44 +02:00
2019-08-04 09:33:16 +02:00
2019-08-11 12:22:17 +02:00
2016-09-10 23:12:53 -07:00
2019-06-22 08:17:22 +02:00
2019-06-11 12:22:33 +02:00
2019-09-06 10:19:52 +02:00
2018-09-09 20:01:19 +02:00
2018-03-11 16:21:34 +01:00
2016-10-20 11:23:08 -04:00
2019-08-25 10:51:51 +02:00
2019-03-13 14:04:53 -07:00
2018-08-09 12:17:59 +02:00
2019-08-04 09:33:35 +02:00
2019-08-04 09:33:34 +02:00
2019-08-04 09:33:33 +02:00
2019-08-25 10:51:51 +02:00
2019-03-23 13:19:44 +01:00
2018-08-24 13:12:36 +02:00
2019-06-11 12:22:46 +02:00
2018-05-16 10:08:43 +02:00
2019-04-03 06:24:14 +02:00
2019-08-04 09:33:34 +02:00
2019-08-11 12:22:18 +02:00
2019-08-25 10:51:52 +02:00
2018-04-29 11:32:02 +02:00
2019-07-21 09:05:57 +02:00
2016-10-19 10:58:04 -04:00
2019-08-11 12:22:17 +02:00
2019-03-19 13:14:10 +01:00
2019-05-25 18:26:44 +02:00
2019-09-06 10:19:52 +02:00
2019-03-19 13:14:09 +01:00
2019-08-04 09:33:20 +02:00
2019-01-09 16:16:41 +01:00
2019-08-25 10:51:40 +02:00
2016-10-06 09:52:23 -07:00