Taehee Yoo
fda2ec62cf
vxlan: fix memleak of fdb
When vxlan interface is deleted, all fdbs are deleted by vxlan_flush().
vxlan_flush() flushes fdbs but it doesn't delete fdb, which contains
all-zeros-mac because it is deleted by vxlan_uninit().
But vxlan_uninit() deletes only the fdb, which contains both all-zeros-mac
and default vni.
So, the fdb, which contains both all-zeros-mac and non-default vni
will not be deleted.
Test commands:
ip link add vxlan0 type vxlan dstport 4789 external
ip link set vxlan0 up
bridge fdb add to 00:00:00:00:00:00 dst 172.0.0.1 dev vxlan0 via lo \
src_vni 10000 self permanent
ip link del vxlan0
kmemleak reports as follows:
unreferenced object 0xffff9486b25ced88 (size 96):
comm "bridge", pid 2151, jiffies 4294701712 (age 35506.901s)
hex dump (first 32 bytes):
02 00 00 00 ac 00 00 01 40 00 09 b1 86 94 ff ff ........@.......
46 02 00 00 00 00 00 00 a7 03 00 00 12 b5 6a 6b F.............jk
backtrace:
[<00000000c10cf651>] vxlan_fdb_append.part.51+0x3c/0xf0 [vxlan]
[<000000006b31a8d9>] vxlan_fdb_create+0x184/0x1a0 [vxlan]
[<0000000049399045>] vxlan_fdb_update+0x12f/0x220 [vxlan]
[<0000000090b1ef00>] vxlan_fdb_add+0x12a/0x1b0 [vxlan]
[<0000000056633c2c>] rtnl_fdb_add+0x187/0x270
[<00000000dd5dfb6b>] rtnetlink_rcv_msg+0x264/0x490
[<00000000fc44dd54>] netlink_rcv_skb+0x4a/0x110
[<00000000dff433e7>] netlink_unicast+0x18e/0x250
[<00000000b87fb421>] netlink_sendmsg+0x2e9/0x400
[<000000002ed55153>] ____sys_sendmsg+0x237/0x260
[<00000000faa51c66>] ___sys_sendmsg+0x88/0xd0
[<000000006c3982f1>] __sys_sendmsg+0x4e/0x80
[<00000000a8f875d2>] do_syscall_64+0x56/0xe0
[<000000003610eefa>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
unreferenced object 0xffff9486b1c40080 (size 128):
comm "bridge", pid 2157, jiffies 4294701754 (age 35506.866s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 f8 dc 42 b2 86 94 ff ff ..........B.....
6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
backtrace:
[<00000000a2981b60>] vxlan_fdb_create+0x67/0x1a0 [vxlan]
[<0000000049399045>] vxlan_fdb_update+0x12f/0x220 [vxlan]
[<0000000090b1ef00>] vxlan_fdb_add+0x12a/0x1b0 [vxlan]
[<0000000056633c2c>] rtnl_fdb_add+0x187/0x270
[<00000000dd5dfb6b>] rtnetlink_rcv_msg+0x264/0x490
[<00000000fc44dd54>] netlink_rcv_skb+0x4a/0x110
[<00000000dff433e7>] netlink_unicast+0x18e/0x250
[<00000000b87fb421>] netlink_sendmsg+0x2e9/0x400
[<000000002ed55153>] ____sys_sendmsg+0x237/0x260
[<00000000faa51c66>] ___sys_sendmsg+0x88/0xd0
[<000000006c3982f1>] __sys_sendmsg+0x4e/0x80
[<00000000a8f875d2>] do_syscall_64+0x56/0xe0
[<000000003610eefa>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fixes: 3ad7a4b141 ("vxlan: support fdb and learning in COLLECT_METADATA mode")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-08-01 11:49:18 -07:00
..
2020-06-14 01:57:21 +09:00
2020-07-03 16:15:31 +02:00
2020-06-15 23:08:28 -05:00
2020-06-23 07:54:46 +02:00
2020-06-19 13:09:40 -07:00
2020-07-30 17:35:53 -07:00
2020-06-14 01:57:21 +09:00
2020-07-17 09:58:18 -07:00
2020-07-16 11:26:40 -07:00
2020-06-03 16:27:18 -07:00
2020-07-25 13:27:12 -07:00
2020-06-10 16:05:54 -07:00
2020-07-16 11:26:40 -07:00
2020-07-15 19:00:12 -07:00
2020-07-25 13:27:12 -07:00
2020-06-14 01:57:21 +09:00
2020-06-14 14:46:52 +01:00
2020-07-13 17:55:57 +02:00
2020-06-25 13:52:53 +02:00
2020-07-20 18:28:04 -07:00
2020-06-04 19:06:23 -07:00
2020-05-28 18:02:40 +09:00
2020-06-17 10:57:41 -07:00
2020-07-15 15:58:11 -07:00
2020-07-10 15:39:29 +05:30
2020-06-18 20:25:25 +02:00
2020-06-14 01:57:21 +09:00
2020-05-29 17:36:02 +09:00
2020-06-15 23:08:31 -05:00
2020-07-25 13:18:42 -07:00
2020-06-26 17:26:31 +02:00
2020-06-14 01:57:21 +09:00
2020-06-14 01:57:21 +09:00
2020-06-26 23:53:25 +02:00
2020-07-23 14:06:16 +10:00
2020-06-14 01:57:21 +09:00
2020-07-17 09:43:13 -07:00
2020-06-14 01:57:21 +09:00
2020-06-29 10:30:35 +00:00
2020-07-18 08:11:44 -07:00
2020-07-10 15:12:48 +02:00
2020-07-23 22:26:44 +02:00
2020-06-14 01:57:21 +09:00
2020-07-08 09:20:50 +02:00
2020-07-21 13:51:35 -03:00
2020-07-13 18:31:15 -07:00
2020-06-10 14:04:39 -07:00
2020-07-22 17:29:28 +02:00
2020-06-14 01:57:21 +09:00
2020-07-06 12:48:04 -07:00
2020-06-14 01:57:21 +09:00
2020-06-04 11:03:45 -07:00
2020-06-02 15:29:19 -07:00
2020-06-14 01:57:21 +09:00
2020-06-10 22:43:57 -05:00
2020-07-23 14:39:37 -04:00
2020-06-26 00:27:37 -07:00
2020-05-28 14:18:11 +02:00
2020-06-26 22:51:53 -04:00
2020-07-14 17:44:42 +02:00
2020-06-29 19:10:51 +02:00
2020-07-13 12:17:34 +02:00
2020-07-07 21:04:38 +02:00
2020-08-01 11:49:18 -07:00
2020-07-20 18:31:33 -07:00
2020-06-05 20:02:09 -04:00
2020-07-08 17:08:01 -07:00
2020-07-16 16:40:27 +02:00
2020-05-27 11:09:26 +02:00
2020-06-19 13:39:00 -07:00
2020-07-16 08:50:54 +05:30
2020-06-15 23:08:32 -05:00
2020-06-14 01:57:21 +09:00
2020-07-24 18:30:24 -07:00
2020-06-14 01:57:21 +09:00
2020-07-17 10:51:44 +01:00
2020-07-08 18:00:07 +02:00
2020-06-28 01:08:21 +02:00
2020-07-15 12:47:04 +03:00
2020-06-14 01:57:21 +09:00
2020-06-10 11:28:35 -07:00
2020-06-13 13:29:16 -07:00
2020-06-14 01:57:21 +09:00
2020-06-14 01:57:21 +09:00
2020-06-04 19:09:28 +02:00
2020-06-15 23:08:32 -05:00
2020-06-25 15:29:21 +01:00
2020-06-08 13:01:08 -07:00
2020-06-07 10:59:32 -07:00
2020-06-08 13:01:08 -07:00
2020-06-07 16:11:23 -07:00
2020-07-03 11:41:31 +02:00
2020-06-14 01:57:21 +09:00
2020-07-15 16:16:45 -04:00
2020-06-14 01:57:21 +09:00
2020-07-16 22:08:07 +02:00
2020-06-22 17:15:20 +05:30
2020-07-17 10:24:09 -07:00
2020-07-22 11:56:00 -07:00
2020-06-13 13:29:16 -07:00
2020-06-09 09:39:14 -07:00
2020-07-16 11:08:54 -07:00
2020-06-25 15:45:30 +03:00
2020-07-16 11:10:27 -07:00
2020-07-03 10:52:02 +02:00
2020-07-16 17:30:59 +02:00
2020-06-22 12:34:21 -04:00
2020-07-17 08:28:40 -06:00
2020-06-22 12:34:21 -04:00
2020-06-26 13:49:17 +10:00
2020-07-10 13:40:19 +02:00
2020-07-24 18:30:24 -07:00
2020-06-14 01:57:21 +09:00
2020-06-14 01:57:21 +09:00
2020-06-15 23:08:32 -05:00
2020-06-14 01:57:21 +09:00
2020-07-11 11:16:46 -07:00
2020-06-14 01:57:21 +09:00