libbpf: Ensure umem pointer is non-NULL before dereferencing
authorCiara Loftus <ciara.loftus@intel.com>
Wed, 31 Mar 2021 06:12:16 +0000 (06:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:42:00 +0000 (08:42 +0200)
commit5aa7df172207e2b927803ec27a0e1aee5ac45eda
tree75788302b409d0122a90d60c4931c34ca8b25d4a
parentb52e88638f7105ca6921eff9970a5ad261b1a1bf
libbpf: Ensure umem pointer is non-NULL before dereferencing

commit df662016310aa4475d7986fd726af45c8fe4f362 upstream.

Calls to xsk_socket__create dereference the umem to access the
fill_save and comp_save pointers. Make sure the umem is non-NULL
before doing this.

Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices")
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20210331061218.1647-2-ciara.loftus@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/lib/bpf/xsk.c