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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
"linux_kernel",
"linuxptp",
"lldpd",
"llvm",
"logrotate",
"lrzip",
"lua",
Expand Down
18 changes: 18 additions & 0 deletions cve_bin_tool/checkers/llvm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2025 Keysight Technologies
# SPDX-License-Identifier: GPL-3.0-or-later

"""
CVE checker for LLVM
"""

from cve_bin_tool.checkers import Checker


class LlvmChecker(Checker):
CONTAINS_PATTERNS = []
FILENAME_PATTTERN = []
VERSION_PATTERNS = [
r"LLVM version ([0-9]+\.[0-9]+\.[0-9]+)",
r"/llvm-[a-z]+/([0-9]+\.[0-9]+\.[0-9]+)",
]
VENDOR_PRODUCT = [("llvm", "llvm")]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions test/test_data/clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"package_name": "libclang1-19_19.1.1-1ubuntu1_amd64.deb",
"product": "clang",
"version": "19.1.1",
"other_products": ["llvm"],
},
]
1 change: 1 addition & 0 deletions test/test_data/go.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"package_name": "go-1.13.13-r0.apk",
"product": "go",
"version": "1.13.13",
"other-products": ["llvm"],
},
]
120 changes: 120 additions & 0 deletions test/test_data/llvm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Copyright (C) 2025 Keysight Technologies
# SPDX-License-Identifier: GPL-3.0-or-later
mapping_test_data = [
{
"product": "llvm",
"version": "14.0.6",
"version_strings": ["LLVM version 14.0.6"],
},
{
"product": "llvm",
"version": "15.0.7",
"version_strings": ["LLVM version 15.0.7"],
},
{
"product": "llvm",
"version": "16.0.6",
"version_strings": ["LLVM version 16.0.6"],
},
{
"product": "llvm",
"version": "17.0.6",
"version_strings": ["LLVM version 17.0.6"],
},
{
"product": "llvm",
"version": "18.1.3",
"version_strings": ["LLVM version 18.1.3", "/llvm-lto/18.1.3"],
},
{
"product": "llvm",
"version": "19.1.1",
"version_strings": ["LLVM version 19.1.1"],
},
]
package_test_data = [
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-6.0/",
"package_name": "libllvm6.0_6.0.1-14_amd64.deb",
"product": "llvm",
"version": "6.0.1",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-7/",
"package_name": "libllvm7_7.0.1-12_amd64.deb",
"product": "llvm",
"version": "7.0.1",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-8/",
"package_name": "libllvm8_8.0.1-9_amd64.deb",
"product": "llvm",
"version": "8.0.1",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-9/",
"package_name": "libllvm9_9.0.1-12_amd64.deb",
"product": "llvm",
"version": "9.0.1",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-10/",
"package_name": "libllvm10_10.0.0-4ubuntu1_amd64.deb",
"product": "llvm",
"version": "10.0.0",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-11/",
"package_name": "libllvm11_11.0.0-2~ubuntu20.04.1_amd64.deb",
"product": "llvm",
"version": "11.0.0",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-12/",
"package_name": "libllvm12_12.0.1-19ubuntu3_amd64.deb",
"product": "llvm",
"version": "12.0.1",
},
{
"url": "http://security.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-13/",
"package_name": "libllvm13_13.0.1-2ubuntu2.2_amd64.deb",
"product": "llvm",
"version": "13.0.1",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-14/",
"package_name": "libllvm14t64_14.0.6-19build4_amd64.deb",
"product": "llvm",
"version": "14.0.6",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-15/",
"package_name": "libllvm15t64_15.0.7-14build3_amd64.deb",
"product": "llvm",
"version": "15.0.7",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-16/",
"package_name": "libllvm16t64_16.0.6-23ubuntu4_amd64.deb",
"product": "llvm",
"version": "16.0.6",
},
{
"url": "http://ubuntu-master.mirror.tudos.de/ubuntu/pool/main/l/llvm-toolchain-17/",
"package_name": "libllvm17t64_17.0.6-9ubuntu1_amd64.deb",
"product": "llvm",
"version": "17.0.6",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-18/",
"package_name": "libllvm18_18.1.8-11_amd64.deb",
"product": "llvm",
"version": "18.1.8",
},
{
"url": "http://de.archive.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-19/",
"package_name": "libllvm19_19.1.1-1ubuntu1_amd64.deb",
"product": "llvm",
"version": "19.1.1",
},
]
Loading