diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-05-02 22:37:17 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-05-03 10:09:53 +0200 |
commit | 740831076cfcf2f73f3063fbb040c1ea593dfe6c (patch) | |
tree | 0e8de689a29e95914c40b3b5357235073b3376d3 | |
parent | shared: ignore invalid valink socket fd when deserializing (diff) | |
download | systemd-740831076cfcf2f73f3063fbb040c1ea593dfe6c.tar.xz systemd-740831076cfcf2f73f3063fbb040c1ea593dfe6c.zip |
shared: reject empty attachment path
-rw-r--r-- | src/shared/bpf-program.c | 3 | ||||
-rw-r--r-- | test/fuzz/fuzz-manager-serialize/crash-fc5f5254c946097a774cccec5427289b748e6f2a | 11 |
2 files changed, 14 insertions, 0 deletions
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 |