]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: fix potential lost completion message in SKB path
authorMagnus Karlsson <magnus.karlsson@intel.com>
Fri, 29 Jun 2018 07:48:17 +0000 (09:48 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 3 Jul 2018 01:37:11 +0000 (18:37 -0700)
commit28d49000e64992057b56db2ed81e8c1cbd6b3177
tree5c6f0af2b630f695698e9c08459bad13d8abff26
parent7e2a8eb945f20e6a375e740babd8877a59feab02
xsk: fix potential lost completion message in SKB path

The code in xskq_produce_addr erroneously checked if there
was up to LAZY_UPDATE_THRESHOLD amount of space in the completion
queue. It only needs to check if there is one slot left in the
queue. This bug could under some circumstances lead to a WARN_ON_ONCE
being triggered and the completion message to user space being lost.

Fixes: ed6ca125478b ("xsk: support for Tx")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Reported-by: Pavel Odintsov <pavel@fastnetmon.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/xdp/xsk_queue.h