1186128f7SMauro Carvalho Chehab.. _stable_kernel_rules: 2186128f7SMauro Carvalho Chehab 3186128f7SMauro Carvalho ChehabEverything you ever wanted to know about Linux -stable releases 4186128f7SMauro Carvalho Chehab=============================================================== 5186128f7SMauro Carvalho Chehab 6186128f7SMauro Carvalho ChehabRules on what kind of patches are accepted, and which ones are not, into the 7186128f7SMauro Carvalho Chehab"-stable" tree: 8186128f7SMauro Carvalho Chehab 92263c40eSThorsten Leemhuis- It or an equivalent fix must already exist in Linux mainline (upstream). 10186128f7SMauro Carvalho Chehab- It must be obviously correct and tested. 11186128f7SMauro Carvalho Chehab- It cannot be bigger than 100 lines, with context. 1233568553SThorsten Leemhuis- It must follow the 1333568553SThorsten Leemhuis :ref:`Documentation/process/submitting-patches.rst <submittingpatches>` 1433568553SThorsten Leemhuis rules. 1533568553SThorsten Leemhuis- It must either fix a real bug that bothers people or just add a device ID. 1633568553SThorsten Leemhuis To elaborate on the former: 1733568553SThorsten Leemhuis 1833568553SThorsten Leemhuis - It fixes a problem like an oops, a hang, data corruption, a real security 1933568553SThorsten Leemhuis issue, a hardware quirk, a build error (but not for things marked 2033568553SThorsten Leemhuis CONFIG_BROKEN), or some "oh, that's not good" issue. 21186128f7SMauro Carvalho Chehab - Serious issues as reported by a user of a distribution kernel may also 22186128f7SMauro Carvalho Chehab be considered if they fix a notable performance or interactivity issue. 23186128f7SMauro Carvalho Chehab As these fixes are not as obvious and have a higher risk of a subtle 24186128f7SMauro Carvalho Chehab regression they should only be submitted by a distribution kernel 25186128f7SMauro Carvalho Chehab maintainer and include an addendum linking to a bugzilla entry if it 26186128f7SMauro Carvalho Chehab exists and additional information on the user-visible impact. 2733568553SThorsten Leemhuis - No "This could be a problem..." type of things like a "theoretical race 2833568553SThorsten Leemhuis condition", unless an explanation of how the bug can be exploited is also 2933568553SThorsten Leemhuis provided. 3033568553SThorsten Leemhuis - No "trivial" fixes without benefit for users (spelling changes, whitespace 3133568553SThorsten Leemhuis cleanups, etc). 32186128f7SMauro Carvalho Chehab 336e160d29SThorsten Leemhuis 34186128f7SMauro Carvalho ChehabProcedure for submitting patches to the -stable tree 35186128f7SMauro Carvalho Chehab---------------------------------------------------- 36186128f7SMauro Carvalho Chehab 37615f3eeaSBagas Sanjaya.. note:: 38615f3eeaSBagas Sanjaya 39615f3eeaSBagas Sanjaya Security patches should not be handled (solely) by the -stable review 40186128f7SMauro Carvalho Chehab process but should follow the procedures in 4144ac5abaSVegard Nossum :ref:`Documentation/process/security-bugs.rst <securitybugs>`. 42186128f7SMauro Carvalho Chehab 430f11447dSThorsten LeemhuisThere are three options to submit a change to -stable trees: 44186128f7SMauro Carvalho Chehab 456e160d29SThorsten Leemhuis1. Add a 'stable tag' to the description of a patch you then submit for 466e160d29SThorsten Leemhuis mainline inclusion. 476e160d29SThorsten Leemhuis2. Ask the stable team to pick up a patch already mainlined. 486e160d29SThorsten Leemhuis3. Submit a patch to the stable team that is equivalent to a change already 496e160d29SThorsten Leemhuis mainlined. 506e160d29SThorsten Leemhuis 516e160d29SThorsten LeemhuisThe sections below describe each of the options in more detail. 526e160d29SThorsten Leemhuis 536e160d29SThorsten Leemhuis:ref:`option_1` is **strongly** preferred, it is the easiest and most common. 546e160d29SThorsten Leemhuis:ref:`option_2` is mainly meant for changes where backporting was not considered 556e160d29SThorsten Leemhuisat the time of submission. :ref:`option_3` is an alternative to the two earlier 566e160d29SThorsten Leemhuisoptions for cases where a mainlined patch needs adjustments to apply in older 576e160d29SThorsten Leemhuisseries (for example due to API changes). 583feb21bbSThorsten Leemhuis 59bbaee49cSThorsten LeemhuisWhen using option 2 or 3 you can ask for your change to be included in specific 60bbaee49cSThorsten Leemhuisstable series. When doing so, ensure the fix or an equivalent is applicable, 61bbaee49cSThorsten Leemhuissubmitted, or already present in all newer stable trees still supported. This is 62bbaee49cSThorsten Leemhuismeant to prevent regressions that users might later encounter on updating, if 63bbaee49cSThorsten Leemhuise.g. a fix merged for 5.19-rc1 would be backported to 5.10.y, but not to 5.15.y. 64bbaee49cSThorsten Leemhuis 65186128f7SMauro Carvalho Chehab.. _option_1: 66186128f7SMauro Carvalho Chehab 67186128f7SMauro Carvalho ChehabOption 1 68186128f7SMauro Carvalho Chehab******** 69186128f7SMauro Carvalho Chehab 706e160d29SThorsten LeemhuisTo have a patch you submit for mainline inclusion later automatically picked up 715db34f5bSThorsten Leemhuisfor stable trees, add this tag in the sign-off area:: 72186128f7SMauro Carvalho Chehab 73186128f7SMauro Carvalho Chehab Cc: [email protected] 74186128f7SMauro Carvalho Chehab 75bb127995SThorsten LeemhuisUse ``Cc: [email protected]`` instead when fixing unpublished vulnerabilities: 76bb127995SThorsten Leemhuisit reduces the chance of accidentally exposing the fix to the public by way of 77bb127995SThorsten Leemhuis'git send-email', as mails sent to that address are not delivered anywhere. 78bb127995SThorsten Leemhuis 795db34f5bSThorsten LeemhuisOnce the patch is mainlined it will be applied to the stable tree without 805db34f5bSThorsten Leemhuisanything else needing to be done by the author or subsystem maintainer. 81186128f7SMauro Carvalho Chehab 82*10466b17SBird, TimTo send additional instructions to the stable team, use a shell-style inline 83db483303SThorsten Leemhuiscomment to pass arbitrary or predefined notes: 84189057a1SThorsten Leemhuis 855db34f5bSThorsten Leemhuis* Specify any additional patch prerequisites for cherry picking:: 86186128f7SMauro Carvalho Chehab 87186128f7SMauro Carvalho Chehab Cc: <[email protected]> # 3.3.x: a1f84a3: sched: Check for idle 88186128f7SMauro Carvalho Chehab Cc: <[email protected]> # 3.3.x: 1b9508f: sched: Rate-limit newidle 89186128f7SMauro Carvalho Chehab Cc: <[email protected]> # 3.3.x: fd21073: sched: Fix affinity logic 90186128f7SMauro Carvalho Chehab Cc: <[email protected]> # 3.3.x 91186128f7SMauro Carvalho Chehab Signed-off-by: Ingo Molnar <[email protected]> 92186128f7SMauro Carvalho Chehab 935db34f5bSThorsten Leemhuis The tag sequence has the meaning of:: 94186128f7SMauro Carvalho Chehab 95186128f7SMauro Carvalho Chehab git cherry-pick a1f84a3 96186128f7SMauro Carvalho Chehab git cherry-pick 1b9508f 97186128f7SMauro Carvalho Chehab git cherry-pick fd21073 98186128f7SMauro Carvalho Chehab git cherry-pick <this commit> 99186128f7SMauro Carvalho Chehab 1004f013424SHugo Villeneuve Note that for a patch series, you do not have to list as prerequisites the 1014f013424SHugo Villeneuve patches present in the series itself. For example, if you have the following 1025db34f5bSThorsten Leemhuis patch series:: 1034f013424SHugo Villeneuve 1044f013424SHugo Villeneuve patch1 1054f013424SHugo Villeneuve patch2 1064f013424SHugo Villeneuve 1074f013424SHugo Villeneuve where patch2 depends on patch1, you do not have to list patch1 as 1084f013424SHugo Villeneuve prerequisite of patch2 if you have already marked patch1 for stable 1094f013424SHugo Villeneuve inclusion. 1104f013424SHugo Villeneuve 1115db34f5bSThorsten Leemhuis* Point out kernel version prerequisites:: 112186128f7SMauro Carvalho Chehab 113cf903e9dSJohan Hovold Cc: <[email protected]> # 3.3.x 114186128f7SMauro Carvalho Chehab 1155db34f5bSThorsten Leemhuis The tag has the meaning of:: 116186128f7SMauro Carvalho Chehab 117186128f7SMauro Carvalho Chehab git cherry-pick <this commit> 118186128f7SMauro Carvalho Chehab 119186128f7SMauro Carvalho Chehab For each "-stable" tree starting with the specified version. 120186128f7SMauro Carvalho Chehab 1216e160d29SThorsten Leemhuis Note, such tagging is unnecessary if the stable team can derive the 1226e160d29SThorsten Leemhuis appropriate versions from Fixes: tags. 1236e160d29SThorsten Leemhuis 1245db34f5bSThorsten Leemhuis* Delay pick up of patches:: 125d0bde9caSThorsten Leemhuis 1262263c40eSThorsten Leemhuis Cc: <[email protected]> # after -rc3 127d0bde9caSThorsten Leemhuis 1285db34f5bSThorsten Leemhuis* Point out known problems:: 129d0bde9caSThorsten Leemhuis 1306e160d29SThorsten Leemhuis Cc: <[email protected]> # see patch description, needs adjustments for <= 6.3 131d0bde9caSThorsten Leemhuis 132af3e4a5aSThorsten LeemhuisThere furthermore is a variant of the stable tag you can use to make the stable 133af3e4a5aSThorsten Leemhuisteam's backporting tools (e.g AUTOSEL or scripts that look for commits 134af3e4a5aSThorsten Leemhuiscontaining a 'Fixes:' tag) ignore a change:: 135af3e4a5aSThorsten Leemhuis 136af3e4a5aSThorsten Leemhuis Cc: <[email protected]> # reason goes here, and must be present 137af3e4a5aSThorsten Leemhuis 1383feb21bbSThorsten Leemhuis.. _option_2: 1393feb21bbSThorsten Leemhuis 1403feb21bbSThorsten LeemhuisOption 2 1413feb21bbSThorsten Leemhuis******** 1423feb21bbSThorsten Leemhuis 1436e160d29SThorsten LeemhuisIf the patch already has been merged to mainline, send an email to 1443feb21bbSThorsten Leemhuis[email protected] containing the subject of the patch, the commit ID, 145bbaee49cSThorsten Leemhuiswhy you think it should be applied, and what kernel versions you wish it to 1463feb21bbSThorsten Leemhuisbe applied to. 1473feb21bbSThorsten Leemhuis 1483feb21bbSThorsten Leemhuis.. _option_3: 1493feb21bbSThorsten Leemhuis 1503feb21bbSThorsten LeemhuisOption 3 1513feb21bbSThorsten Leemhuis******** 1523feb21bbSThorsten Leemhuis 1533feb21bbSThorsten LeemhuisSend the patch, after verifying that it follows the above rules, to 154bbaee49cSThorsten Leemhuis[email protected] and mention the kernel versions you wish it to be applied 1556e160d29SThorsten Leemhuisto. When doing so, you must note the upstream commit ID in the changelog of your 1565db34f5bSThorsten Leemhuissubmission with a separate line above the commit text, like this:: 1573feb21bbSThorsten Leemhuis 1583feb21bbSThorsten Leemhuis commit <sha1> upstream. 1593feb21bbSThorsten Leemhuis 1605db34f5bSThorsten LeemhuisOr alternatively:: 1613feb21bbSThorsten Leemhuis 1623feb21bbSThorsten Leemhuis [ Upstream commit <sha1> ] 1633feb21bbSThorsten Leemhuis 1646e160d29SThorsten LeemhuisIf the submitted patch deviates from the original upstream patch (for example 1656e160d29SThorsten Leemhuisbecause it had to be adjusted for the older API), this must be very clearly 1666e160d29SThorsten Leemhuisdocumented and justified in the patch description. 1676e160d29SThorsten Leemhuis 1686e160d29SThorsten Leemhuis 1690f11447dSThorsten LeemhuisFollowing the submission 1700f11447dSThorsten Leemhuis------------------------ 171186128f7SMauro Carvalho Chehab 1720f11447dSThorsten LeemhuisThe sender will receive an ACK when the patch has been accepted into the 173186128f7SMauro Carvalho Chehabqueue, or a NAK if the patch is rejected. This response might take a few 1746e160d29SThorsten Leemhuisdays, according to the schedules of the stable team members. 1750f11447dSThorsten Leemhuis 1760f11447dSThorsten LeemhuisIf accepted, the patch will be added to the -stable queue, for review by other 1770f11447dSThorsten Leemhuisdevelopers and by the relevant subsystem maintainer. 178186128f7SMauro Carvalho Chehab 179186128f7SMauro Carvalho Chehab 180186128f7SMauro Carvalho ChehabReview cycle 181186128f7SMauro Carvalho Chehab------------ 182186128f7SMauro Carvalho Chehab 183186128f7SMauro Carvalho Chehab- When the -stable maintainers decide for a review cycle, the patches will be 184186128f7SMauro Carvalho Chehab sent to the review committee, and the maintainer of the affected area of 185186128f7SMauro Carvalho Chehab the patch (unless the submitter is the maintainer of the area) and CC: to 186186128f7SMauro Carvalho Chehab the linux-kernel mailing list. 187186128f7SMauro Carvalho Chehab- The review committee has 48 hours in which to ACK or NAK the patch. 188186128f7SMauro Carvalho Chehab- If the patch is rejected by a member of the committee, or linux-kernel 189186128f7SMauro Carvalho Chehab members object to the patch, bringing up issues that the maintainers and 190186128f7SMauro Carvalho Chehab members did not realize, the patch will be dropped from the queue. 19188d99e87SBagas Sanjaya- The ACKed patches will be posted again as part of release candidate (-rc) 19288d99e87SBagas Sanjaya to be tested by developers and testers. 19388d99e87SBagas Sanjaya- Usually only one -rc release is made, however if there are any outstanding 19488d99e87SBagas Sanjaya issues, some patches may be modified or dropped or additional patches may 19588d99e87SBagas Sanjaya be queued. Additional -rc releases are then released and tested until no 19688d99e87SBagas Sanjaya issues are found. 19788d99e87SBagas Sanjaya- Responding to the -rc releases can be done on the mailing list by sending 19888d99e87SBagas Sanjaya a "Tested-by:" email with any testing information desired. The "Tested-by:" 19988d99e87SBagas Sanjaya tags will be collected and added to the release commit. 20088d99e87SBagas Sanjaya- At the end of the review cycle, the new -stable release will be released 20188d99e87SBagas Sanjaya containing all the queued and tested patches. 202186128f7SMauro Carvalho Chehab- Security patches will be accepted into the -stable tree directly from the 203186128f7SMauro Carvalho Chehab security kernel team, and not go through the normal review cycle. 204186128f7SMauro Carvalho Chehab Contact the kernel security team for more details on this procedure. 205186128f7SMauro Carvalho Chehab 2066e160d29SThorsten Leemhuis 207186128f7SMauro Carvalho ChehabTrees 208186128f7SMauro Carvalho Chehab----- 209186128f7SMauro Carvalho Chehab 210186128f7SMauro Carvalho Chehab- The queues of patches, for both completed versions and in progress 211186128f7SMauro Carvalho Chehab versions can be found at: 212186128f7SMauro Carvalho Chehab 213c1aa3871SAndrii Bordunov https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git 214186128f7SMauro Carvalho Chehab 215186128f7SMauro Carvalho Chehab- The finalized and tagged releases of all stable kernels can be found 216186128f7SMauro Carvalho Chehab in separate branches per version at: 217186128f7SMauro Carvalho Chehab 218555d4493SBagas Sanjaya https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 219186128f7SMauro Carvalho Chehab 220587d39b2SBagas Sanjaya- The release candidate of all stable kernel versions can be found at: 221587d39b2SBagas Sanjaya 222587d39b2SBagas Sanjaya https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/ 223587d39b2SBagas Sanjaya 224587d39b2SBagas Sanjaya .. warning:: 225587d39b2SBagas Sanjaya The -stable-rc tree is a snapshot in time of the stable-queue tree and 226587d39b2SBagas Sanjaya will change frequently, hence will be rebased often. It should only be 227587d39b2SBagas Sanjaya used for testing purposes (e.g. to be consumed by CI systems). 228587d39b2SBagas Sanjaya 229186128f7SMauro Carvalho Chehab 230186128f7SMauro Carvalho ChehabReview committee 231186128f7SMauro Carvalho Chehab---------------- 232186128f7SMauro Carvalho Chehab 233186128f7SMauro Carvalho Chehab- This is made up of a number of kernel developers who have volunteered for 234186128f7SMauro Carvalho Chehab this task, and a few that haven't. 235