From: David Miller <davem@davemloft.net>
To: saeedm@mellanox.com
Cc: songliubraving@fb.com, hawk@kernel.org, kafai@fb.com,
kpsingh@chromium.org, john.fastabend@gmail.com, leon@kernel.org,
linux-kernel@vger.kernel.org, ast@kernel.org,
linux-rdma@vger.kernel.org, xiongx18@fudan.edu.cn, yhs@fb.com,
andriin@fb.com, kuba@kernel.org, daniel@iogearbox.net,
bpf@vger.kernel.org, netdev@vger.kernel.org,
xiyuyang19@fudan.edu.cn, tanxin.ctf@gmail.com,
yuanxzhang@fudan.edu.cn
Subject: Re: [PATCH] net/mlx5e: fix bpf_prog refcnt leaks in mlx5e_alloc_rq
Date: Wed, 29 Jul 2020 13:28:42 -0700 (PDT) [thread overview]
Message-ID: <20200729.132842.190888844026802233.davem@davemloft.net> (raw)
In-Reply-To: <613fe5f56cb60982937c826ed915ada2de5e93a2.camel@mellanox.com>
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Wed, 29 Jul 2020 19:02:15 +0000
> On Wed, 2020-07-29 at 20:33 +0800, Xin Xiong wrote:
>> The function invokes bpf_prog_inc(), which increases the refcount of
>> a
>> bpf_prog object "rq->xdp_prog" if the object isn't NULL.
>>
>> The refcount leak issues take place in two error handling paths. When
>> mlx5_wq_ll_create() or mlx5_wq_cyc_create() fails, the function
>> simply
>> returns the error code and forgets to drop the refcount increased
>> earlier, causing a refcount leak of "rq->xdp_prog".
>>
>> Fix this issue by jumping to the error handling path
>> err_rq_wq_destroy
>> when either function fails.
>>
>
> Fixes: 422d4c401edd ("net/mlx5e: RX, Split WQ objects for different RQ
> types")
Saeed, are you going to take this into your tree or would you like me to
apply it directly?
Thanks.
next prev parent reply other threads:[~2020-07-29 20:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 12:33 [PATCH] net/mlx5e: fix bpf_prog refcnt leaks in mlx5e_alloc_rq Xin Xiong
2020-07-29 19:02 ` Saeed Mahameed
2020-07-29 20:28 ` David Miller [this message]
2020-07-29 20:51 ` Saeed Mahameed
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=20200729.132842.190888844026802233.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@chromium.org \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=songliubraving@fb.com \
--cc=tanxin.ctf@gmail.com \
--cc=xiongx18@fudan.edu.cn \
--cc=xiyuyang19@fudan.edu.cn \
--cc=yhs@fb.com \
--cc=yuanxzhang@fudan.edu.cn \
/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