Thread (3 messages) flat view 3 messages, 3 authors, 2020-07-30

Re: [PATCH v2] net/mlx5e: fix bpf_prog reference count leaks in mlx5e_alloc_rq

From: Saeed Mahameed <hidden>
Date: 2020-07-30 23:18:22
Also in: bpf, linux-rdma, lkml

On Thu, 2020-07-30 at 18:29 +0800, Xin Xiong wrote:
The function invokes bpf_prog_inc(), which increases the reference
count 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
either mlx5_wq_ll_create() or mlx5_wq_cyc_create() fails, the
function
simply returns the error code and forgets to drop the reference count
increased earlier, causing a reference count leak of "rq->xdp_prog".

Fix this issue by jumping to the error handling path
err_rq_wq_destroy
while either function fails.

Fixes: 422d4c401edd ("net/mlx5e: RX, Split WQ objects for different
RQ
types")
Please don't break the line of the fixes tag.
I will fix this up.
Signed-off-by: Xin Xiong <redacted>
Signed-off-by: Xiyu Yang <redacted>
Signed-off-by: Xin Tan <redacted>
---
v1 -> v2:
- Amended parts of wording to be better understood
- Added Fixes tag
---
Applied to net-mlx5, Thanks !
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help