Ido Schimmel
692c31bd40
team: Free BPF filter when unregistering netdev
When team is used in loadbalance mode a BPF filter can be used to
provide a hash which will determine the Tx port.
When the netdev is later unregistered the filter is not freed which
results in memory leaks [1].
Fix by freeing the program and the corresponding filter when
unregistering the netdev.
[1]
unreferenced object 0xffff8881dbc47cc8 (size 16):
comm "teamd", pid 3068, jiffies 4294997779 (age 438.247s)
hex dump (first 16 bytes):
a3 00 6b 6b 6b 6b 6b 6b 88 a5 82 e1 81 88 ff ff ..kkkkkk........
backtrace:
[<000000008a3b47e3>] team_nl_cmd_options_set+0x88f/0x11b0
[<00000000c4f4f27e>] genl_family_rcv_msg+0x78f/0x1080
[<00000000610ef838>] genl_rcv_msg+0xca/0x170
[<00000000a281df93>] netlink_rcv_skb+0x132/0x380
[<000000004d9448a2>] genl_rcv+0x29/0x40
[<000000000321b2f4>] netlink_unicast+0x4c0/0x690
[<000000008c25dffb>] netlink_sendmsg+0x929/0xe10
[<00000000068298c5>] sock_sendmsg+0xc8/0x110
[<0000000082a61ff0>] ___sys_sendmsg+0x77a/0x8f0
[<00000000663ae29d>] __sys_sendmsg+0xf7/0x250
[<0000000027c5f11a>] do_syscall_64+0x14d/0x610
[<000000006cfbc8d3>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[<00000000e23197e2>] 0xffffffffffffffff
unreferenced object 0xffff8881e182a588 (size 2048):
comm "teamd", pid 3068, jiffies 4294997780 (age 438.247s)
hex dump (first 32 bytes):
20 00 00 00 02 00 00 00 30 00 00 00 28 f0 ff ff .......0...(...
07 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00 ........(.......
backtrace:
[<000000002daf01fb>] lb_bpf_func_set+0x45c/0x6d0
[<000000008a3b47e3>] team_nl_cmd_options_set+0x88f/0x11b0
[<00000000c4f4f27e>] genl_family_rcv_msg+0x78f/0x1080
[<00000000610ef838>] genl_rcv_msg+0xca/0x170
[<00000000a281df93>] netlink_rcv_skb+0x132/0x380
[<000000004d9448a2>] genl_rcv+0x29/0x40
[<000000000321b2f4>] netlink_unicast+0x4c0/0x690
[<000000008c25dffb>] netlink_sendmsg+0x929/0xe10
[<00000000068298c5>] sock_sendmsg+0xc8/0x110
[<0000000082a61ff0>] ___sys_sendmsg+0x77a/0x8f0
[<00000000663ae29d>] __sys_sendmsg+0xf7/0x250
[<0000000027c5f11a>] do_syscall_64+0x14d/0x610
[<000000006cfbc8d3>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[<00000000e23197e2>] 0xffffffffffffffff
Fixes: 01d7f30a9f ("team: add loadbalance mode")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Amit Cohen <amitc@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-04 10:57:29 -08:00
..
2019-02-07 12:24:28 +01:00
2019-02-01 15:50:26 +01:00
2019-02-06 12:47:09 -07:00
2019-01-17 11:27:00 -08:00
2019-02-15 19:48:39 +01:00
2019-02-21 10:29:00 +01:00
2019-01-10 13:39:19 +02:00
2019-02-12 09:13:18 -07:00
2019-03-02 19:51:23 +01:00
2019-01-29 07:53:47 -08:00
2018-12-29 08:20:44 -07:00
2019-01-25 13:03:34 -10:00
2019-02-20 11:40:21 -08:00
2019-01-29 07:53:47 -08:00
2019-02-19 11:17:37 +01:00
2019-01-30 22:57:42 +01:00
2019-03-04 10:21:32 -08:00
2018-12-28 12:11:47 -08:00
2018-12-11 11:40:13 +09:00
2019-02-10 10:39:37 -08:00
2019-01-04 13:13:46 -08:00
2019-01-24 17:13:59 +01:00
2018-11-23 11:46:22 +09:00
2019-01-22 20:40:59 -05:00
2019-02-17 09:22:01 -08:00
2019-01-31 16:19:48 +01:00
2018-12-02 16:25:28 -08:00
2018-12-10 10:17:45 +01:00
2019-02-14 10:06:03 +01:00
2019-02-22 09:35:25 +10:00
2019-01-29 12:09:11 +01:00
2018-12-05 00:16:59 +01:00
2019-01-09 19:20:31 -05:00
2019-01-27 18:55:49 -08:00
2019-01-03 11:42:10 -08:00
2018-12-19 20:21:06 +01:00
2019-02-15 09:45:05 +01:00
2019-01-26 11:14:25 +01:00
2019-01-31 08:25:09 -07:00
2019-02-03 13:10:41 +01:00
2019-02-26 08:49:05 -08:00
2019-02-17 08:30:35 -08:00
2019-02-08 15:34:10 -08:00
2019-02-10 09:54:19 -08:00
2019-03-04 10:54:48 -08:00
2019-01-17 22:27:39 +01:00
2018-12-22 14:45:35 -07:00
2019-01-03 18:57:57 -08:00
2019-02-18 10:40:58 -06:00
2019-02-15 09:12:28 -08:00
2019-01-16 11:13:25 -05:00
2019-01-05 11:30:37 -08:00
2018-12-28 16:52:18 -08:00
2018-12-18 23:13:12 -05:00
2019-01-29 10:55:34 +01:00
2019-02-01 15:53:54 +01:00
2019-02-13 08:41:15 +01:00
2019-02-13 14:19:40 +01:00
2019-03-04 10:57:29 -08:00
2019-01-08 07:58:37 -05:00
2019-01-21 09:57:43 -08:00
2019-02-12 09:29:07 +01:00
2018-12-06 15:45:46 +01:00
2019-02-04 18:33:36 -08:00
2019-01-04 12:19:40 +01:00
2018-12-29 13:40:29 -08:00
2018-11-27 08:31:27 +01:00
2019-02-08 15:32:10 -08:00
2019-01-05 11:23:17 -08:00
2019-01-04 10:13:27 +00:00
2019-02-07 18:10:25 -08:00
2019-02-17 22:24:32 +01:00
2019-01-29 10:59:07 +01:00
2019-01-03 18:57:57 -08:00
2018-12-28 20:22:45 -08:00
2018-12-29 13:03:29 -08:00
2019-02-19 14:15:40 -08:00
2018-12-24 12:06:56 +01:00
2019-01-08 07:58:37 -05:00
2018-12-22 00:25:54 +09:00
2018-12-21 13:43:35 +00:00
2019-01-14 20:15:19 -05:00
2019-01-07 16:38:51 +01:00
2019-01-01 13:24:31 -08:00
2019-02-28 12:55:26 -08:00
2018-12-26 10:32:18 -08:00
2019-02-23 09:48:01 -08:00
2018-12-06 15:50:06 +01:00
2019-01-30 11:14:04 +01:00
2019-01-08 07:58:37 -05:00
2019-02-27 12:39:56 -08:00
2019-02-04 21:40:32 -05:00
2018-12-31 13:06:30 -08:00
2019-02-05 15:50:13 -08:00
2018-12-05 12:01:56 +03:00
2019-02-08 10:49:55 -08:00
2018-12-28 20:54:57 -08:00
2019-02-24 22:27:19 -08:00
2019-01-23 08:20:43 -07:00
2019-02-19 13:14:45 -08:00
2019-01-25 12:58:40 -10:00
2019-02-05 15:29:48 -05:00
2018-12-22 00:25:54 +09:00
2019-01-07 10:10:35 +01:00
2019-01-23 22:14:56 +01:00
2018-12-29 13:40:29 -08:00