Skip to content

Commit

Permalink
xsk: re-add queue id check for XDP_SKB path
Browse files Browse the repository at this point in the history
Commit 173d3ad ("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: 173d3ad ("xsk: add zero-copy support for Rx")
Reported-by: Qi Zhang <[email protected]>
Signed-off-by: Björn Töpel <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
  • Loading branch information
Björn Töpel authored and borkmann committed Jun 12, 2018
1 parent 6892286 commit 5d90237
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/xdp/xsk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 5d90237

Please sign in to comment.