lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <CALzJLG9tSORy8nTC9Xv6ByEeCCUeK567wRw5HTYh0n7xWzYtBw@mail.gmail.com> Date: Mon, 21 Nov 2016 11:30:54 +0200 From: Saeed Mahameed <saeedm@....mellanox.co.il> To: Daniel Borkmann <daniel@...earbox.net> Cc: "David S. Miller" <davem@...emloft.net>, Alexei Starovoitov <alexei.starovoitov@...il.com>, Brenden Blanco <bblanco@...mgrid.com>, Zhiyi Sun <zhiyisun@...il.com>, Rana Shahout <ranas@...lanox.com>, Saeed Mahameed <saeedm@...lanox.com>, Linux Netdev List <netdev@...r.kernel.org> Subject: Re: [PATCH net-next v3 2/4] bpf, mlx5: fix various refcount issues in mlx5e_xdp_set On Sat, Nov 19, 2016 at 2:45 AM, Daniel Borkmann <daniel@...earbox.net> wrote: > There are multiple issues in mlx5e_xdp_set(): > > 1) The batched bpf_prog_add() is currently not checked for errors. When > doing so, it should be done at an earlier point in time to makes sure > that we cannot fail anymore at the time we want to set the program for > each channel. The batched refs short-cut can only be performed when we > don't need to perform a reset for changing the rq type and the device > was in opened state. In case the device was not in opened state, then > the next mlx5e_open_locked() will aquire the refs from the control prog > via mlx5e_create_rq(), same when we need to perform a reset. > > 2) When swapping the priv->xdp_prog, then no extra reference count must be > taken since we got that from call path via dev_change_xdp_fd() already. > Otherwise, we'd never be able to release the program. Also, bpf_prog_add() > without checking the return code could fail. > > Fixes: 86994156c736 ("net/mlx5e: XDP fast RX drop bpf programs support") > Signed-off-by: Daniel Borkmann <daniel@...earbox.net> Acked-by: Saeed Mahameed <saeedm@...lanox.com>
Powered by blists - more mailing lists