mirror of
https://github.com/torvalds/linux.git
synced 2026-10-25 16:45:02 +01:00
gve: fix XSK buffer leak on error descriptor
When the error bit is set in the RX completion descriptor, the buf_state
and its attached buffer should be freed. In the case of AF_XDP ZC, the
XSK buffer was not freed, leading to a leak.
This issue was caught by LLM.
Fixes: c1fffc5d66 ("gve: implement DQO RX datapath and control path for AF_XDP zero-copy")
Cc: stable@vger.kernel.org
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Reviewed-by: Tim Hostetler <thostet@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Link: https://patch.msgid.link/20260930214735.3288780-3-joshwash@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
73670ddb91
commit
9fed6a8ab8
|
|
@ -842,7 +842,12 @@ static int gve_rx_dqo(struct napi_struct *napi, struct gve_rx_ring *rx,
|
|||
}
|
||||
|
||||
if (unlikely(compl_desc->rx_error)) {
|
||||
gve_free_buffer(rx, buf_state);
|
||||
if (buf_state->xsk_buff) {
|
||||
xsk_buff_free(buf_state->xsk_buff);
|
||||
gve_free_buf_state(rx, buf_state);
|
||||
} else {
|
||||
gve_free_buffer(rx, buf_state);
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user