Skip to contentSkip to conversation

FAILED: patch "[PATCH] docs: kernel_feat.py: fix potential command injection" failed to apply to 6.6-stable tree

PATCH [email protected] 1 participant 1 message Jan 18, 2024

Subsystems (16)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x c48a7c44a1d02516309015b6134c9bb982e17008
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024011831-refining-copilot-9b41@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..

Possible dependencies:

c48a7c44a1d0 ("docs: kernel_feat.py: fix potential command injection") f949cb759051 ("docs/zh_TW: update contents for zh_TW") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree") c9ad95adc096 ("docs: sparse: add sparse.rst to toctree")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From c48a7c44a1d02516309015b6134c9bb982e17008 Mon Sep 17 00:00:00 2001
From: Vegard Nossum <[email protected]>
Date: Wed, 10 Jan 2024 18:47:58 +0100
Subject: [PATCH] docs: kernel_feat.py: fix potential command injection

The kernel-feat directive passes its argument straight to the shell. This is unfortunate and unnecessary.

Let's always use paths relative to $srctree/Documentation/ and use subprocess.check_call() instead of subprocess.Popen(shell=True).

This also makes the code shorter.

This is analogous to commit 3231dd586277 ("docs: kernel_abi.py: fix command injection") where we did exactly the same thing for kernel_abi.py, somehow I completely missed this one.

Documentation/admin-guide/features.rst +1 -1
index 8c167082a84f..7651eca38227 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features
+.. kernel-feat:: features
Documentation/arch/arc/features.rst +1 -1
index b793583d688a..49ff446ff744 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features arc
+.. kernel-feat:: features arc
Documentation/arch/arm/features.rst +1 -1
index 7414ec03dd15..0e76aaf68eca 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features arm
+.. kernel-feat:: features arm
Documentation/arch/arm64/features.rst +1 -1
index dfa4cb3cd3ef..03321f4309d0 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features arm64
+.. kernel-feat:: features arm64
Documentation/arch/loongarch/features.rst +1 -1
index ebacade3ea45..009f44c7951f 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features loongarch
+.. kernel-feat:: features loongarch
Documentation/arch/m68k/features.rst +1 -1
index 5107a2119472..de7f0ccf7fc8 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features m68k
+.. kernel-feat:: features m68k
Documentation/arch/mips/features.rst +1 -1
index 1973d729b29a..6e0ffe3e7354 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features mips
+.. kernel-feat:: features mips
Documentation/arch/nios2/features.rst +1 -1
index 8449e63f69b2..89913810ccb5 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features nios2
+.. kernel-feat:: features nios2
Documentation/arch/openrisc/features.rst +1 -1
index 3f7c40d219f2..bae2e25adfd6 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features openrisc
+.. kernel-feat:: features openrisc
Documentation/arch/parisc/features.rst +1 -1
index 501d7c450037..b3aa4d243b93 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features parisc
+.. kernel-feat:: features parisc
Documentation/arch/powerpc/features.rst +1 -1
index aeae73df86b0..ee4b95e04202 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features powerpc
+.. kernel-feat:: features powerpc
Documentation/arch/riscv/features.rst +1 -1
index c70ef6ac2368..36e90144adab 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features riscv
+.. kernel-feat:: features riscv
Documentation/arch/s390/features.rst +1 -1
index 57c296a9d8f3..2883dc950681 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features s390
+.. kernel-feat:: features s390
Documentation/arch/sh/features.rst +1 -1
index f722af3b6c99..fae48fe81e9b 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features sh
+.. kernel-feat:: features sh
Documentation/arch/sparc/features.rst +1 -1
index c0c92468b0fe..96835b6d598a 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features sparc
+.. kernel-feat:: features sparc
Documentation/arch/x86/features.rst +1 -1
index b663f15053ce..a33616346a38 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features x86
+.. kernel-feat:: features x86
Documentation/arch/xtensa/features.rst +1 -1
index 6b92c7bfa19d..28dcce1759be 100644
@@ -1,3 +1,3 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-.. kernel-feat:: $srctree/Documentation/features xtensa
+.. kernel-feat:: features xtensa
Documentation/sphinx/kernel_feat.py +12 -45

83 lines not on this page · raw message

Documentation/translations/zh_CN/arch/loongarch/features.rst +1 -1
index 82bfac180bdc..cec38dda8298 100644
@@ -5,4 +5,4 @@
 :Original: Documentation/arch/loongarch/features.rst
 :Translator: Huacai Chen <[email protected]>
 
-.. kernel-feat:: $srctree/Documentation/features loongarch
+.. kernel-feat:: features loongarch
Documentation/translations/zh_CN/arch/mips/features.rst +1 -1
index da1b956e4a40..0d6df97db069 100644
@@ -10,4 +10,4 @@
 
 .. _cn_features:
 
-.. kernel-feat:: $srctree/Documentation/features mips
+.. kernel-feat:: features mips
Documentation/translations/zh_TW/arch/loongarch/features.rst +1 -1
index b64e430f55ae..c2175fd32b54 100644
@@ -5,5 +5,5 @@
 :Original: Documentation/arch/loongarch/features.rst
 :Translator: Huacai Chen <[email protected]>
 
-.. kernel-feat:: $srctree/Documentation/features loongarch
+.. kernel-feat:: features loongarch
 
Documentation/translations/zh_TW/arch/mips/features.rst +1 -1
index f69410420035..3d3906c4d08e 100644
@@ -10,5 +10,5 @@
 
 .. _tw_features:
 
-.. kernel-feat:: $srctree/Documentation/features mips
+.. kernel-feat:: features mips