Skip to content
Commit fcd30ae0 authored by Jonathan Lemon's avatar Jonathan Lemon Committed by Daniel Borkmann
Browse files

bpf/xskmap: Return ERR_PTR for failure case instead of NULL.



When kzalloc() failed, NULL was returned to the caller, which
tested the pointer with IS_ERR(), which didn't match, so the
pointer was used later, resulting in a NULL dereference.

Return ERR_PTR(-ENOMEM) instead of NULL.

Reported-by: default avatar <syzbot+491c1b7565ba9069ecae@syzkaller.appspotmail.com>
Fixes: 0402acd6 ("xsk: remove AF_XDP socket from map when the socket is released")
Signed-off-by: default avatarJonathan Lemon <jonathan.lemon@gmail.com>
Acked-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 8a03222f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment