CoolFace
Datasetpublic

quguanni/kernel-vuln-dataset

Linux Kernel Vulnerability Dataset 125,183 bug-introducing commits mined from 20 years of Linux kernel git history (2005-2025). Dataset Description This dataset maps every kernel bug fix with a Fixes: tag back to the commit that introduced the bug. It enables research on: Vulnerability detection: Train models to identify bug-introducing commits Bug lifetime analysis: Study how long different bug types persist Subsystem risk assessment: Identify which kernel… See the full description on the dataset page: https://huggingface.co/datasets/quguanni/kernel-vuln-dataset.

sourceHugging Facemitupdated 9mo agoView on Hugging Face
2likes423downloads
Dataset Card

Linux Kernel Vulnerability Dataset

125,183 bug-introducing commits mined from 20 years of Linux kernel git history (2005-2025).

Dataset Description

This dataset maps every kernel bug fix with a Fixes: tag back to the commit that introduced the bug. It enables research on:

  • Vulnerability detection: Train models to identify bug-introducing commits
  • Bug lifetime analysis: Study how long different bug types persist
  • Subsystem risk assessment: Identify which kernel subsystems have the longest-lived bugs
  • Developer patterns: Analyze who introduces and fixes bugs

Key Statistics

MetricValue
Total bug-fix pairs125,183
Valid records (0 < lifetime < 27 years)123,696
Average bug lifetime2.1 years
Median bug lifetime0.7 years
Longest-lived bug20.7 years
Bugs hiding 5+ years13.5%
Unique fixing commits119,449
Unique bug-introducing authors9,159
With CVE ID158
With Cc: stable27,875 (22%)

Dataset Structure

Data Fields

ColumnTypeDescription
fixing_commitstringSHA of the commit that fixed the bug
introducing_commitstringSHA of the commit that introduced the bug
lifetime_daysintDays between introduction and fix
subsystemstringKernel subsystem (networking, drivers, fs, etc.)
bug_typestringDetected bug type (race-condition, null-deref, etc.)
fix_subjectstringCommit message subject of the fix
fixing_datedatetimeWhen the fix was committed
introducing_datedatetimeWhen the bug was introduced
files_changedstringFiles modified in introducing commit
insertionsintLines added in introducing commit
deletionsintLines removed in introducing commit
cve_idstringCVE ID if mentioned in fix commit (nullable)
cc_stableboolWhether fix was tagged for stable backport
fix_authorstringAuthor of the fix
intro_authorstringAuthor who introduced the bug

Subsystem Distribution

SubsystemCountAvg Lifetime
drivers38,4122.3 years
networking6,0792.9 years
gpu5,2121.4 years
filesystem4,8912.6 years
sound3,8472.1 years
usb2,5053.5 years
memory2,4591.8 years
bpf9591.1 years

Bug Type Distribution

Bug TypeCountAvg Lifetime
null-deref4,9312.2 years
use-after-free2,9633.2 years
memory-leak2,8463.1 years
refcount2,2092.8 years
deadlock1,6832.2 years
race-condition1,1885.1 years
buffer-overflow3993.1 years
integer-overflow2983.9 years

Collection Methodology

Mining Process

  1. 1.Clone Linux kernel repository at v6.19-rc3
  2. 2.Run git log --grep="Fixes:" to find all fixing commits
  3. 3.Extract the referenced commit hash from each Fixes: tag using regex
  4. 4.Retrieve metadata (dates, authors, files) from both commits
  5. 5.Classify subsystem from file paths using 70+ regex patterns
  6. 6.Detect bug type from commit message keywords
  7. 7.Calculate lifetime as fixing_date - introducing_date

Extraction Code

python
import re

def extract_fixes_tag(commit_msg: str) -> str | None:
    """Extract the commit ID from a Fixes: tag"""
    pattern = r'Fixes:\s*([a-f0-9]{12,40})'
    match = re.search(pattern, commit_msg, re.IGNORECASE)
    return match.group(1) if match else None

Filtering

  • Excluded commits where Fixes: tag points to non-existent hash
  • Excluded merge commits
  • For lifetime analysis: excluded same-day fixes (lifetime_days = 0)
  • For lifetime analysis: excluded outliers (lifetime > 10,000 days)

Limitations

  • Selection bias: Only ~28% of fix commits use Fixes: tags. Well-documented bugs (likely more serious) are overrepresented.
  • Mainline only: Doesn't include bugs fixed only in stable branches or vendor kernels.
  • Subsystem classification: Heuristic-based on file paths; some bugs span multiple subsystems.
  • Bug type detection: Keyword-based; many bugs classified as "unknown".
  • Timestamp accuracy: Uses author dates, not commit dates. Rebasing can skew.

Intended Uses

Recommended

  • Training vulnerability detection models (e.g., VulnBERT)
  • Analyzing bug lifetime patterns across subsystems
  • Studying the evolution of kernel security over time
  • Research on code review and testing effectiveness

Out of Scope

  • Direct exploit development (commits don't include full code context)
  • Claiming completeness of kernel vulnerability data

Citation

bibtex
@dataset{qu2026kernelvuln,
  author = {Qu, Jenny Guanni},
  title = {Linux Kernel Vulnerability Dataset},
  year = {2026},
  publisher = {HuggingFace},
  url = {https://huggingface.co/datasets/quguanni/kernel-vuln-dataset}
}

License

MIT License

Contact