Re: [PATCH net 1/3] bpf, mlx5: fix mlx5e_create_rq taking reference on prog

2016-11-14 Thread Saeed Mahameed
On 11/14/2016 02:43 AM, Daniel Borkmann wrote: > In mlx5e_create_rq(), when creating a new queue, we call bpf_prog_add() but > without checking the return value. bpf_prog_add() can fail, so we really Didn't know this, thanks for noticing, I wonder why taking a reference for an object would fail

Re: [PATCH net 1/3] bpf, mlx5: fix mlx5e_create_rq taking reference on prog

2016-11-14 Thread Daniel Borkmann
Hi Saeed, On 11/14/2016 07:15 PM, Saeed Mahameed wrote: On 11/14/2016 02:43 AM, Daniel Borkmann wrote: In mlx5e_create_rq(), when creating a new queue, we call bpf_prog_add() but without checking the return value. bpf_prog_add() can fail, so we really Didn't know this, thanks for noticing, I

[PATCH net 1/3] bpf, mlx5: fix mlx5e_create_rq taking reference on prog

2016-11-13 Thread Daniel Borkmann
In mlx5e_create_rq(), when creating a new queue, we call bpf_prog_add() but without checking the return value. bpf_prog_add() can fail, so we really must check it. Take the reference right when we assign it to the rq from priv->xdp_prog, and just drop the reference on error path. Destruction in mlx