Skip to content

Fuzzing for grub related parsing#2535

Merged
rminnich merged 5 commits into
u-root:mainfrom
RiSKeD:grub-fuzzing
Oct 29, 2022
Merged

Fuzzing for grub related parsing#2535
rminnich merged 5 commits into
u-root:mainfrom
RiSKeD:grub-fuzzing

Conversation

@RiSKeD

@RiSKeD RiSKeD commented Oct 24, 2022

Copy link
Copy Markdown
Contributor

This PR follows the same concept as #2528 but for the parsing of grub config files.
The tests either check for panics when parsing "random" grub cfg files or it check if a round-trip (parsing,write-back, parsing) results in the same parsed object.
The last commit a7c5147 contains inputs that fail in these tests. Refer to #2528 on how to reproduce these.

@RiSKeD RiSKeD added the Awaiting reviewer Waiting for a reviewer. label Oct 24, 2022
@RiSKeD RiSKeD changed the title Grub fuzzing Fuzzing for grub related parsing Oct 24, 2022
@RiSKeD RiSKeD force-pushed the grub-fuzzing branch 2 times, most recently from 94a5762 to c14d39c Compare October 27, 2022 08:09
Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
@RiSKeD

RiSKeD commented Oct 27, 2022

Copy link
Copy Markdown
Contributor Author

Fixed some of the parsing in pkg/boot/grub by adding some more checks in commit dc5191d.
Again, I ran each of the 3 fuzzing tests for approx. 30Mins without any errors afterwards,

@u-root u-root deleted a comment from codecov Bot Oct 27, 2022
@codecov

codecov Bot commented Oct 27, 2022

Copy link
Copy Markdown

Codecov Report

Base: 72.40% // Head: 73.66% // Increases project coverage by +1.25% 🎉

Coverage data is based on head (aa579b4) compared to base (9958202).
Patch coverage: 92.85% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2535      +/-   ##
==========================================
+ Coverage   72.40%   73.66%   +1.25%     
==========================================
  Files         324      405      +81     
  Lines       34764    41229    +6465     
==========================================
+ Hits        25172    30372    +5200     
- Misses       9592    10857    +1265     
Impacted Files Coverage Δ
pkg/boot/grub/entry.go 95.65% <91.66%> (+6.46%) ⬆️
pkg/boot/grub/grub.go 73.35% <100.00%> (+1.37%) ⬆️
pkg/smbios/smbios_linux.go 93.10% <0.00%> (ø)
pkg/crypto/measure.go 21.73% <0.00%> (ø)
cmds/exp/pox/pox.go 11.76% <0.00%> (ø)
pkg/bb/bbmain/cmd/main.go 29.41% <0.00%> (ø)
pkg/uroot/test/gopath2/src/mypkga/mypkga.go 0.00% <0.00%> (ø)
pkg/mount/loop/losetup_linux.go 0.00% <0.00%> (ø)
pkg/smbios/type126_inactive.go 0.00% <0.00%> (ø)
pkg/smbios/table.go 93.68% <0.00%> (ø)
... and 140 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
@rminnich rminnich merged commit aeed97b into u-root:main Oct 29, 2022
Navidem pushed a commit to google/oss-fuzz that referenced this pull request Nov 7, 2022
Following the addition of some fuzzing tests
([#1](u-root/u-root#2528),
[#2](u-root/u-root#2535),
[#3](u-root/u-root#2536)) in the u-root project
and [preparations for this
integration](u-root/u-root#2543).
You can check out its [website](https://u-root.org/) for more info on
the project.

Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>

Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting reviewer Waiting for a reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants