chore(deps/vuls2): update vuls2 and optimize kernel package name handling#2396
Merged
chore(deps/vuls2): update vuls2 and optimize kernel package name handling#2396
Conversation
0eeb554 to
c1b3402
Compare
c1b3402 to
1f52c0c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the vuls2 dependency to address a significant performance regression in Ubuntu vulnerability detection, improving scan times from approximately 2:47 minutes to 13 seconds. The performance improvement is achieved through a new pruneCriteria function that filters out non-affected packages early in the detection process, and by adding early return optimizations to the kernel package name handling logic.
Changes:
- Updated vuls2 dependency from
v0.0.1-alpha.0.20260116054746-1ca48c3a06bctov0.0.1-alpha.0.20260119095403-19e84d806e2e - Added early return optimization in
RenameKernelSourcePackageNameto skip processing non-kernel packages (those not starting with "linux-") - Implemented new
pruneCriteriafunction to filter criteria trees by removing unaffected packages before walking the full criteria structure
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updated vuls2 dependency to newer version with performance improvements |
| go.sum | Added checksum entries for the new vuls2 version (old version retained as expected) |
| models/packages.go | Added early return checks for non-kernel packages in RenameKernelSourcePackageName to avoid unnecessary string replacement operations |
| detector/vuls2/vuls2.go | Added pruneCriteria function to filter out unaffected packages from criteria trees before processing, significantly reducing processing time |
| detector/vuls2/vuls2_test.go | Added comprehensive test coverage for pruneCriteria function with multiple test cases covering AND/OR operators and edge cases |
| detector/vuls2/export_test.go | Exported PruneCriteria function for testing purposes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
851a6e2 to
7c696b4
Compare
Contributor
7c696b4 to
18dbf9a
Compare
18dbf9a to
e17e9db
Compare
MaineK00n
reviewed
Jan 29, 2026
b5fe306 to
53966fd
Compare
Collaborator
Author
|
Updated deps to MaineK00n/vuls2#309 |
MaineK00n
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What did you implement:
cf. MaineK00n/vuls2#305
By updating vuls2 to current nightly HEAD, Ubuntu detection got somewhat slow.
This PR fixes it.
Before:
After
Then, with the following setup, no diff found by "make diff".
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Checklist:
You don't have to satisfy all of the following.
make fmtmake testIs this ready for review?: YES
Reference