]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: frame could be completed more than once in SKB path
authorMagnus Karlsson <magnus.karlsson@intel.com>
Fri, 29 Jun 2018 07:48:18 +0000 (09:48 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 3 Jul 2018 01:37:11 +0000 (18:37 -0700)
commit667c260357a64eae61d9bd4d82bd70ddd9bbc07f
tree9a70b5726fb7b432289dd130d5d871d0a61de56b
parent28d49000e64992057b56db2ed81e8c1cbd6b3177
xsk: frame could be completed more than once in SKB path

Fixed a bug in which a frame could be completed more than once
when an error was returned from dev_direct_xmit(). The code
erroneously retried sending the message leading to multiple
calls to the SKB destructor and therefore multiple completions
of the same buffer to user space.

The error code in this case has been changed from EAGAIN to EBUSY
in order to tell user space that the sending of the packet failed
and the buffer has been return to user space through the completion
queue.

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.c