From 740831076cfcf2f73f3063fbb040c1ea593dfe6c Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 2 May 2023 22:37:17 +0200 Subject: shared: reject empty attachment path --- src/shared/bpf-program.c | 3 +++ .../crash-fc5f5254c946097a774cccec5427289b748e6f2a | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/fuzz/fuzz-manager-serialize/crash-fc5f5254c946097a774cccec5427289b748e6f2a diff --git a/src/shared/bpf-program.c b/src/shared/bpf-program.c index d5eb6f4ccb..f4bb7f390c 100644 --- a/src/shared/bpf-program.c +++ b/src/shared/bpf-program.c @@ -467,6 +467,9 @@ int bpf_program_deserialize_attachment(const char *v, FDSet *fds, BPFProgram **b return at; /* The rest is the path */ + if (isempty(v)) + return -EINVAL; + l = cunescape(v, 0, &unescaped); if (l < 0) return l; diff --git a/test/fuzz/fuzz-manager-serialize/crash-fc5f5254c946097a774cccec5427289b748e6f2a b/test/fuzz/fuzz-manager-serialize/crash-fc5f5254c946097a774cccec5427289b748e6f2a new file mode 100644 index 0000000000..9f15496afe --- /dev/null +++ b/test/fuzz/fuzz-manager-serialize/crash-fc5f5254c946097a774cccec5427289b748e6f2a @@ -0,0 +1,11 @@ +curr :er +82967574637335/dprunning + +run-stedm\x2dsysctl.service.mount +s4002 +te-ewal=0 +stat25 0 +ip-bpf-egress-installed=1651 4116038 +condi/dpad-nriv-j0 +userspmath-pci\x2d0000:00:01.1\x2d0 +ip-bpf-egress-installed=1651 recvmsg6 -- cgit v1.2.1