pebblebed/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/pebblebed/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 subsystems have the longest-lived bugs
- Developer patterns: Analyze who introduces and fixes bugs
Key Statistics
Dataset Structure
Data Fields
Subsystem Distribution
Bug Type Distribution
Collection Methodology
Mining Process
- Clone Linux kernel repository at v6.19-rc3
- Run
git log --grep="Fixes:"to find all fixing commits - Extract the referenced commit hash from each
Fixes:tag using regex - Retrieve metadata (dates, authors, files) from both commits
- Classify subsystem from file paths using 70+ regex patterns
- Detect bug type from commit message keywords
- Calculate lifetime as
fixing_date - introducing_date
Extraction Code
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 NoneFiltering
- 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
@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
- Author: Jenny Guanni Qu
- Email: jenny@pebblebed.com
- Blog post: Kernel bugs hide for 2 years on average
