-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lkl hid fuzzer #515
Lkl hid fuzzer #515
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work Eugene, thank you! I left a few comments inline for a couple minor issues.
0dcffd5
to
2f04aec
Compare
2f04aec
to
68d3ca5
Compare
Pad '/init' string in fs_setup functio to make sure it's 8 bytes, otherwise KASan would emit an error. The kernel's strncpy implementation attempts to read 8 bytes at once and, thus, triggers KASan violation for the 6-byte string. Signed-off-by: Eugene Rodionov <[email protected]>
68d3ca5
to
fc719e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There are a few checkpatch warnings please check and see if it makes sense to fix some of them.
This change adds two LKL kernel config options: * LKL_FUZZING which enables libFuzzer fuzzing instrumentation for the kernel code * LKL_LINE_COV which enables code coverage instrumentation for the fuzz targets. These kernel config options are enabled via environment variables which should be set up either in the environment or in the make files. To build LKL fuzzers run (currently there are no fuzzers checked in yet): make -C tools/lkl LKL_FUZZING=1 fuzzers Signed-off-by: Xuan Xing <[email protected]> Signed-off-by: Eugene Rodionov <[email protected]>
Incremental linking in lld doesn't work well with the group sections (GRP_COMDAT) present in the input files -- in this case the linker semantics is unclear and not defined. This causes problems for building LKL fuzzers with libFuzzer instrumentation (-fsanitize=fuzzer) which generates object files with group sections due to the SanitizerCoverage instrumentation. This CL implements a workaround for this issue by introducing another post-link vmlinux pass. 1) First, vmlinux is linked with an empty linker script to avoid merging input sections 2) Then, .group sections (GRP_COMDAT) are stripped from the vmlinux image with `objcopy --remove-section=.group`. 3) Finally, we relink the vmlinux with the original linker scrip (using incremental linking). Signed-off-by: Eugene Rodionov <[email protected]>
As LKL fuzzers might be built with different kernel config options than the ones provided in the defconfig this change introduces an additional fuzzing_defconfig file. It is assumed that all LKL fuzzers are built using the same kernel config. Signed-off-by: Xuan Xing <[email protected]> Signed-off-by: Eugene Rodionov <[email protected]>
This fuzzer fuzzes Linux kernel HID subsystem via /dev/uhid device. To build the fuzzer: make -C tools/lkl LKL_FUZZING=1 fuzzers Signed-off-by: Xuan Xing <[email protected]>
Add a new target to build LKL-based fuzzers using clang/lld toolchain. Signed-off-by: Eugene Rodionov <[email protected]>
fc719e7
to
cc563a4
Compare
Many thanks, @tavip! The checkpatch warning have been fixed. |
This change adds @HclX's HID fuzzer.