[ Upstream commit 34de8e6e0e1f66e431abf4123934a2581cb5f133 ]
When using bpftool to pin {PROG, MAP, LINK} without FILE,
segmentation fault will occur. The reson is that the lack
of FILE will cause strlen to trigger NULL pointer dereference.
The corresponding stacktrace is shown below:
do_pin
do_pin_any
do_pin_fd
mount_bpffs_for_pin
strlen(name) <- NULL pointer dereference
Fix it by adding validation to the common process.
Fixes:
|
||
|---|---|---|
| .. | ||
| Documentation | ||
| bash-completion | ||
| skeleton | ||
| .gitignore | ||
| Makefile | ||
| btf.c | ||
| btf_dumper.c | ||
| cfg.c | ||
| cfg.h | ||
| cgroup.c | ||
| common.c | ||
| feature.c | ||
| gen.c | ||
| iter.c | ||
| jit_disasm.c | ||
| json_writer.c | ||
| json_writer.h | ||
| link.c | ||
| main.c | ||
| main.h | ||
| map.c | ||
| map_perf_ring.c | ||
| net.c | ||
| netlink_dumper.c | ||
| netlink_dumper.h | ||
| perf.c | ||
| pids.c | ||
| prog.c | ||
| struct_ops.c | ||
| tracelog.c | ||
| xlated_dumper.c | ||
| xlated_dumper.h | ||