Skip to content

pkg/cover: Unable to get code coverage when trying to test a .ko file #5857

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

Open
happy2discover opened this issue Mar 25, 2025 · 1 comment
Labels

Comments

@happy2discover
Copy link

Describe the bug
Unable to get code coverage when trying to test an external .ko file. I also sent a mail to [email protected].

To Reproduce
Environment:

  • Kernel: Linux 6.1.x (built with CONFIG_KASAN, CONFIG_KCOV and so on enabled)
  • Syzkaller: master
  • Module: A self-compiled driver (.ko).

Goals:

  • Use Syzkaller to test .ko (not built into vmlinux).
  • Collect code coverage data for this module.

Issues:

  • How to ensure Syzkaller triggers the module's code paths?
  • Are there additional configs required for coverage of dynamic modules?

Could you share a Syzkaller configuration example targeting a specific .ko, and any kernel build settings needed? Thank you for your guidance!

Expected behavior
Able to get code coverage of an external .ko file

Additional context
No.

@tomcruiseqi
Copy link

Few months ago, with Syzkaller's help, I tested some close source driver. I think your problem can be solved by following steps:

  1. Merge your driver code to the mainline tree (on test environment), make sure they can be seen by kernel build system.
  2. Write syzlang description codes for your driver.
  3. Rebuilt Syzkaller and solve the prolems if they appear.
  4. In syz-manager's configuration, enable syscalls you care.
  5. Run the syz-manager and see the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants