Skip to content
Snippets Groups Projects
Commit d909f9db authored by Gaurav Singh's avatar Gaurav Singh Committed by Sasha Levin
Browse files

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


[ Upstream commit 6903cdae ]

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 avatarSasha Levin <sashal@kernel.org>
parent 0608288c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment