libbpf: Fix potential NULL pointer dereference
authorCiara Loftus <ciara.loftus@intel.com>
Thu, 8 Apr 2021 05:20:09 +0000 (05:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Apr 2021 11:00:56 +0000 (13:00 +0200)
commit7f8e59c4c5e5142e3f0d78f8f01b523027bbf151
tree7e6742b4b8ef9df03abfce6991738eed5e40d282
parent7824d5a9935a8093627565be4bade0bb112bd6d9
libbpf: Fix potential NULL pointer dereference

commit afd0be7299533bb2e2b09104399d8a467ecbd2c5 upstream.

Wait until after the UMEM is checked for null to dereference it.

Fixes: 43f1bc1efff1 ("libbpf: Restore umem state after socket create failure")
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210408052009.7844-1-ciara.loftus@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/lib/bpf/xsk.c