[PATCH 00/21] sandbox: add libfuzzer-based fuzzing
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Jun 5 04:35:09 PDT 2025
We have a number of security-sensitive parsers in barebox that process
untrusted input, even in secure boot systems, e.g. the FIT parser, but
also the partition parser.
This series adds fuzzing tests for a number of these parsers based on
libfuzzer.
Ahmad Fatoum (21):
pbl: add provision for architectures without piggy loader
firmware: make Layerscape FMan firmware proper-only
mci: sdhci: support compiling common SDHCI code for sandbox PBL
kbuild: define and use more generic symlink command
kbuild: collect compatibility symlink creation in symlink-y
kbuild: allow customizing barebox proper binary
sandbox: make available all CONFIG_ symbols to OS glue code
sandbox: switch to using PBL
kbuild: populate non-host CXX variables
string: add fortify source support
sandbox: populate UNAME_M variable
Add fuzzing infrastructure
filetype: add fuzz target
block: mark underlying cdev with DEVFS_IS_BLOCK_DEV
block: add lightweight ramdisk support
fuzz: add support for passing fuzz data as r/o ramdisk
partitions: add partition table parser fuzz target
fdt: add fuzz test
fit: add fuzz test
Documentation: add LLVM libfuzzer documentation
sandbox: add support for coverage info generation
.gitignore | 6 +
Documentation/devel/devel.rst | 1 +
Documentation/devel/fuzzing.rst | 136 +++
Makefile | 72 +-
arch/Kconfig | 6 +
arch/sandbox/Kconfig | 10 +
arch/sandbox/Kconfig.debug | 7 +
arch/sandbox/Makefile | 91 +-
arch/sandbox/board/.gitignore | 3 -
arch/sandbox/board/Makefile | 2 -
arch/sandbox/include/asm/barebox-sandbox.h | 10 +
arch/sandbox/lib/.gitignore | 3 +
arch/sandbox/lib/Makefile | 2 +-
.../{board/barebox.lds.S => lib/pbl.lds.S} | 0
arch/sandbox/os/Makefile | 24 +-
arch/sandbox/os/common.c | 138 ++-
arch/sandbox/{lib => os}/unwind.c | 3 +-
arch/x86/um/Makefile | 4 +-
commands/Makefile | 1 +
commands/fuzz.c | 118 +++
commands/stacksmash.c | 6 +-
common/Kconfig | 7 +-
common/block.c | 9 +-
common/boards/configs/libfuzzer.config | 14 +
common/filetype.c | 12 +
common/image-fit.c | 76 +-
common/partitions.c | 56 ++
common/startup.c | 1 +
drivers/block/Kconfig | 6 +
drivers/block/Makefile | 1 +
drivers/block/ramdisk.c | 178 ++++
drivers/of/fdt.c | 39 +
firmware/Makefile | 3 +-
images/.gitignore | 2 +
images/Makefile | 26 +-
images/Makefile.sandbox | 33 +
include/asm-generic/barebox.lds.h | 13 +-
include/block.h | 13 +-
include/dma.h | 22 +-
include/driver.h | 1 +
include/filetype.h | 4 +-
include/fuzz.h | 87 ++
include/linux/compiler_types.h | 41 +
include/linux/fortify-string.h | 804 ++++++++++++++++++
include/linux/string.h | 17 +
include/mci.h | 9 +
include/ramdisk.h | 24 +
lib/Kconfig.hardening | 15 +
lib/Makefile | 3 +-
lib/fuzz.c | 79 ++
lib/string.c | 16 +-
lib/string_helpers.c | 30 +
lib/vsprintf.c | 15 +
pbl/Kconfig | 10 +-
pbl/string.c | 1 +
scripts/Kconfig.include | 1 +
scripts/Makefile.lib | 6 +-
scripts/clang-runtime-dir.sh | 19 +
scripts/subarch.include | 12 +-
test/Kconfig | 39 +
60 files changed, 2252 insertions(+), 135 deletions(-)
create mode 100644 Documentation/devel/fuzzing.rst
create mode 100644 arch/sandbox/include/asm/barebox-sandbox.h
create mode 100644 arch/sandbox/lib/.gitignore
rename arch/sandbox/{board/barebox.lds.S => lib/pbl.lds.S} (100%)
rename arch/sandbox/{lib => os}/unwind.c (88%)
create mode 100644 commands/fuzz.c
create mode 100644 common/boards/configs/libfuzzer.config
create mode 100644 drivers/block/ramdisk.c
create mode 100644 images/Makefile.sandbox
create mode 100644 include/fuzz.h
create mode 100644 include/linux/fortify-string.h
create mode 100644 include/ramdisk.h
create mode 100644 lib/fuzz.c
create mode 100644 lib/string_helpers.c
create mode 100755 scripts/clang-runtime-dir.sh
--
2.39.5
More information about the barebox
mailing list