docs: kernel_feat.py: fix potential command injection
authorVegard Nossum <vegard.nossum@oracle.com>
Wed, 10 Jan 2024 17:47:58 +0000 (18:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:18:46 +0000 (16:18 -0800)
commite961f8c6966abbd486ff87549e29e53f3c69b685
tree438ec1fbd5f1c3833a0386a814195d9f015ebc9b
parentdb6e7e5fd442f05b48ada0ca43eac38d6ec92b80
docs: kernel_feat.py: fix potential command injection

[ Upstream commit c48a7c44a1d02516309015b6134c9bb982e17008 ]

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.

Link: https://fosstodon.org/@jani/111676532203641247
Reported-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20240110174758.3680506-1-vegard.nossum@oracle.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
20 files changed:
Documentation/admin-guide/features.rst
Documentation/arch/arc/features.rst
Documentation/arch/arm/features.rst
Documentation/arch/arm64/features.rst
Documentation/arch/loongarch/features.rst
Documentation/arch/m68k/features.rst
Documentation/arch/mips/features.rst
Documentation/arch/nios2/features.rst
Documentation/arch/openrisc/features.rst
Documentation/arch/parisc/features.rst
Documentation/arch/s390/features.rst
Documentation/arch/sh/features.rst
Documentation/arch/sparc/features.rst
Documentation/arch/x86/features.rst
Documentation/arch/xtensa/features.rst
Documentation/powerpc/features.rst
Documentation/riscv/features.rst
Documentation/sphinx/kernel_feat.py
Documentation/translations/zh_CN/arch/loongarch/features.rst
Documentation/translations/zh_CN/arch/mips/features.rst