Netdev List
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Ido Schimmel <idosch@mellanox.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Jiri Pirko <jiri@mellanox.com>, mlxsw <mlxsw@mellanox.com>
Subject: Re: [PATCH net] team: Free BPF filter when unregistering netdev
Date: Mon, 4 Mar 2019 07:53:57 +0100	[thread overview]
Message-ID: <20190304065357.GS2314@nanopsycho> (raw)
In-Reply-To: <20190303073516.10798-1-idosch@mellanox.com>

Sun, Mar 03, 2019 at 08:35:51AM CET, idosch@mellanox.com wrote:
>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: 01d7f30a9f96 ("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>

  reply	other threads:[~2019-03-04  7:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-03  7:35 [PATCH net] team: Free BPF filter when unregistering netdev Ido Schimmel
2019-03-04  6:53 ` Jiri Pirko [this message]
2019-03-04 18:58 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190304065357.GS2314@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox