162306a36Sopenharmony_ci.. _stable_kernel_rules: 262306a36Sopenharmony_ci 362306a36Sopenharmony_ciEverything you ever wanted to know about Linux -stable releases 462306a36Sopenharmony_ci=============================================================== 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciRules on what kind of patches are accepted, and which ones are not, into the 762306a36Sopenharmony_ci"-stable" tree: 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci - It or an equivalent fix must already exist in Linus' tree (upstream). 1062306a36Sopenharmony_ci - It must be obviously correct and tested. 1162306a36Sopenharmony_ci - It cannot be bigger than 100 lines, with context. 1262306a36Sopenharmony_ci - It must follow the 1362306a36Sopenharmony_ci :ref:`Documentation/process/submitting-patches.rst <submittingpatches>` 1462306a36Sopenharmony_ci rules. 1562306a36Sopenharmony_ci - It must either fix a real bug that bothers people or just add a device ID. 1662306a36Sopenharmony_ci To elaborate on the former: 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci - It fixes a problem like an oops, a hang, data corruption, a real security 1962306a36Sopenharmony_ci issue, a hardware quirk, a build error (but not for things marked 2062306a36Sopenharmony_ci CONFIG_BROKEN), or some "oh, that's not good" issue. 2162306a36Sopenharmony_ci - Serious issues as reported by a user of a distribution kernel may also 2262306a36Sopenharmony_ci be considered if they fix a notable performance or interactivity issue. 2362306a36Sopenharmony_ci As these fixes are not as obvious and have a higher risk of a subtle 2462306a36Sopenharmony_ci regression they should only be submitted by a distribution kernel 2562306a36Sopenharmony_ci maintainer and include an addendum linking to a bugzilla entry if it 2662306a36Sopenharmony_ci exists and additional information on the user-visible impact. 2762306a36Sopenharmony_ci - No "This could be a problem..." type of things like a "theoretical race 2862306a36Sopenharmony_ci condition", unless an explanation of how the bug can be exploited is also 2962306a36Sopenharmony_ci provided. 3062306a36Sopenharmony_ci - No "trivial" fixes without benefit for users (spelling changes, whitespace 3162306a36Sopenharmony_ci cleanups, etc). 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ciProcedure for submitting patches to the -stable tree 3562306a36Sopenharmony_ci---------------------------------------------------- 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci.. note:: 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ci Security patches should not be handled (solely) by the -stable review 4062306a36Sopenharmony_ci process but should follow the procedures in 4162306a36Sopenharmony_ci :ref:`Documentation/process/security-bugs.rst <securitybugs>`. 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ciThere are three options to submit a change to -stable trees: 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci 1. Add a 'stable tag' to the description of a patch you then submit for 4662306a36Sopenharmony_ci mainline inclusion. 4762306a36Sopenharmony_ci 2. Ask the stable team to pick up a patch already mainlined. 4862306a36Sopenharmony_ci 3. Submit a patch to the stable team that is equivalent to a change already 4962306a36Sopenharmony_ci mainlined. 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ciThe sections below describe each of the options in more detail. 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci:ref:`option_1` is **strongly** preferred, it is the easiest and most common. 5462306a36Sopenharmony_ci:ref:`option_2` is mainly meant for changes where backporting was not considered 5562306a36Sopenharmony_ciat the time of submission. :ref:`option_3` is an alternative to the two earlier 5662306a36Sopenharmony_cioptions for cases where a mainlined patch needs adjustments to apply in older 5762306a36Sopenharmony_ciseries (for example due to API changes). 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ciWhen using option 2 or 3 you can ask for your change to be included in specific 6062306a36Sopenharmony_cistable series. When doing so, ensure the fix or an equivalent is applicable, 6162306a36Sopenharmony_cisubmitted, or already present in all newer stable trees still supported. This is 6262306a36Sopenharmony_cimeant to prevent regressions that users might later encounter on updating, if 6362306a36Sopenharmony_cie.g. a fix merged for 5.19-rc1 would be backported to 5.10.y, but not to 5.15.y. 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci.. _option_1: 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ciOption 1 6862306a36Sopenharmony_ci******** 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ciTo have a patch you submit for mainline inclusion later automatically picked up 7162306a36Sopenharmony_cifor stable trees, add the tag 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci.. code-block:: none 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci Cc: stable@vger.kernel.org 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ciin the sign-off area. Once the patch is mainlined it will be applied to the 7862306a36Sopenharmony_cistable tree without anything else needing to be done by the author or 7962306a36Sopenharmony_cisubsystem maintainer. 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ciTo sent additional instructions to the stable team, use a shell-style inline 8262306a36Sopenharmony_cicomment: 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ci * To specify any additional patch prerequisites for cherry picking use the 8562306a36Sopenharmony_ci following format in the sign-off area: 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci .. code-block:: none 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci Cc: <stable@vger.kernel.org> # 3.3.x: a1f84a3: sched: Check for idle 9062306a36Sopenharmony_ci Cc: <stable@vger.kernel.org> # 3.3.x: 1b9508f: sched: Rate-limit newidle 9162306a36Sopenharmony_ci Cc: <stable@vger.kernel.org> # 3.3.x: fd21073: sched: Fix affinity logic 9262306a36Sopenharmony_ci Cc: <stable@vger.kernel.org> # 3.3.x 9362306a36Sopenharmony_ci Signed-off-by: Ingo Molnar <mingo@elte.hu> 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci The tag sequence has the meaning of: 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci .. code-block:: none 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci git cherry-pick a1f84a3 10062306a36Sopenharmony_ci git cherry-pick 1b9508f 10162306a36Sopenharmony_ci git cherry-pick fd21073 10262306a36Sopenharmony_ci git cherry-pick <this commit> 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci * For patches that may have kernel version prerequisites specify them using 10562306a36Sopenharmony_ci the following format in the sign-off area: 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ci .. code-block:: none 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci Cc: <stable@vger.kernel.org> # 3.3.x 11062306a36Sopenharmony_ci 11162306a36Sopenharmony_ci The tag has the meaning of: 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci .. code-block:: none 11462306a36Sopenharmony_ci 11562306a36Sopenharmony_ci git cherry-pick <this commit> 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci For each "-stable" tree starting with the specified version. 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci Note, such tagging is unnecessary if the stable team can derive the 12062306a36Sopenharmony_ci appropriate versions from Fixes: tags. 12162306a36Sopenharmony_ci 12262306a36Sopenharmony_ci * To delay pick up of patches, use the following format: 12362306a36Sopenharmony_ci 12462306a36Sopenharmony_ci .. code-block:: none 12562306a36Sopenharmony_ci 12662306a36Sopenharmony_ci Cc: <stable@vger.kernel.org> # after 4 weeks in mainline 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci * For any other requests, just add a note to the stable tag. This for example 12962306a36Sopenharmony_ci can be used to point out known problems: 13062306a36Sopenharmony_ci 13162306a36Sopenharmony_ci .. code-block:: none 13262306a36Sopenharmony_ci 13362306a36Sopenharmony_ci Cc: <stable@vger.kernel.org> # see patch description, needs adjustments for <= 6.3 13462306a36Sopenharmony_ci 13562306a36Sopenharmony_ci.. _option_2: 13662306a36Sopenharmony_ci 13762306a36Sopenharmony_ciOption 2 13862306a36Sopenharmony_ci******** 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ciIf the patch already has been merged to mainline, send an email to 14162306a36Sopenharmony_cistable@vger.kernel.org containing the subject of the patch, the commit ID, 14262306a36Sopenharmony_ciwhy you think it should be applied, and what kernel versions you wish it to 14362306a36Sopenharmony_cibe applied to. 14462306a36Sopenharmony_ci 14562306a36Sopenharmony_ci.. _option_3: 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ciOption 3 14862306a36Sopenharmony_ci******** 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ciSend the patch, after verifying that it follows the above rules, to 15162306a36Sopenharmony_cistable@vger.kernel.org and mention the kernel versions you wish it to be applied 15262306a36Sopenharmony_cito. When doing so, you must note the upstream commit ID in the changelog of your 15362306a36Sopenharmony_cisubmission with a separate line above the commit text, like this: 15462306a36Sopenharmony_ci 15562306a36Sopenharmony_ci.. code-block:: none 15662306a36Sopenharmony_ci 15762306a36Sopenharmony_ci commit <sha1> upstream. 15862306a36Sopenharmony_ci 15962306a36Sopenharmony_cior alternatively: 16062306a36Sopenharmony_ci 16162306a36Sopenharmony_ci.. code-block:: none 16262306a36Sopenharmony_ci 16362306a36Sopenharmony_ci [ Upstream commit <sha1> ] 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ciIf the submitted patch deviates from the original upstream patch (for example 16662306a36Sopenharmony_cibecause it had to be adjusted for the older API), this must be very clearly 16762306a36Sopenharmony_cidocumented and justified in the patch description. 16862306a36Sopenharmony_ci 16962306a36Sopenharmony_ci 17062306a36Sopenharmony_ciFollowing the submission 17162306a36Sopenharmony_ci------------------------ 17262306a36Sopenharmony_ci 17362306a36Sopenharmony_ciThe sender will receive an ACK when the patch has been accepted into the 17462306a36Sopenharmony_ciqueue, or a NAK if the patch is rejected. This response might take a few 17562306a36Sopenharmony_cidays, according to the schedules of the stable team members. 17662306a36Sopenharmony_ci 17762306a36Sopenharmony_ciIf accepted, the patch will be added to the -stable queue, for review by other 17862306a36Sopenharmony_cidevelopers and by the relevant subsystem maintainer. 17962306a36Sopenharmony_ci 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ciReview cycle 18262306a36Sopenharmony_ci------------ 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_ci - When the -stable maintainers decide for a review cycle, the patches will be 18562306a36Sopenharmony_ci sent to the review committee, and the maintainer of the affected area of 18662306a36Sopenharmony_ci the patch (unless the submitter is the maintainer of the area) and CC: to 18762306a36Sopenharmony_ci the linux-kernel mailing list. 18862306a36Sopenharmony_ci - The review committee has 48 hours in which to ACK or NAK the patch. 18962306a36Sopenharmony_ci - If the patch is rejected by a member of the committee, or linux-kernel 19062306a36Sopenharmony_ci members object to the patch, bringing up issues that the maintainers and 19162306a36Sopenharmony_ci members did not realize, the patch will be dropped from the queue. 19262306a36Sopenharmony_ci - The ACKed patches will be posted again as part of release candidate (-rc) 19362306a36Sopenharmony_ci to be tested by developers and testers. 19462306a36Sopenharmony_ci - Usually only one -rc release is made, however if there are any outstanding 19562306a36Sopenharmony_ci issues, some patches may be modified or dropped or additional patches may 19662306a36Sopenharmony_ci be queued. Additional -rc releases are then released and tested until no 19762306a36Sopenharmony_ci issues are found. 19862306a36Sopenharmony_ci - Responding to the -rc releases can be done on the mailing list by sending 19962306a36Sopenharmony_ci a "Tested-by:" email with any testing information desired. The "Tested-by:" 20062306a36Sopenharmony_ci tags will be collected and added to the release commit. 20162306a36Sopenharmony_ci - At the end of the review cycle, the new -stable release will be released 20262306a36Sopenharmony_ci containing all the queued and tested patches. 20362306a36Sopenharmony_ci - Security patches will be accepted into the -stable tree directly from the 20462306a36Sopenharmony_ci security kernel team, and not go through the normal review cycle. 20562306a36Sopenharmony_ci Contact the kernel security team for more details on this procedure. 20662306a36Sopenharmony_ci 20762306a36Sopenharmony_ci 20862306a36Sopenharmony_ciTrees 20962306a36Sopenharmony_ci----- 21062306a36Sopenharmony_ci 21162306a36Sopenharmony_ci - The queues of patches, for both completed versions and in progress 21262306a36Sopenharmony_ci versions can be found at: 21362306a36Sopenharmony_ci 21462306a36Sopenharmony_ci https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git 21562306a36Sopenharmony_ci 21662306a36Sopenharmony_ci - The finalized and tagged releases of all stable kernels can be found 21762306a36Sopenharmony_ci in separate branches per version at: 21862306a36Sopenharmony_ci 21962306a36Sopenharmony_ci https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 22062306a36Sopenharmony_ci 22162306a36Sopenharmony_ci - The release candidate of all stable kernel versions can be found at: 22262306a36Sopenharmony_ci 22362306a36Sopenharmony_ci https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/ 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_ci .. warning:: 22662306a36Sopenharmony_ci The -stable-rc tree is a snapshot in time of the stable-queue tree and 22762306a36Sopenharmony_ci will change frequently, hence will be rebased often. It should only be 22862306a36Sopenharmony_ci used for testing purposes (e.g. to be consumed by CI systems). 22962306a36Sopenharmony_ci 23062306a36Sopenharmony_ci 23162306a36Sopenharmony_ciReview committee 23262306a36Sopenharmony_ci---------------- 23362306a36Sopenharmony_ci 23462306a36Sopenharmony_ci - This is made up of a number of kernel developers who have volunteered for 23562306a36Sopenharmony_ci this task, and a few that haven't. 236