Skip to content
Commit 6903cdae authored by Gaurav Singh's avatar Gaurav Singh Committed by Daniel Borkmann
Browse files

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

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>
parent c34a06c5
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