]> git.ipfire.org Git - thirdparty/lxc.git/commit
oss-fuzz: make it possible to build the fuzzer without docker 3733/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Thu, 25 Mar 2021 22:00:36 +0000 (22:00 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Fri, 26 Mar 2021 01:11:23 +0000 (01:11 +0000)
commitdec64820a3859b1943c521682aacc2f77751b39d
tree2e981f5d34b2550a2ab31268178919ea8573d928
parent0912bf6b77c5dd8c62c454e84d7c4c1dc861cdbc
oss-fuzz: make it possible to build the fuzzer without docker

With this patch applied the fuzz target can be built (with ASan)
and run with
```
./src/tests/oss-fuzz.sh
./out/fuzz-lxc-config-read doc/examples/
```

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32475 can be
reproduced by running
```
$ echo "lxc.console.buffer.size=d" >oss-fuzz-32475
$ ./out/fuzz-lxc-config-read ./oss-fuzz-32475
INFO: Seed: 1044753468
INFO: Loaded 1 modules   (18770 inline 8-bit counters): 18770 [0x883cc0, 0x888612),
INFO: Loaded 1 PC tables (18770 PCs): 18770 [0x888618,0x8d1b38),
./out/fuzz-lxc-config-read: Running 1 inputs 1 time(s) each.
Running: oss-fuzz-32475
=================================================================
==2052097==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffcca063e7f at pc 0x000000659e0d bp 0x7ffcca063e30 sp 0x7ffcca063e28
READ of size 1 at 0x7ffcca063e7f thread T0
...
```

I'll point OSS-Fuzz to the build script once this patch is merged.

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
src/tests/fuzz-lxc-config-read.c [new file with mode: 0644]
src/tests/oss-fuzz.sh [new file with mode: 0755]