Commit cc3628dc authored by Alexey Nepomnyashih's avatar Alexey Nepomnyashih Committed by Jakub Kicinski
Browse files

xen-netfront: handle NULL returned by xdp_convert_buff_to_frame()



The function xdp_convert_buff_to_frame() may return NULL if it fails
to correctly convert the XDP buffer into an XDP frame due to memory
constraints, internal errors, or invalid data. Failing to check for NULL
may lead to a NULL pointer dereference if the result is used later in
processing, potentially causing crashes, data corruption, or undefined
behavior.

On XDP redirect failure, the associated page must be released explicitly
if it was previously retained via get_page(). Failing to do so may result
in a memory leak, as the pages reference count is not decremented.

Cc: stable@vger.kernel.org # v5.9+
Fixes: 6c5aa6fc ("xen networking: add basic XDP support for xen-netfront")
Signed-off-by: default avatarAlexey Nepomnyashih <sdl@nppct.ru>
Link: https://patch.msgid.link/20250417122118.1009824-1-sdl@nppct.ru


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3a701202
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment