Lokesh Dhoundiyal
9e6c6d17d1
ipv4: drop dst in multicast routing path
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>
2022-05-06 12:46:38 -07:00
..
2020-08-10 12:06:44 -07:00
2022-04-25 10:37:33 +02:00
2022-02-21 11:41:30 +00:00
2021-06-30 15:51:09 -07:00
2022-02-26 12:53:59 +00:00
2022-01-27 12:03:46 -08:00
2021-09-19 12:43:56 +01:00
2021-09-29 11:39:33 +01:00
2022-02-18 21:20:06 -08:00
2022-03-07 13:14:04 +01:00
2022-04-13 10:16:11 +02:00
2022-03-15 20:20:02 -07:00
2022-02-17 11:44:20 -08:00
2021-09-28 17:32:56 -07:00
2022-02-10 15:33:33 +00:00
2022-04-01 12:09:17 +01:00
2022-03-15 20:20:02 -07:00
2021-11-24 17:21:42 -08:00
2021-05-17 15:29:35 -07:00
2021-11-24 17:21:42 -08:00
2022-01-25 11:25:21 +00:00
2022-04-30 15:18:19 +01:00
2022-02-02 14:45:18 +00:00
2021-12-10 21:14:49 -08:00
2022-03-03 14:38:48 +00:00
2022-05-04 19:22:33 -07:00
2022-01-26 19:00:31 -08:00
2021-03-01 13:32:12 -08:00
2022-03-03 14:38:48 +00:00
2022-03-03 14:38:48 +00:00
2022-04-25 11:40:45 +01:00
2022-03-03 14:38:48 +00:00
2022-01-29 17:53:07 +00:00
2022-03-03 14:38:48 +00:00
2021-11-20 14:11:00 +00:00
2021-01-08 19:25:35 -08:00
2022-04-15 14:27:30 -07:00
2021-10-13 09:41:37 -07:00
2021-06-30 15:51:09 -07:00
2021-10-28 14:36:41 +01:00
2021-10-13 09:41:37 -07:00
2019-10-04 11:10:56 -07:00
2022-02-10 17:29:56 -08:00
2020-08-18 16:02:16 -07:00
2021-02-26 12:28:03 -08:00
2020-11-16 08:08:54 -08:00
2021-04-18 22:04:16 +02:00
2019-05-21 10:50:45 +02:00
2022-02-08 20:41:33 -08:00
2022-05-05 18:12:44 -07:00
2022-01-26 19:00:31 -08:00
2021-05-17 15:29:35 -07:00
2021-07-13 09:28:29 -07:00
2022-01-27 20:58:39 +02:00
2022-05-06 12:46:38 -07:00
2022-04-25 12:10:11 +01:00
2022-03-09 20:05:44 -08:00
2022-01-18 14:26:41 -08:00
2020-03-16 18:26:54 -07:00
2022-03-15 16:43:31 +01:00
2019-05-21 10:50:45 +02:00
2022-03-11 22:51:40 -08:00
2022-01-18 14:26:41 -08:00
2022-01-18 14:26:41 -08:00
2018-10-10 22:26:00 -07:00
2020-02-27 18:50:19 -08:00
2021-09-20 13:09:06 +01:00
2020-07-06 13:23:03 -07:00
2020-07-06 13:23:03 -07:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2022-04-28 10:35:38 -07:00
2022-03-09 20:05:44 -08:00
2021-03-28 17:31:13 -07:00
2020-12-14 16:40:27 -08:00
2022-04-22 15:05:59 -07:00
2021-09-27 12:47:39 +01:00
2021-11-16 13:16:54 +00:00
2022-04-25 12:07:45 +01:00
2022-04-22 15:20:47 -07:00
2021-07-27 20:07:21 +01:00
2020-08-24 17:31:20 -07:00
2021-06-29 11:28:21 -07:00
2020-03-09 22:34:58 +01:00
2020-10-13 17:11:52 -07:00
2020-07-06 13:23:03 -07:00
2019-05-21 10:50:45 +02:00
2021-06-29 11:54:36 -07:00
2022-03-09 20:05:20 -08:00
2021-05-17 15:29:35 -07:00
2021-10-26 12:29:33 -07:00
2021-07-13 09:28:29 -07:00
2020-07-24 15:41:54 -07:00
2021-11-24 17:21:42 -08:00
2021-09-21 10:17:20 +01:00
2022-02-23 12:35:00 +00:00
2020-07-10 13:54:00 -07:00
2022-02-07 11:18:49 +00:00
2021-05-17 15:29:35 -07:00
2020-05-06 09:40:08 +02:00
2020-05-11 15:12:27 +02:00
2022-03-15 20:20:02 -07:00
2021-05-17 15:29:35 -07:00
2020-05-06 09:40:08 +02:00
2021-09-23 10:10:00 +02:00