Skip to content
Commit 0063fe88 authored by Gaurav Singh's avatar Gaurav Singh Committed by Paul Gortmaker
Browse files

bpf, xdp, samples: Fix null pointer dereference in *_user code

commit 6903cdae upstream.

Memset on the pointer right after malloc can cause a NULL pointer
deference if it failed to allocate memory. A simple fix is to
replace malloc()/memset() pair with a simple call to calloc().

Fixes: 0fca931a

 ("samples/bpf: program demonstrating access to xdp_rxq_info")
Signed-off-by: default avatarGaurav Singh <gaurav1086@gmail.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 6127fb29
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment