]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: reject empty attachment path 27504/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 2 May 2023 20:37:17 +0000 (22:37 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 3 May 2023 08:09:53 +0000 (10:09 +0200)
src/shared/bpf-program.c
test/fuzz/fuzz-manager-serialize/crash-fc5f5254c946097a774cccec5427289b748e6f2a [new file with mode: 0644]

index d5eb6f4ccbaa64347a0b4a09cffffd674f6b6df9..f4bb7f390c2eaa4220cd4076ba5adb7f985597ec 100644 (file)
@@ -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 (file)
index 0000000..9f15496
--- /dev/null
@@ -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