Eric Dumazet
a84d016479
mld: fix memory leak in mld_del_delrec()
...
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>
2019-08-28 14:47:35 -07:00
..
2019-07-06 12:50:01 +02:00
2019-07-12 17:31:19 -07:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-05 17:37:10 +02:00
2019-05-30 11:26:32 -07:00
2019-06-16 14:22:37 -07:00
2019-08-14 19:27:07 +02:00
2019-08-17 13:54:40 +03:00
2019-05-30 11:29:53 -07:00
2019-07-12 16:03:16 -07:00
2019-08-19 09:34:20 +02:00
2019-05-30 11:29:22 -07:00
2019-07-24 11:19:03 +02:00
2019-08-22 10:47:41 +02:00
2019-08-27 20:52:02 -07:00
2019-05-30 11:29:52 -07:00
2019-07-18 17:08:07 -07:00
2019-05-24 17:36:42 +02:00
2019-07-10 18:43:43 -07:00
2019-08-27 20:31:12 -07:00
2019-06-07 11:00:14 -07:00
2019-07-11 14:37:45 -07:00
2019-08-24 13:46:57 -07:00
2019-05-21 10:50:46 +02:00
2019-08-27 20:57:43 -07:00
2019-08-28 14:47:35 -07:00
2019-07-29 10:26:14 -07:00
2019-06-19 17:09:55 +02:00
2019-07-08 19:48:57 -07:00
2019-07-30 14:42:13 -07:00
2019-06-23 13:24:17 -07:00
2019-06-17 20:20:36 -07:00
2019-06-05 17:36:36 +02:00
2019-08-21 10:15:33 +02:00
2019-05-30 11:26:41 -07:00
2019-08-25 14:34:08 -07:00
2019-08-22 19:27:02 -07:00
2019-08-19 09:34:21 +02:00
2019-05-21 11:28:45 +02:00
2019-06-14 19:50:33 -07:00
2019-07-24 15:49:05 -07:00
2019-07-08 12:46:24 -07:00
2019-06-19 17:09:55 +02:00
2019-08-25 14:48:43 -07:00
2019-08-15 13:59:48 -07:00
2019-06-05 17:37:07 +02:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:36:37 +02:00
2019-08-27 20:56:06 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-08-14 11:37:51 +01:00
2019-08-28 14:45:46 -07:00
2019-08-13 20:45:01 -07:00
2019-08-20 12:25:14 -07:00
2019-06-22 08:59:24 -04:00
2019-08-26 15:31:29 -04:00
2019-05-30 11:26:32 -07:00
2019-08-16 16:27:13 -07:00
2019-08-15 12:40:15 -07:00
2019-06-07 11:00:14 -07:00
2019-08-02 17:26:27 -07:00
2019-06-05 17:30:29 +02:00
2019-08-21 10:43:03 +02:00
2019-05-24 17:27:12 +02:00
2019-08-20 16:39:48 +02:00
2019-08-24 14:49:35 -07:00
2019-05-31 15:30:03 -06:00
2019-06-17 13:56:26 -07:00
2019-07-19 10:42:02 -07:00
2019-05-21 10:50:45 +02:00