File size: 2,215 Bytes
9a4d2ed
9127334
 
 
baa4a41
9127334
 
 
 
 
 
 
 
 
 
 
baa4a41
9127334
 
9a4d2ed
9127334
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
license: gpl-2.0
task_categories:
  - text-generation
  - other
language:
  - en
tags:
  - linux
  - kernel
  - c
  - c++
  - bug-fix
  - SFT
  - instruction-tuning
  - security
  - code-generation
size_categories:
  - 100K<n<1M
---

# 🐧 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 dataset has been strictly filtered to include only meaningful bug fixes and excludes noisy data such as typos, documentation updates, and version bumps.

- **Language:** English (Commit messages), C / Assembly (Code)
- **License:** GPL-2.0 (Inherited from Linux Kernel)
- **Format:** Supervised Fine-Tuning (SFT) ready (Instruction / Input / Output)

## 🚀 Intended Uses & Applications

This dataset is perfect for training AI Agents and local LLMs for:
1. **Low-Level Code Repair:** Teaching models to fix memory leaks, use-after-free errors, null pointer dereferences, and race conditions.
2. **Patch Generation:** Generating valid `git diff` outputs based on issue descriptions.
3. **Cybersecurity Analysis:** Fine-tuning models to recognize and patch CVEs and kernel panics.

## 📊 Dataset Structure

Each row in the dataset represents a single bug-fix commit. The data is formatted for immediate use in SFT pipelines (like Unsloth, QLoRA, Axolotl).

**Example Instance:**
```json
{
  "id": "a1b2c3d4e5f6...",
  "instruction": "Analyze and fix the following issue in the Linux kernel code: net: sched: fix memory leak in tc_action",
  "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.",
  "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```"
}