switlydev/linux-kernel-bugfixes-diffs
π§ Linux Kernel Bugfixes & Patches Dataset (Instruction-Tuned) π Dataset Description This dataset is a highly curated, instruction-tuned collection of problem-solution pairs extracted directly from the official Linux Kernel Git repository (torvalds/linux). It is specifically designed to train Large Language Models (LLMs) on low-level C programming, kernel architecture, memory management, and security vulnerability patching. Unlike raw commit histories, thisβ¦ See the full description on the dataset page: https://huggingface.co/datasets/switlydev/linux-kernel-bugfixes-diffs.
074
1---2license: gpl-2.03task_categories:4 - text-generation5 - other6language:7 - en8tags:9 - linux10 - kernel11 - c12 - c++13 - bug-fix14 - SFT15 - instruction-tuning16 - security17 - code-generation18size_categories:19 - 100K<n<1M20---21 22# π§ Linux Kernel Bugfixes & Patches Dataset (Instruction-Tuned)23 24## π Dataset Description25 26This dataset is a highly curated, instruction-tuned collection of **problem-solution pairs** extracted directly from the official Linux Kernel Git repository (`torvalds/linux`). It is specifically designed to train Large Language Models (LLMs) on **low-level C programming, kernel architecture, memory management, and security vulnerability patching**.27 28Unlike raw commit histories, this dataset has been strictly filtered to include only meaningful bug fixes and excludes noisy data such as typos, documentation updates, and version bumps.29 30- **Language:** English (Commit messages), C / Assembly (Code)31- **License:** GPL-2.0 (Inherited from Linux Kernel)32- **Format:** Supervised Fine-Tuning (SFT) ready (Instruction / Input / Output)33 34## π Intended Uses & Applications35 36This dataset is perfect for training AI Agents and local LLMs for:371. **Low-Level Code Repair:** Teaching models to fix memory leaks, use-after-free errors, null pointer dereferences, and race conditions.382. **Patch Generation:** Generating valid `git diff` outputs based on issue descriptions.393. **Cybersecurity Analysis:** Fine-tuning models to recognize and patch CVEs and kernel panics.40 41## π Dataset Structure42 43Each row in the dataset represents a single bug-fix commit. The data is formatted for immediate use in SFT pipelines (like Unsloth, QLoRA, Axolotl).44 45**Example Instance:**46```json47{48 "id": "a1b2c3d4e5f6...",49 "instruction": "Analyze and fix the following issue in the Linux kernel code: net: sched: fix memory leak in tc_action",50 "input": "Problem Details:\nWhen a filter action fails to initialize, the memory allocated for option parameters is not properly freed, resulting in a memory leak under high load.",51 "output": "```diff\n--- a/net/sched/act_api.c\n+++ b/net/sched/act_api.c\n@@ -120,6 +120,7 @@ static int tcf_action_init(struct net *net...\n+ kfree(opt);\n```"52}