Skip to content

feat(checkers): Add support for llvm #4752

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

Merged
merged 2 commits into from
Mar 31, 2025

Conversation

qmfrederik
Copy link
Contributor

No description provided.

@qmfrederik qmfrederik force-pushed the features/llvm-toolchain branch from 5a1ede5 to 9d41e72 Compare February 1, 2025 23:16
@qmfrederik qmfrederik force-pushed the features/llvm-toolchain branch from 9d41e72 to bbc7562 Compare February 12, 2025 18:18
@terriko
Copy link
Contributor

terriko commented Feb 13, 2025

Ugh, these are all so similar. I don't think you're wrong about what you're doing, but I wonder if we can collapse them down to be auto-generated or something in a future refactoring.

@qmfrederik
Copy link
Contributor Author

Yes, it's not pretty. The ecosystem is pretty intentional about maintaining different versions as different products (i.e. 'llvm17' is a different product than 'llvm16'), amongst others to allow multiple versions to co-exist on the same machine.

Templating is one option, subclassing may be another.

@qmfrederik qmfrederik force-pushed the features/llvm-toolchain branch from bbc7562 to 2ab2eed Compare February 14, 2025 10:10
@qmfrederik qmfrederik changed the title feat(checkers): Add support for llvm-toolchain-6 through llvm-toolchain-19 feat(checkers): Add support for llvm-toolchain-6 Feb 21, 2025
@qmfrederik qmfrederik force-pushed the features/llvm-toolchain branch 3 times, most recently from 52fe9a0 to c8731ce Compare February 28, 2025 09:27
Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again. Should we be using unknown, llvm-toolchain-* here for each CPE or do these all actually fall under the llvm, llvm category? Or is there a PURL identifier we should be looking at instead? A quick search made it seem like it should probably be the llvm, llvm, but I admit I don't know the vuln history for these components very well.

@ffontaine
Copy link
Contributor

There is no CVEs linked to ("unknown", "llvm-toolchain-x") so, indeed, I would be more in favor of adding a single binary checker using ("llvm", "llvm").

@qmfrederik qmfrederik force-pushed the features/llvm-toolchain branch from c8731ce to 6616747 Compare March 5, 2025 10:24
@ffontaine
Copy link
Contributor

There is always 3 digits in llvm version and "version" string seems to be mandatory so I would suggest to replace:

        r"LLVM (?:version )?([0-9]+\.[0-9]+(\.[0-9]+)?)",
        r"/llvm-[a-z]+/([0-9]+\.[0-9]+(\.[0-9]+)?)",

by

        r"LLVM version ([0-9]+\.[0-9]+\.[0-9]+)",
        r"/llvm-[a-z]+/([0-9]+\.[0-9]+\.[0-9]+)",

@qmfrederik qmfrederik force-pushed the features/llvm-toolchain branch from 6616747 to 0c10652 Compare March 5, 2025 10:59
@qmfrederik qmfrederik force-pushed the features/llvm-toolchain branch from 0c10652 to df05016 Compare March 5, 2025 13:46
@qmfrederik qmfrederik changed the title feat(checkers): Add support for llvm-toolchain-6 feat(checkers): Add support for llvm Mar 5, 2025
@qmfrederik
Copy link
Contributor Author

Thanks @ffontaine . I seem to remember having seen an instance where the word version was not part of the version string, but I can't find that example. So I simplified the PR accordingly.

@ffontaine
Copy link
Contributor

ffontaine commented Mar 5, 2025

Hi @qmfrederik, when I double-checked, one of your previous iteration, I found out that you added llvm in other_products of go-1.13.13-r0.apk.tar.gzbecause /usr/lib/go/src/runtime/race/race_freebsd_amd64.syso contains
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)

If you think that llvm was indeed really used to compile race_freebsd_amd64.syso, please revert the change that I asked concerning the version word. I have no strong opinion on my side.

@qmfrederik
Copy link
Contributor Author

@ffontaine I think we can leave this as is for now -- I assume it will detect clang, which is probably good enough a proxy for LLVM at the moment.

@terriko If you agree, then this PR is ready (the spelling check appears to be a flake)

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think I agree that this is ready to go (sorry I missed that it's been ready for a while because I was doing hackathon stuff!) I'm going to update the branch and re-run tests just in case, but assuming they pass I intend to come back and merge this.

@terriko terriko added awaiting maintainer Need a maintainer to respond / help out awaiting CI labels Mar 21, 2025
@ffontaine
Copy link
Contributor

All tests successful, I could merge it however @terriko what is the merge rule for cve-bin-tool? Is it fine to "squash and merge"?

@terriko
Copy link
Contributor

terriko commented Mar 31, 2025

@ffontaine Yes, I typically squash and merge (often editing the long commit message down to something reasonable if there's been a lot of churn). The times when I haven't done that are mostly mistakes due to using a different browser and not realizing which was the default selection.

Anyhow, I'll get this merged now, thank you @qmfrederik for your patience!

@terriko terriko merged commit d659f9e into intel:main Mar 31, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting CI awaiting maintainer Need a maintainer to respond / help out
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants