fuzz: add directives.link and 99-default.link for fuzz-link-parser
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 22 Feb 2019 05:45:46 +0000 (14:45 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Feb 2019 03:40:42 +0000 (12:40 +0900)
Also adds several reproducers of errors fixed in earlier commits.

test/fuzz/fuzz-link-parser/99-default.link [new file with mode: 0644]
test/fuzz/fuzz-link-parser/advertise-segv.link [new file with mode: 0644]
test/fuzz/fuzz-link-parser/condition-memleak.link [new file with mode: 0644]
test/fuzz/fuzz-link-parser/directives.link [new file with mode: 0644]

diff --git a/test/fuzz/fuzz-link-parser/99-default.link b/test/fuzz/fuzz-link-parser/99-default.link
new file mode 100644 (file)
index 0000000..92fcbe8
--- /dev/null
@@ -0,0 +1,12 @@
+#  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.
+
+[Link]
+NamePolicy=keep kernel database onboard slot path
+MACAddressPolicy=persistent
diff --git a/test/fuzz/fuzz-link-parser/advertise-segv.link b/test/fuzz/fuzz-link-parser/advertise-segv.link
new file mode 100644 (file)
index 0000000..305e846
--- /dev/null
@@ -0,0 +1,2 @@
+[Link]
+Advertise=hoge foo
diff --git a/test/fuzz/fuzz-link-parser/condition-memleak.link b/test/fuzz/fuzz-link-parser/condition-memleak.link
new file mode 100644 (file)
index 0000000..523e4ba
--- /dev/null
@@ -0,0 +1,7 @@
+[Match]
+OriginalName=eth0
+Host=hogehoge
+Virtualization=qemu
+KernelCommandLine=aaa
+KernelVersion=4.20.3
+Architecture=x86-64
diff --git a/test/fuzz/fuzz-link-parser/directives.link b/test/fuzz/fuzz-link-parser/directives.link
new file mode 100644 (file)
index 0000000..5925e5a
--- /dev/null
@@ -0,0 +1,35 @@
+[Match]
+MACAddress=
+OriginalName=
+Path=
+Driver=
+Type=
+Host=
+Virtualization=
+KernelCommandLine=
+KernelVersion=
+Architecture=
+[Link]
+Description=
+MACAddressPolicy=
+MACAddress=
+NamePolicy=
+Name=
+Alias=
+MTUBytes=
+BitsPerSecond=
+Duplex=
+AutoNegotiation=
+WakeOnLan=
+Port=
+GenericSegmentationOffload=
+TCPSegmentationOffload=
+TCP6SegmentationOffload=
+UDPSegmentationOffload=
+GenericReceiveOffload=
+LargeReceiveOffload=
+RxChannels=
+TxChannels=
+OtherChannels=
+CombinedChannels=
+Advertise=