From cfc01ef75ec461e6bbf6179bc7ed48cd93c6da35 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Dec 15 2020 09:45:33 +0000 Subject: fuzz: rename "fuzz-corpus" directory to just "fuzz" Also, all corpus subdirectories are named exactly the same as the fuzzer they are for. This makes the paths a bit longer, but easier. (cherry picked from commit 93b575b26605c347a717b2aa24ddf9cad08b8080) Resolves: #1696224 patch_name: 0151-fuzz-rename-fuzz-corpus-directory-to-just-fuzz.patch present_in_specfile: true location_in_specfile: 151 squash_commits: true --- diff --git a/test/fuzz-corpus/.gitattributes b/test/fuzz-corpus/.gitattributes deleted file mode 100644 index 7b1b3e1..0000000 --- a/test/fuzz-corpus/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -/*/* -whitespace diff --git a/test/fuzz-corpus/dhcp-server/discover-existing b/test/fuzz-corpus/dhcp-server/discover-existing deleted file mode 100644 index 1e26bf0..0000000 Binary files a/test/fuzz-corpus/dhcp-server/discover-existing and /dev/null differ diff --git a/test/fuzz-corpus/dhcp-server/discover-new b/test/fuzz-corpus/dhcp-server/discover-new deleted file mode 100644 index feeae55..0000000 Binary files a/test/fuzz-corpus/dhcp-server/discover-new and /dev/null differ diff --git a/test/fuzz-corpus/dhcp-server/release b/test/fuzz-corpus/dhcp-server/release deleted file mode 100644 index 4f3eadb..0000000 Binary files a/test/fuzz-corpus/dhcp-server/release and /dev/null differ diff --git a/test/fuzz-corpus/dhcp-server/request-existing b/test/fuzz-corpus/dhcp-server/request-existing deleted file mode 100644 index 9f7a0d8..0000000 Binary files a/test/fuzz-corpus/dhcp-server/request-existing and /dev/null differ diff --git a/test/fuzz-corpus/dhcp-server/request-new b/test/fuzz-corpus/dhcp-server/request-new deleted file mode 100644 index fc6f586..0000000 Binary files a/test/fuzz-corpus/dhcp-server/request-new and /dev/null differ diff --git a/test/fuzz-corpus/dhcp-server/request-reboot b/test/fuzz-corpus/dhcp-server/request-reboot deleted file mode 100644 index fde74b2..0000000 Binary files a/test/fuzz-corpus/dhcp-server/request-reboot and /dev/null differ diff --git a/test/fuzz-corpus/dhcp-server/request-renew b/test/fuzz-corpus/dhcp-server/request-renew deleted file mode 100644 index 8dcda2a..0000000 Binary files a/test/fuzz-corpus/dhcp-server/request-renew and /dev/null differ diff --git a/test/fuzz-corpus/journal-remote/invalid-ts.txt b/test/fuzz-corpus/journal-remote/invalid-ts.txt deleted file mode 100644 index bc036fd..0000000 Binary files a/test/fuzz-corpus/journal-remote/invalid-ts.txt and /dev/null differ diff --git a/test/fuzz-corpus/journal-remote/sample.txt b/test/fuzz-corpus/journal-remote/sample.txt deleted file mode 100644 index 891c000..0000000 --- a/test/fuzz-corpus/journal-remote/sample.txt +++ /dev/null @@ -1,180 +0,0 @@ -__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12d7;t=4fd05c -__REALTIME_TIMESTAMP=1404101101501873 -__MONOTONIC_TIMESTAMP=1753961140951 -_BOOT_ID=f446871715504074bf7049ef0718fa93 -_TRANSPORT=syslog -PRIORITY=3 -SYSLOG_FACILITY=6 -SYSLOG_IDENTIFIER=/USR/SBIN/CRON -MESSAGE=\x1b\r"\x9a\xea]\x90rU\xb0SX5\nY\xebi\xdac\x1f\xde\xb4\xf6\x0e\x8d/!\xd0\x9a\xe8\x8b\xc3#hN\xf4\x9c\x8e\xc5\x92>\xaa\xf8Ih\x13\xd2\xbbOa\xedK\x04\xa449\xf3f\x9e\xfc=\xc9\xc1\x0fe\xb4\xf96\xd5z\xcfQ\xcb\xb1\xb4\xe48\xb3\x9f\x1b -_UID=0 -_GID=0 -_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 -_HOSTNAME=hostname -SYSLOG_PID=25721 -_PID=25721 -_SOURCE_REALTIME_TIMESTAMP=1404101101483516 -DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000000 - -__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12d8;t=4fd05c -__REALTIME_TIMESTAMP=1404101101501874 -__MONOTONIC_TIMESTAMP=1753961140952 -_BOOT_ID=f446871715504074bf7049ef0718fa93 -_TRANSPORT=syslog -PRIORITY=3 -SYSLOG_FACILITY=6 -SYSLOG_IDENTIFIER=/USR/SBIN/CRON -MESSAGE=l\x1a\xf4^\xb1\x14\xfb@\r\xa1\x11\xda0\xe0]3Ms$\x7f06\xde\xd9\x02y\xf9@\n\xe8\x01\x83\xcb\xe0)\xed\x98*>\xa1\xc2Y\xe8IR\x95h\xa1\xbb\x16\xba\xedK\x11\xfcj\x04\xfb\x0b\x9b)p\x10\xecH\x1f\x0b\x89{\xeb'\x0e\x1d\xaa\xcbZ\x86\xe0k1 -_UID=0 -_GID=0 -_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 -_HOSTNAME=hostname -SYSLOG_PID=25721 -_PID=25721 -_SOURCE_REALTIME_TIMESTAMP=1404101101483517 -DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000001 - -__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12d9;t=4fd05c -__REALTIME_TIMESTAMP=1404101101501875 -__MONOTONIC_TIMESTAMP=1753961140953 -_BOOT_ID=f446871715504074bf7049ef0718fa93 -_TRANSPORT=syslog -PRIORITY=3 -SYSLOG_FACILITY=6 -SYSLOG_IDENTIFIER=/USR/SBIN/CRON -MESSAGE=MzV_\xbb\xc1\x14f\x84\x15\xf5\xe0\xe6\xd2\x0e6#N\xf1\x1b\xe9Z*\x8f\x8a\x13\xad\xa4%r\x02\xd1\xc4^U\xc0u!\xdfjl\x15\xb6\xcc\x93\x1dRi<\x1a\xa9/\x9c\xcb\xe8\x99\xe3\x1cN\x06\xf0\xb41a\xa7L\x99\xda\x83Q: ]\x1c\xb9Hiz\n\x94 -_UID=0 -_GID=0 -_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 -_HOSTNAME=hostname -SYSLOG_PID=25721 -_PID=25721 -_SOURCE_REALTIME_TIMESTAMP=1404101101483518 -DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000002 - -__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12da;t=4fd05c -__REALTIME_TIMESTAMP=1404101101501876 -__MONOTONIC_TIMESTAMP=1753961140954 -_BOOT_ID=f446871715504074bf7049ef0718fa93 -_TRANSPORT=syslog -PRIORITY=3 -SYSLOG_FACILITY=6 -SYSLOG_IDENTIFIER=/USR/SBIN/CRON -MESSAGE=\x8aF\xfcG\xd7\xeeZ\x86\xcb.O\xb1!,2\xbf\x86\\&\x15\xa7\xe6\xe7-\x81\xed\xf8\x7f=\xf7\x90YF\xe1\xe6\x99\x83\x84\r\xe48\x93\xc7\xdd\tJy\x86\\\xb4\xf9\xefT\r\x04\xae\x1d\x99\xfe'\x99m\xc4#\x8d\x89w\xb1\xecC\xaf\xe6\x1b\xfd\xc5\xbc\xfd\xe3w2 -_UID=0 -_GID=0 -_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 -_HOSTNAME=hostname -SYSLOG_PID=25721 -_PID=25721 -_SOURCE_REALTIME_TIMESTAMP=1404101101483519 -DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000003 - -__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12db;t=4fd05c -__REALTIME_TIMESTAMP=1404101101501877 -__MONOTONIC_TIMESTAMP=1753961140955 -_BOOT_ID=f446871715504074bf7049ef0718fa93 -_TRANSPORT=syslog -PRIORITY=3 -SYSLOG_FACILITY=6 -SYSLOG_IDENTIFIER=/USR/SBIN/CRON -MESSAGE=`\xc7\r\xb6\xc3NPjc\xa129L\xe1\x17\xa2\x96\xa8w\x0c\x07\x8f\x98\x1eS-N\xb7lt\xc5=\xd1\x93\x10_1\xdc\xa9x\xd1\x8a\n\xb1\x90\xdca\xc4\x94\x98\x92\x00\x90)d{\x96\x9e\xc2A\xbf\x81s\xf82_\xe0;\xc3\x06\x8eO\xe4\x8a5GX\xe1\xff\xea -_UID=0 -_GID=0 -_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 -_HOSTNAME=hostname -SYSLOG_PID=25721 -_PID=25721 -_SOURCE_REALTIME_TIMESTAMP=1404101101483520 -DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000004 - -__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12dc;t=4fd05c -__REALTIME_TIMESTAMP=1404101101501878 -__MONOTONIC_TIMESTAMP=1753961140956 -_BOOT_ID=f446871715504074bf7049ef0718fa93 -_TRANSPORT=syslog -PRIORITY=3 -SYSLOG_FACILITY=6 -SYSLOG_IDENTIFIER=/USR/SBIN/CRON -MESSAGE=\r\t \xdf-\xed\xd5\xde\xa1/\xa5T\x1a\xdd\xf9a\xe2\x8b()\xd5\xf2\x1b\xbcu~\xaa\x97\xc7~\x0e~2\x11\xa0\xb5\xd3\xd7^ \xea\x16\x02{\xd1\xbe\xa02\xad\x00\xba$\xf2\xd5\x7f\x9a\xf0\xf9\xf2\x14\xf0/\xb5\xd3"`\xd8\x8e\xb6w\x1bP\x96\xf1\x0c\xf0#\xd2\x12\x88 -_UID=0 -_GID=0 -_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 -_HOSTNAME=hostname -SYSLOG_PID=25721 -_PID=25721 -_SOURCE_REALTIME_TIMESTAMP=1404101101483521 -DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000005 - -__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12dd;t=4fd05c -__REALTIME_TIMESTAMP=1404101101501879 -__MONOTONIC_TIMESTAMP=1753961140957 -_BOOT_ID=f446871715504074bf7049ef0718fa93 -_TRANSPORT=syslog -PRIORITY=3 -SYSLOG_FACILITY=6 -SYSLOG_IDENTIFIER=/USR/SBIN/CRON -MESSAGE=\x1a\x15\xd3\x8d\x98\x83m\xe2\x02\xfa\x81\x98\xef\xa2\x8a\xcc\x10\xc5=q=\xd0\xd7_\x0e\x92D\xb1\xc7 \xaa\xae-\x18\xff\xb0 /lib/systemd/system/rsyslog.service -# /etc/systemd/system/syslog.service -> /lib/systemd/system/syslog-ng.service -# -# Best way to achieve that is by adding this to your unit file -# (i.e. to rsyslog.service or syslog-ng.service): -# -# [Install] -# Alias=syslog.service -# -# See https://www.freedesktop.org/wiki/Software/systemd/syslog for details. - -[Socket] -ListenStream=1.2.3.4:1234 -ListenDatagram=1.2.3.4:1234 -ListenSequentialPacket=1.2.3.4:1234 -ListenFIFO= -ListenSpecial= -#ListenNetlink= -ListenMessageQueue= -ListenUSBFunction= -SocketProtocol=udplite -SocketProtocol=sctp -SocketProtocol= -BindIPv6Only=false -Backlog=33 -BindToDevice=eth0 -SocketUser=daemon -SocketGroup=nobody -SocketMode=0111 -DirectoryMode=0555 -Accept=true -Accept=false -Writable=true -MaxConnections=11 -MaxConnectionsPerSource=12 -KeepAlive=yes -KeepAliveTimeSec=12345 -KeepAliveIntervalSec=12345 -KeepAliveProbes=12345 -NoDelay=true -Priority=0 -DeferAcceptSec=1 -ReceiveBuffer=1G -SendBuffer=1G -IPTOS=low-delay -IPTOS=throughput -IPTOS=reliability -IPTOS=low-cost -IPTOS= -IPTTL=7 -Mark=123 -ReusePort=true -SmackLabel=smack-label -SmackLabelIPIn=smack-label -SmackLabelIPOut=no idea what to put here -SELinuxContextFromNet=true -PipeSize=11111 -MessageQueueMaxMessages=200 -MessageQueueMessageSize=200 -FreeBind=false -Transparent=true -Broadcast=true -PassCredentials=true -PassSecurity=true -TCPCongestion=westwood -TCPCongestion=veno -TCPCongestion=cubic -TCPCongestion=lp -ExecStartPre=/bin/true "arg ' ' " -ExecStartPost=-!!/bin/false -ExecStopPre=/bin/true -ExecStopPost=-!!/bin/false -TimeoutSec=2343 -Symlinks=a b c d e -Symlinks= -Symlinks=/a /b /c /d /e -FileDescriptorName=name -TriggerLimitIntervalSec=2343 -TriggerLimitBurst=234 diff --git a/test/fuzz-corpus/unit-file/systemd-ask-password-console.path b/test/fuzz-corpus/unit-file/systemd-ask-password-console.path deleted file mode 100644 index 3e12c75..0000000 --- a/test/fuzz-corpus/unit-file/systemd-ask-password-console.path +++ /dev/null @@ -1,22 +0,0 @@ -path -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Dispatch Password Requests to Console Directory Watch -Documentation=man:systemd-ask-password-console.service(8) -DefaultDependencies=no -Conflicts=shutdown.target -After=plymouth-start.service -Before=paths.target shutdown.target cryptsetup.target -ConditionPathExists=!/run/plymouth/pid - -[Path] -DirectoryNotEmpty=/run/systemd/ask-password -MakeDirectory=yes diff --git a/test/fuzz-corpus/unit-file/systemd-machined.service b/test/fuzz-corpus/unit-file/systemd-machined.service deleted file mode 100644 index 448f062..0000000 --- a/test/fuzz-corpus/unit-file/systemd-machined.service +++ /dev/null @@ -1,34 +0,0 @@ -service -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Virtual Machine and Container Registration Service -Documentation=man:systemd-machined.service(8) -Documentation=https://www.freedesktop.org/wiki/Software/systemd/machined -Wants=machine.slice -After=machine.slice -RequiresMountsFor=/var/lib/machines - -[Service] -ExecStart=/usr/lib/systemd/systemd-machined -BusName=org.freedesktop.machine1 -WatchdogSec=3min -CapabilityBoundingSet=CAP_KILL CAP_SYS_PTRACE CAP_SYS_ADMIN CAP_SETGID CAP_SYS_CHROOT CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_CHOWN CAP_FOWNER CAP_FSETID CAP_MKNOD -MemoryDenyWriteExecute=yes -RestrictRealtime=yes -RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 -SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @obsolete @raw-io @reboot @swap -SystemCallArchitectures=native -LockPersonality=yes -IPAddressDeny=any - -# Note that machined cannot be placed in a mount namespace, since it -# needs access to the host's mount namespace in order to implement the -# "machinectl bind" operation. diff --git a/test/fuzz-corpus/unit-file/systemd-resolved.service b/test/fuzz-corpus/unit-file/systemd-resolved.service deleted file mode 100644 index 0854c5f..0000000 --- a/test/fuzz-corpus/unit-file/systemd-resolved.service +++ /dev/null @@ -1,50 +0,0 @@ -service -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Network Name Resolution -Documentation=man:systemd-resolved.service(8) -Documentation=https://www.freedesktop.org/wiki/Software/systemd/resolved -Documentation=https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers -Documentation=https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients -DefaultDependencies=no -After=systemd-sysusers.service systemd-networkd.service -Before=network.target nss-lookup.target shutdown.target -Conflicts=shutdown.target -Wants=nss-lookup.target - -[Service] -Type=notify -Restart=always -RestartSec=0 -ExecStart=!!/usr/lib/systemd/systemd-resolved -WatchdogSec=3min -User=systemd-resolve -CapabilityBoundingSet=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE -AmbientCapabilities=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE -PrivateTmp=yes -PrivateDevices=yes -ProtectSystem=strict -ProtectHome=yes -ProtectControlGroups=yes -ProtectKernelTunables=yes -ProtectKernelModules=yes -MemoryDenyWriteExecute=yes -RestrictRealtime=yes -RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 -SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io @reboot @swap -SystemCallArchitectures=native -LockPersonality=yes -RuntimeDirectory=systemd/resolve -RuntimeDirectoryPreserve=yes - -[Install] -WantedBy=multi-user.target -Alias=dbus-org.freedesktop.resolve1.service diff --git a/test/fuzz-corpus/unit-file/systemd-tmpfiles-clean.timer b/test/fuzz-corpus/unit-file/systemd-tmpfiles-clean.timer deleted file mode 100644 index 7db361c..0000000 --- a/test/fuzz-corpus/unit-file/systemd-tmpfiles-clean.timer +++ /dev/null @@ -1,40 +0,0 @@ -timer -# SPDX-License-Identifier: LGPL-2.1+ -[Unit] -Description=Daily Cleanup of Temporary Directories -Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) - -[Timer] -OnBootSec=15min -OnUnitActiveSec=1d -OnBootSec=1s -OnStartupSec=234 -OnUnitActiveSec=2y -OnUnitInactiveSec=23434 -OnCalendar=minutely -OnCalendar=*-*-* *:*:00 -OnCalendar=hourly -OnCalendar=*-*-* *:00:00 -OnCalendar=daily -OnCalendar=*-*-* 00:00:00 -OnCalendar=monthly -OnCalendar=*-*-01 00:00:00 -OnCalendar=weekly -OnCalendar=Mon *-*-* 00:00:00 -OnCalendar=yearly -OnCalendar=*-01-01 00:00:00 -OnCalendar=quarterly -OnCalendar=*-01,04,07,10-01 00:00:00 -OnCalendar=semiannually -OnCalendar=*-01,07-01 00:00:00 -OnCalendar=Fri 2012-11-23 11:12:13 - -Persistent=true -AccuracySec=24h -RandomizedDelaySec=234234234 - -Persistent=no -Unit=foo.service - -WakeSystem=false -RemainAfterElapse=true diff --git a/test/fuzz-corpus/unit-file/timers.target b/test/fuzz-corpus/unit-file/timers.target deleted file mode 100644 index 171226c..0000000 --- a/test/fuzz-corpus/unit-file/timers.target +++ /dev/null @@ -1,16 +0,0 @@ -target -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Timers -Documentation=man:systemd.special(7) - -DefaultDependencies=no -Conflicts=shutdown.target diff --git a/test/fuzz-corpus/unit-file/var-lib-machines.mount b/test/fuzz-corpus/unit-file/var-lib-machines.mount deleted file mode 100644 index 9c257d1..0000000 --- a/test/fuzz-corpus/unit-file/var-lib-machines.mount +++ /dev/null @@ -1,19 +0,0 @@ -mount -# SPDX-License-Identifier: LGPL-2.1+ -# -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=Virtual Machine and Container Storage -ConditionPathExists=/var/lib/machines.raw - -[Mount] -What=/var/lib/machines.raw -Where=/var/lib/machines -Type=btrfs -Options=loop diff --git a/test/fuzz/.gitattributes b/test/fuzz/.gitattributes new file mode 100644 index 0000000..7b1b3e1 --- /dev/null +++ b/test/fuzz/.gitattributes @@ -0,0 +1 @@ +/*/* -whitespace diff --git a/test/fuzz/fuzz-dhcp-server/discover-existing b/test/fuzz/fuzz-dhcp-server/discover-existing new file mode 100644 index 0000000..1e26bf0 Binary files /dev/null and b/test/fuzz/fuzz-dhcp-server/discover-existing differ diff --git a/test/fuzz/fuzz-dhcp-server/discover-new b/test/fuzz/fuzz-dhcp-server/discover-new new file mode 100644 index 0000000..feeae55 Binary files /dev/null and b/test/fuzz/fuzz-dhcp-server/discover-new differ diff --git a/test/fuzz/fuzz-dhcp-server/release b/test/fuzz/fuzz-dhcp-server/release new file mode 100644 index 0000000..4f3eadb Binary files /dev/null and b/test/fuzz/fuzz-dhcp-server/release differ diff --git a/test/fuzz/fuzz-dhcp-server/request-existing b/test/fuzz/fuzz-dhcp-server/request-existing new file mode 100644 index 0000000..9f7a0d8 Binary files /dev/null and b/test/fuzz/fuzz-dhcp-server/request-existing differ diff --git a/test/fuzz/fuzz-dhcp-server/request-new b/test/fuzz/fuzz-dhcp-server/request-new new file mode 100644 index 0000000..fc6f586 Binary files /dev/null and b/test/fuzz/fuzz-dhcp-server/request-new differ diff --git a/test/fuzz/fuzz-dhcp-server/request-reboot b/test/fuzz/fuzz-dhcp-server/request-reboot new file mode 100644 index 0000000..fde74b2 Binary files /dev/null and b/test/fuzz/fuzz-dhcp-server/request-reboot differ diff --git a/test/fuzz/fuzz-dhcp-server/request-renew b/test/fuzz/fuzz-dhcp-server/request-renew new file mode 100644 index 0000000..8dcda2a Binary files /dev/null and b/test/fuzz/fuzz-dhcp-server/request-renew differ diff --git a/test/fuzz/fuzz-journal-remote/invalid-ts.txt b/test/fuzz/fuzz-journal-remote/invalid-ts.txt new file mode 100644 index 0000000..bc036fd Binary files /dev/null and b/test/fuzz/fuzz-journal-remote/invalid-ts.txt differ diff --git a/test/fuzz/fuzz-journal-remote/sample.txt b/test/fuzz/fuzz-journal-remote/sample.txt new file mode 100644 index 0000000..891c000 --- /dev/null +++ b/test/fuzz/fuzz-journal-remote/sample.txt @@ -0,0 +1,180 @@ +__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12d7;t=4fd05c +__REALTIME_TIMESTAMP=1404101101501873 +__MONOTONIC_TIMESTAMP=1753961140951 +_BOOT_ID=f446871715504074bf7049ef0718fa93 +_TRANSPORT=syslog +PRIORITY=3 +SYSLOG_FACILITY=6 +SYSLOG_IDENTIFIER=/USR/SBIN/CRON +MESSAGE=\x1b\r"\x9a\xea]\x90rU\xb0SX5\nY\xebi\xdac\x1f\xde\xb4\xf6\x0e\x8d/!\xd0\x9a\xe8\x8b\xc3#hN\xf4\x9c\x8e\xc5\x92>\xaa\xf8Ih\x13\xd2\xbbOa\xedK\x04\xa449\xf3f\x9e\xfc=\xc9\xc1\x0fe\xb4\xf96\xd5z\xcfQ\xcb\xb1\xb4\xe48\xb3\x9f\x1b +_UID=0 +_GID=0 +_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 +_HOSTNAME=hostname +SYSLOG_PID=25721 +_PID=25721 +_SOURCE_REALTIME_TIMESTAMP=1404101101483516 +DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000000 + +__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12d8;t=4fd05c +__REALTIME_TIMESTAMP=1404101101501874 +__MONOTONIC_TIMESTAMP=1753961140952 +_BOOT_ID=f446871715504074bf7049ef0718fa93 +_TRANSPORT=syslog +PRIORITY=3 +SYSLOG_FACILITY=6 +SYSLOG_IDENTIFIER=/USR/SBIN/CRON +MESSAGE=l\x1a\xf4^\xb1\x14\xfb@\r\xa1\x11\xda0\xe0]3Ms$\x7f06\xde\xd9\x02y\xf9@\n\xe8\x01\x83\xcb\xe0)\xed\x98*>\xa1\xc2Y\xe8IR\x95h\xa1\xbb\x16\xba\xedK\x11\xfcj\x04\xfb\x0b\x9b)p\x10\xecH\x1f\x0b\x89{\xeb'\x0e\x1d\xaa\xcbZ\x86\xe0k1 +_UID=0 +_GID=0 +_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 +_HOSTNAME=hostname +SYSLOG_PID=25721 +_PID=25721 +_SOURCE_REALTIME_TIMESTAMP=1404101101483517 +DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000001 + +__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12d9;t=4fd05c +__REALTIME_TIMESTAMP=1404101101501875 +__MONOTONIC_TIMESTAMP=1753961140953 +_BOOT_ID=f446871715504074bf7049ef0718fa93 +_TRANSPORT=syslog +PRIORITY=3 +SYSLOG_FACILITY=6 +SYSLOG_IDENTIFIER=/USR/SBIN/CRON +MESSAGE=MzV_\xbb\xc1\x14f\x84\x15\xf5\xe0\xe6\xd2\x0e6#N\xf1\x1b\xe9Z*\x8f\x8a\x13\xad\xa4%r\x02\xd1\xc4^U\xc0u!\xdfjl\x15\xb6\xcc\x93\x1dRi<\x1a\xa9/\x9c\xcb\xe8\x99\xe3\x1cN\x06\xf0\xb41a\xa7L\x99\xda\x83Q: ]\x1c\xb9Hiz\n\x94 +_UID=0 +_GID=0 +_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 +_HOSTNAME=hostname +SYSLOG_PID=25721 +_PID=25721 +_SOURCE_REALTIME_TIMESTAMP=1404101101483518 +DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000002 + +__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12da;t=4fd05c +__REALTIME_TIMESTAMP=1404101101501876 +__MONOTONIC_TIMESTAMP=1753961140954 +_BOOT_ID=f446871715504074bf7049ef0718fa93 +_TRANSPORT=syslog +PRIORITY=3 +SYSLOG_FACILITY=6 +SYSLOG_IDENTIFIER=/USR/SBIN/CRON +MESSAGE=\x8aF\xfcG\xd7\xeeZ\x86\xcb.O\xb1!,2\xbf\x86\\&\x15\xa7\xe6\xe7-\x81\xed\xf8\x7f=\xf7\x90YF\xe1\xe6\x99\x83\x84\r\xe48\x93\xc7\xdd\tJy\x86\\\xb4\xf9\xefT\r\x04\xae\x1d\x99\xfe'\x99m\xc4#\x8d\x89w\xb1\xecC\xaf\xe6\x1b\xfd\xc5\xbc\xfd\xe3w2 +_UID=0 +_GID=0 +_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 +_HOSTNAME=hostname +SYSLOG_PID=25721 +_PID=25721 +_SOURCE_REALTIME_TIMESTAMP=1404101101483519 +DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000003 + +__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12db;t=4fd05c +__REALTIME_TIMESTAMP=1404101101501877 +__MONOTONIC_TIMESTAMP=1753961140955 +_BOOT_ID=f446871715504074bf7049ef0718fa93 +_TRANSPORT=syslog +PRIORITY=3 +SYSLOG_FACILITY=6 +SYSLOG_IDENTIFIER=/USR/SBIN/CRON +MESSAGE=`\xc7\r\xb6\xc3NPjc\xa129L\xe1\x17\xa2\x96\xa8w\x0c\x07\x8f\x98\x1eS-N\xb7lt\xc5=\xd1\x93\x10_1\xdc\xa9x\xd1\x8a\n\xb1\x90\xdca\xc4\x94\x98\x92\x00\x90)d{\x96\x9e\xc2A\xbf\x81s\xf82_\xe0;\xc3\x06\x8eO\xe4\x8a5GX\xe1\xff\xea +_UID=0 +_GID=0 +_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 +_HOSTNAME=hostname +SYSLOG_PID=25721 +_PID=25721 +_SOURCE_REALTIME_TIMESTAMP=1404101101483520 +DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000004 + +__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12dc;t=4fd05c +__REALTIME_TIMESTAMP=1404101101501878 +__MONOTONIC_TIMESTAMP=1753961140956 +_BOOT_ID=f446871715504074bf7049ef0718fa93 +_TRANSPORT=syslog +PRIORITY=3 +SYSLOG_FACILITY=6 +SYSLOG_IDENTIFIER=/USR/SBIN/CRON +MESSAGE=\r\t \xdf-\xed\xd5\xde\xa1/\xa5T\x1a\xdd\xf9a\xe2\x8b()\xd5\xf2\x1b\xbcu~\xaa\x97\xc7~\x0e~2\x11\xa0\xb5\xd3\xd7^ \xea\x16\x02{\xd1\xbe\xa02\xad\x00\xba$\xf2\xd5\x7f\x9a\xf0\xf9\xf2\x14\xf0/\xb5\xd3"`\xd8\x8e\xb6w\x1bP\x96\xf1\x0c\xf0#\xd2\x12\x88 +_UID=0 +_GID=0 +_MACHINE_ID=69121ca41d12c1b69a7960174c27b618 +_HOSTNAME=hostname +SYSLOG_PID=25721 +_PID=25721 +_SOURCE_REALTIME_TIMESTAMP=1404101101483521 +DATA=00000000000000000000000000000000000000000000000000000000000000000000000000000005 + +__CURSOR=s=6863c726210b4560b7048889d8ada5c5;i=3e931;b=f446871715504074bf7049ef0718fa93;m=198603b12dd;t=4fd05c +__REALTIME_TIMESTAMP=1404101101501879 +__MONOTONIC_TIMESTAMP=1753961140957 +_BOOT_ID=f446871715504074bf7049ef0718fa93 +_TRANSPORT=syslog +PRIORITY=3 +SYSLOG_FACILITY=6 +SYSLOG_IDENTIFIER=/USR/SBIN/CRON +MESSAGE=\x1a\x15\xd3\x8d\x98\x83m\xe2\x02\xfa\x81\x98\xef\xa2\x8a\xcc\x10\xc5=q=\xd0\xd7_\x0e\x92D\xb1\xc7 \xaa\xae-\x18\xff\xb0 /lib/systemd/system/rsyslog.service +# /etc/systemd/system/syslog.service -> /lib/systemd/system/syslog-ng.service +# +# Best way to achieve that is by adding this to your unit file +# (i.e. to rsyslog.service or syslog-ng.service): +# +# [Install] +# Alias=syslog.service +# +# See https://www.freedesktop.org/wiki/Software/systemd/syslog for details. + +[Socket] +ListenStream=1.2.3.4:1234 +ListenDatagram=1.2.3.4:1234 +ListenSequentialPacket=1.2.3.4:1234 +ListenFIFO= +ListenSpecial= +#ListenNetlink= +ListenMessageQueue= +ListenUSBFunction= +SocketProtocol=udplite +SocketProtocol=sctp +SocketProtocol= +BindIPv6Only=false +Backlog=33 +BindToDevice=eth0 +SocketUser=daemon +SocketGroup=nobody +SocketMode=0111 +DirectoryMode=0555 +Accept=true +Accept=false +Writable=true +MaxConnections=11 +MaxConnectionsPerSource=12 +KeepAlive=yes +KeepAliveTimeSec=12345 +KeepAliveIntervalSec=12345 +KeepAliveProbes=12345 +NoDelay=true +Priority=0 +DeferAcceptSec=1 +ReceiveBuffer=1G +SendBuffer=1G +IPTOS=low-delay +IPTOS=throughput +IPTOS=reliability +IPTOS=low-cost +IPTOS= +IPTTL=7 +Mark=123 +ReusePort=true +SmackLabel=smack-label +SmackLabelIPIn=smack-label +SmackLabelIPOut=no idea what to put here +SELinuxContextFromNet=true +PipeSize=11111 +MessageQueueMaxMessages=200 +MessageQueueMessageSize=200 +FreeBind=false +Transparent=true +Broadcast=true +PassCredentials=true +PassSecurity=true +TCPCongestion=westwood +TCPCongestion=veno +TCPCongestion=cubic +TCPCongestion=lp +ExecStartPre=/bin/true "arg ' ' " +ExecStartPost=-!!/bin/false +ExecStopPre=/bin/true +ExecStopPost=-!!/bin/false +TimeoutSec=2343 +Symlinks=a b c d e +Symlinks= +Symlinks=/a /b /c /d /e +FileDescriptorName=name +TriggerLimitIntervalSec=2343 +TriggerLimitBurst=234 diff --git a/test/fuzz/fuzz-unit-file/systemd-ask-password-console.path b/test/fuzz/fuzz-unit-file/systemd-ask-password-console.path new file mode 100644 index 0000000..3e12c75 --- /dev/null +++ b/test/fuzz/fuzz-unit-file/systemd-ask-password-console.path @@ -0,0 +1,22 @@ +path +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Dispatch Password Requests to Console Directory Watch +Documentation=man:systemd-ask-password-console.service(8) +DefaultDependencies=no +Conflicts=shutdown.target +After=plymouth-start.service +Before=paths.target shutdown.target cryptsetup.target +ConditionPathExists=!/run/plymouth/pid + +[Path] +DirectoryNotEmpty=/run/systemd/ask-password +MakeDirectory=yes diff --git a/test/fuzz/fuzz-unit-file/systemd-machined.service b/test/fuzz/fuzz-unit-file/systemd-machined.service new file mode 100644 index 0000000..448f062 --- /dev/null +++ b/test/fuzz/fuzz-unit-file/systemd-machined.service @@ -0,0 +1,34 @@ +service +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Virtual Machine and Container Registration Service +Documentation=man:systemd-machined.service(8) +Documentation=https://www.freedesktop.org/wiki/Software/systemd/machined +Wants=machine.slice +After=machine.slice +RequiresMountsFor=/var/lib/machines + +[Service] +ExecStart=/usr/lib/systemd/systemd-machined +BusName=org.freedesktop.machine1 +WatchdogSec=3min +CapabilityBoundingSet=CAP_KILL CAP_SYS_PTRACE CAP_SYS_ADMIN CAP_SETGID CAP_SYS_CHROOT CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_CHOWN CAP_FOWNER CAP_FSETID CAP_MKNOD +MemoryDenyWriteExecute=yes +RestrictRealtime=yes +RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 +SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @obsolete @raw-io @reboot @swap +SystemCallArchitectures=native +LockPersonality=yes +IPAddressDeny=any + +# Note that machined cannot be placed in a mount namespace, since it +# needs access to the host's mount namespace in order to implement the +# "machinectl bind" operation. diff --git a/test/fuzz/fuzz-unit-file/systemd-resolved.service b/test/fuzz/fuzz-unit-file/systemd-resolved.service new file mode 100644 index 0000000..0854c5f --- /dev/null +++ b/test/fuzz/fuzz-unit-file/systemd-resolved.service @@ -0,0 +1,50 @@ +service +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Network Name Resolution +Documentation=man:systemd-resolved.service(8) +Documentation=https://www.freedesktop.org/wiki/Software/systemd/resolved +Documentation=https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers +Documentation=https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients +DefaultDependencies=no +After=systemd-sysusers.service systemd-networkd.service +Before=network.target nss-lookup.target shutdown.target +Conflicts=shutdown.target +Wants=nss-lookup.target + +[Service] +Type=notify +Restart=always +RestartSec=0 +ExecStart=!!/usr/lib/systemd/systemd-resolved +WatchdogSec=3min +User=systemd-resolve +CapabilityBoundingSet=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_SETPCAP CAP_NET_RAW CAP_NET_BIND_SERVICE +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=strict +ProtectHome=yes +ProtectControlGroups=yes +ProtectKernelTunables=yes +ProtectKernelModules=yes +MemoryDenyWriteExecute=yes +RestrictRealtime=yes +RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 +SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @raw-io @reboot @swap +SystemCallArchitectures=native +LockPersonality=yes +RuntimeDirectory=systemd/resolve +RuntimeDirectoryPreserve=yes + +[Install] +WantedBy=multi-user.target +Alias=dbus-org.freedesktop.resolve1.service diff --git a/test/fuzz/fuzz-unit-file/systemd-tmpfiles-clean.timer b/test/fuzz/fuzz-unit-file/systemd-tmpfiles-clean.timer new file mode 100644 index 0000000..7db361c --- /dev/null +++ b/test/fuzz/fuzz-unit-file/systemd-tmpfiles-clean.timer @@ -0,0 +1,40 @@ +timer +# SPDX-License-Identifier: LGPL-2.1+ +[Unit] +Description=Daily Cleanup of Temporary Directories +Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) + +[Timer] +OnBootSec=15min +OnUnitActiveSec=1d +OnBootSec=1s +OnStartupSec=234 +OnUnitActiveSec=2y +OnUnitInactiveSec=23434 +OnCalendar=minutely +OnCalendar=*-*-* *:*:00 +OnCalendar=hourly +OnCalendar=*-*-* *:00:00 +OnCalendar=daily +OnCalendar=*-*-* 00:00:00 +OnCalendar=monthly +OnCalendar=*-*-01 00:00:00 +OnCalendar=weekly +OnCalendar=Mon *-*-* 00:00:00 +OnCalendar=yearly +OnCalendar=*-01-01 00:00:00 +OnCalendar=quarterly +OnCalendar=*-01,04,07,10-01 00:00:00 +OnCalendar=semiannually +OnCalendar=*-01,07-01 00:00:00 +OnCalendar=Fri 2012-11-23 11:12:13 + +Persistent=true +AccuracySec=24h +RandomizedDelaySec=234234234 + +Persistent=no +Unit=foo.service + +WakeSystem=false +RemainAfterElapse=true diff --git a/test/fuzz/fuzz-unit-file/timers.target b/test/fuzz/fuzz-unit-file/timers.target new file mode 100644 index 0000000..171226c --- /dev/null +++ b/test/fuzz/fuzz-unit-file/timers.target @@ -0,0 +1,16 @@ +target +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Timers +Documentation=man:systemd.special(7) + +DefaultDependencies=no +Conflicts=shutdown.target diff --git a/test/fuzz/fuzz-unit-file/var-lib-machines.mount b/test/fuzz/fuzz-unit-file/var-lib-machines.mount new file mode 100644 index 0000000..9c257d1 --- /dev/null +++ b/test/fuzz/fuzz-unit-file/var-lib-machines.mount @@ -0,0 +1,19 @@ +mount +# SPDX-License-Identifier: LGPL-2.1+ +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Virtual Machine and Container Storage +ConditionPathExists=/var/lib/machines.raw + +[Mount] +What=/var/lib/machines.raw +Where=/var/lib/machines +Type=btrfs +Options=loop diff --git a/tools/oss-fuzz.sh b/tools/oss-fuzz.sh index 200407f..451cc66 100755 --- a/tools/oss-fuzz.sh +++ b/tools/oss-fuzz.sh @@ -35,8 +35,10 @@ fi meson $build -D$fuzzflag -Db_lundef=false ninja -C $build fuzzers -for d in "$(dirname "$0")/../test/fuzz-corpus/"*; do - zip -jqr $OUT/fuzz-$(basename "$d")_seed_corpus.zip "$d" +# The seed corpus is a separate flat archive for each fuzzer, +# with a fixed name ${fuzzer}_seed_corpus.zip. +for d in "$(dirname "$0")/../test/fuzz/fuzz-"*; do + zip -jqr $OUT/$(basename "$d")_seed_corpus.zip "$d" done # get fuzz-dns-packet corpus