Lokesh Dhoundiyal
337530058e
ipv4: drop dst in multicast routing path
...
[ Upstream commit 9e6c6d17d1d6a3f1515ce399f9a011629ec79aa0 ]
kmemleak reports the following when routing multicast traffic over an
ipsec tunnel.
Kmemleak output:
unreferenced object 0x8000000044bebb00 (size 256):
comm "softirq", pid 0, jiffies 4294985356 (age 126.810s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 80 00 00 00 05 13 74 80 ..............t.
80 00 00 00 04 9b bf f9 00 00 00 00 00 00 00 00 ................
backtrace:
[<00000000f83947e0>] __kmalloc+0x1e8/0x300
[<00000000b7ed8dca>] metadata_dst_alloc+0x24/0x58
[<0000000081d32c20>] __ipgre_rcv+0x100/0x2b8
[<00000000824f6cf1>] gre_rcv+0x178/0x540
[<00000000ccd4e162>] gre_rcv+0x7c/0xd8
[<00000000c024b148>] ip_protocol_deliver_rcu+0x124/0x350
[<000000006a483377>] ip_local_deliver_finish+0x54/0x68
[<00000000d9271b3a>] ip_local_deliver+0x128/0x168
[<00000000bd4968ae>] xfrm_trans_reinject+0xb8/0xf8
[<0000000071672a19>] tasklet_action_common.isra.16+0xc4/0x1b0
[<0000000062e9c336>] __do_softirq+0x1fc/0x3e0
[<00000000013d7914>] irq_exit+0xc4/0xe0
[<00000000a4d73e90>] plat_irq_dispatch+0x7c/0x108
[<000000000751eb8e>] handle_int+0x16c/0x178
[<000000001668023b>] _raw_spin_unlock_irqrestore+0x1c/0x28
The metadata dst is leaked when ip_route_input_mc() updates the dst for
the skb. Commit f38a9eb1f77b ("dst: Metadata destinations") correctly
handled dropping the dst in ip_route_input_slow() but missed the
multicast case which is handled by ip_route_input_mc(). Drop the dst in
ip_route_input_mc() avoiding the leak.
Fixes: f38a9eb1f77b ("dst: Metadata destinations")
Signed-off-by: Lokesh Dhoundiyal <lokesh.dhoundiyal@alliedtelesis.co.nz>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20220505020017.3111846-1-chris.packham@alliedtelesis.co.nz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-18 10:26:48 +02:00
..
2021-07-22 16:19:03 +02:00
2022-03-11 12:22:36 +01:00
2021-08-13 16:30:35 -07:00
2021-12-01 09:04:53 +01:00
2021-07-23 14:20:25 +01:00
2022-04-20 09:34:22 +02:00
2022-05-18 10:26:47 +02:00
2022-05-15 20:18:52 +02:00
2022-04-13 20:59:25 +02:00
2021-06-25 13:13:50 +02:00
2022-02-23 12:03:13 +01:00
2021-09-14 12:51:15 +01:00
2022-05-12 12:30:09 +02:00
2021-06-30 15:51:09 -07:00
2022-05-09 09:14:35 +02:00
2022-03-08 19:12:52 +01:00
2021-11-18 19:16:33 +01:00
2021-08-05 13:27:50 +01:00
2022-05-09 09:14:34 +02:00
2021-08-03 13:05:26 +01:00
2021-12-14 10:57:09 +01:00
2022-02-08 18:34:09 +01:00
2022-05-18 10:26:48 +02:00
2022-05-12 12:30:18 +02:00
2021-08-09 10:13:32 +01:00
2021-06-29 11:28:21 -07:00
2022-04-08 14:22:47 +02:00
2021-09-09 11:00:20 +01:00
2022-04-27 14:38:53 +02:00
2022-03-28 09:58:46 +02:00
2022-05-18 10:26:47 +02:00
2021-09-07 14:06:08 +01:00
2022-04-13 20:59:16 +02:00
2021-12-08 09:04:47 +01:00
2022-03-08 19:12:48 +01:00
2022-01-05 12:42:37 +01:00
2022-05-09 09:14:43 +02:00
2022-04-13 20:59:10 +02:00
2022-04-27 14:38:54 +02:00
2022-01-27 11:04:00 +01:00
2022-05-12 12:30:10 +02:00
2022-04-27 14:39:01 +02:00
2022-04-27 14:38:53 +02:00
2022-01-11 15:35:16 +01:00
2021-09-02 11:37:02 +01:00
2021-12-22 09:32:42 +01:00
2022-04-08 14:23:00 +02:00
2022-05-12 12:30:19 +02:00
2022-04-27 14:39:01 +02:00
2022-05-09 09:14:35 +02:00
2022-05-09 09:14:36 +02:00
2021-11-18 19:17:11 +01:00
2022-05-12 12:30:14 +02:00
2021-08-04 12:35:07 +01:00
2022-04-08 14:23:43 +02:00
2022-05-09 09:14:38 +02:00
2022-04-08 14:24:14 +02:00
2022-04-08 14:23:51 +02:00
2022-04-20 09:34:19 +02:00
2022-04-08 14:23:53 +02:00
2022-05-09 09:14:32 +02:00
2022-04-08 14:22:46 +02:00
2021-07-29 15:06:49 +01:00
2021-07-29 15:06:49 +01:00
2022-01-27 11:03:52 +01:00