Commit c48a7c44 authored by Vegard Nossum's avatar Vegard Nossum Committed by Jonathan Corbet
Browse files

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 3231dd58 ("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: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20240110174758.3680506-1-vegard.nossum@oracle.com
parent 1f4cac0f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

.. kernel-feat:: $srctree/Documentation/features
.. kernel-feat:: features
+1 −1
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

.. kernel-feat:: $srctree/Documentation/features arc
.. kernel-feat:: features arc
+1 −1
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

.. kernel-feat:: $srctree/Documentation/features arm
.. kernel-feat:: features arm
+1 −1
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

.. kernel-feat:: $srctree/Documentation/features arm64
.. kernel-feat:: features arm64
+1 −1
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

.. kernel-feat:: $srctree/Documentation/features loongarch
.. kernel-feat:: features loongarch
Loading