summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorBjörn Töpel <bjorn.topel@intel.com>2018-06-12 13:02:56 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2018-06-12 13:19:04 +0300
commit5d902372ba5f416261c79123f02e49c664c7118f (patch)
tree76ba033eb26fd77b7b1e4ecba9bf9064a99ea0ff /net
parent6892286e9c09925780fe2cb6db3585b56b71fe8e (diff)
downloadlinux-5d902372ba5f416261c79123f02e49c664c7118f.tar.xz
xsk: re-add queue id check for XDP_SKB path
Commit 173d3adb6f43 ("xsk: add zero-copy support for Rx") introduced a regression on the XDP_SKB receive path, when the queue id checks were removed. Now, they are back again. Fixes: 173d3adb6f43 ("xsk: add zero-copy support for Rx") Reported-by: Qi Zhang <qi.z.zhang@intel.com> Signed-off-by: Björn Töpel <bjorn.topel@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net')
-rw-r--r--net/xdp/xsk.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 36919a254ba3..3b3410ada097 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -118,6 +118,9 @@ int xsk_generic_rcv(struct xdp_sock *xs, struct xdp_buff *xdp)
u64 addr;
int err;
+ if (xs->dev != xdp->rxq->dev || xs->queue_id != xdp->rxq->queue_index)
+ return -EINVAL;
+
if (!xskq_peek_addr(xs->umem->fq, &addr) ||
len > xs->umem->chunk_size_nohr) {
xs->rx_dropped++;