Skip to content

Commit 5d90237

Browse files
Björn Töpelborkmann
authored andcommitted
xsk: re-add queue id check for XDP_SKB path
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]>
1 parent 6892286 commit 5d90237

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/xdp/xsk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ int xsk_generic_rcv(struct xdp_sock *xs, struct xdp_buff *xdp)
118118
u64 addr;
119119
int err;
120120

121+
if (xs->dev != xdp->rxq->dev || xs->queue_id != xdp->rxq->queue_index)
122+
return -EINVAL;
123+
121124
if (!xskq_peek_addr(xs->umem->fq, &addr) ||
122125
len > xs->umem->chunk_size_nohr) {
123126
xs->rx_dropped++;

0 commit comments

Comments
 (0)