This guide covers contributing to the upstream mainline kernel. Individual distributions may have additional requirements for packaging or stable-backport patches.
Before you begin
Code of Conduct
The Linux kernel project adopts the Contributor Covenant Code of Conduct. The community expects contributors and maintainers alike to:- Use welcoming and inclusive language
- Respect differing viewpoints and experience levels
- Accept constructive criticism gracefully
- Focus on what is best for the community
Developer Certificate of Origin
Every patch submitted to the kernel must carry aSigned-off-by: trailer. By adding this line you certify, under the Developer’s Certificate of Origin (DCO) version 1.1, that:
- (a) The contribution was created in whole or in part by you and you have the right to submit it under the indicated open-source license; or
- (b) The contribution is based on prior work covered by an appropriate open-source license and you have the right to submit modifications under the same license; or
- (c) A person who certified (a), (b), or (c) provided the contribution directly to you and you have not modified it.
- (d) You understand the contribution and the sign-off are public and maintained indefinitely.
Signed-off-by: line must match a real identity.
Finding something to work on
Fix a bug you have encountered
Fix a bug you have encountered
The most direct path into the kernel is fixing a bug that affects you. Reproduce it on the latest mainline kernel first—your bug may already be fixed. Check the mailing list archives at lore.kernel.org and bugzilla.kernel.org for existing reports.
Kernel Janitors / staging tree
Kernel Janitors / staging tree
The
drivers/staging/ subtree contains drivers that are functional but do not yet meet kernel quality standards. The TODO file in each staging driver lists outstanding issues. Cleaning up checkpatch.pl warnings, fixing sparse errors, or improving documentation are well-understood starting tasks that maintainers welcome from new contributors.KernelNewbies
KernelNewbies
KernelNewbies maintains a list of tasks labelled as suitable for beginners, along with a wiki documenting kernel internals and the contribution process. The
#kernelnewbies IRC channel on irc.oftc.net is a helpful place to ask questions.Documentation improvements
Documentation improvements
The
Documentation/ tree is large, actively maintained, and always accepting improvements: correcting inaccuracies, converting RST markup, adding missing parameters, or writing new guides. The [email protected] mailing list handles documentation patches.Work on a specific subsystem
Work on a specific subsystem
Browse the
MAINTAINERS file or the subsystem mailing list archives to find areas that interest you. Reading recent patch threads gives you a feel for what a maintainer expects and the quality of discussion in that area.Coding style
The kernel has a well-defined coding style described inDocumentation/process/coding-style.rst. Deviations cause patches to be returned for rework. Key rules:
Indentation and line length
- Indent with tabs, where one tab equals 8 characters. Never use spaces for indentation.
- Keep lines to a maximum of 80 columns. Longer lines are acceptable only when breaking them would significantly reduce readability.
Braces and spacing
- Opening braces for control-flow statements (
if,for,while,switch) go on the same line. - Opening braces for function definitions go on the next line.
- Do not add braces when a single statement suffices, unless one branch of an
if/elsepair requires them. - Use one space after keywords (
if,for,while,switch,case). No space aftersizeof,typeof, oralignof. - No spaces inside parenthesized expressions.
- Place the
*adjacent to the variable name in pointer declarations, not the type:
Naming
- Use lowercase with underscores (
snake_case) for functions, variables, and macros. - Avoid encoding type information in names (no Hungarian notation).
- Local variable names should be short and descriptive. Global symbols must be unambiguous.
Checking your patch
Runscripts/checkpatch.pl against your patch before sending it:
ERROR (very likely wrong), WARNING (needs careful review), and CHECK (requires thought). You should be able to justify every remaining violation. The checker is a guide, not a replacement for human judgment.
Preparing patches
One logical change per patch
Each patch must represent exactly one logical change. If you are both fixing a bug and cleaning up related code, use two separate patches. If a change spans many files, it may still belong in one patch as long as it constitutes a single logical unit. Series that interleave unrelated changes are routinely rejected. When building a series, ensure the kernel builds and runs correctly after each individual patch. Reviewers usegit bisect to track regressions, and a series that introduces a broken intermediate state blocks that workflow.
Write a good commit message
The commit message is permanent: it becomes part of thegit log that developers read for years. Structure it as:
Generate patches with git format-patch
git format-patch produces numbered .patch files (e.g., 0001-fix-foo.patch) that git am can apply cleanly. The --base flag embeds the base commit hash so CI tools can reproduce the exact tree you tested against.
Submitting patches
Find the right maintainers and lists
Usescripts/get_maintainer.pl to determine which maintainers and mailing lists should receive your patch:
MAINTAINERS file and the git history of the files touched by your patch, and prints a list of names and email addresses with role annotations (maintainer, reviewer, list, etc.). Add every address it reports.
[email protected] is the catch-all list and should be included by default, but many subsystems have their own primary list—prefer the subsystem list for the initial discussion.
Send with git send-email
Patches must be sent as plain-text inline email. Do not attach patches as files. Do not use HTML email. The standard tool isgit send-email:
Patch subject line format
The canonical subject format is:[PATCH]is added automatically bygit send-email.- Include a version tag (
v2,v3) when resubmitting after review feedback. - For a series of N patches, number them
1/N,2/N, … so reviewers know the full scope. - The subsystem prefix identifies the area being changed (e.g.,
net:,mm:,x86:,drm/i915:).
Patch tags reference
| Tag | Meaning |
|---|---|
Signed-off-by: | Author or handler certifies the DCO. Required on every patch. |
Reviewed-by: | Reviewer has technically reviewed and found the patch acceptable. |
Acked-by: | Stakeholder acknowledges and accepts the change. |
Tested-by: | Named person has successfully tested the patch. |
Reported-by: | Credits the person who reported the bug being fixed. |
Suggested-by: | Credits the person who suggested the approach. |
Fixes: | Identifies the commit that introduced the bug being fixed. |
Closes: | URL to the bug report or mailing list thread being resolved. |
Link: | URL to relevant background discussion. |
Co-developed-by: | Credits a co-author; must be immediately followed by their Signed-off-by:. |
Cc: [email protected] | Requests backport to stable kernels (in sign-off area, not email recipient). |
Cc:, Reported-by:, and Suggested-by: require explicit permission from the named person before you add them.
The review process
Wait for feedback
After sending, allow at least one week before following up—longer during the merge window (the two-week period after each -rc1 when maintainers are busy pulling feature trees). You should normally receive a response within 2–3 weeks if the patch was sent to the correct lists.
Respond to review comments
Reply to reviewer emails inline (interleaved), quoting only the relevant section. Address each concern explicitly. Thank reviewers for their time—code review is laborious.If a comment does not lead to a code change, explain why in your reply. The reasoning is valuable context for future readers of the mailing list archives.
Submit a revised version
When submitting a revised patch, increment the version tag (CC all reviewers who commented on earlier versions so they can follow the revision.
v2, v3, …) and add a changelog below the --- separator line describing what changed between versions:Patch lands in a subsystem tree
Once a maintainer is satisfied, they apply the patch to their subsystem tree and it queues for the next merge window. You can track its progress on patchwork or by watching the subsystem tree on kernel.org.
Mailing lists and community resources
lore.kernel.org
Searchable archive of all kernel mailing lists. Use it to find existing discussions, check patch status, and construct
Link: tags using the Message-ID of relevant threads.patchwork.kernel.org
Tracks the state of patches sent to kernel mailing lists. Maintainers use it to manage their queues; contributors can check whether their patch has been picked up.
bugzilla.kernel.org
The official kernel bug tracker. Useful for finding reproducible bugs to fix and for filing new ones when a mailing list report is not appropriate.
KernelNewbies
Documentation, task lists, and a community (IRC:
#kernelnewbies on irc.oftc.net) aimed at people getting started with kernel development.b4 tooling
b4 automates many patch workflow tasks: retrieving patches from lore, checking dependencies, running checkpatch, and formatting and sending mail.Security issues
Patches fixing exploitable security vulnerabilities should be sent to
[email protected] rather than a public mailing list, to allow coordinated disclosure.Key mailing lists
| List | Purpose |
|---|---|
[email protected] | General kernel development; catch-all for patches without a more specific list. |
[email protected] | Documentation patches and doc tooling. |
[email protected] | Networking core and drivers. |
[email protected] | Memory management subsystem. |
[email protected] | Filesystem and VFS development. |
[email protected] | Stable kernel patch submissions and discussion. |
[email protected] | Private channel for security vulnerability reports. |
