linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] scripts/get_abi: fix source path leak
@ 2023-12-31 23:59 Vegard Nossum
  2023-12-31 23:59 ` [RFC PATCH 2/2] docs: kernel_abi.py: fix command injection Vegard Nossum
  2024-01-03 21:02 ` [RFC PATCH 1/2] scripts/get_abi: fix source path leak Jonathan Corbet
  0 siblings, 2 replies; 3+ messages in thread
From: Vegard Nossum @ 2023-12-31 23:59 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Jonathan Corbet
  Cc: linux-doc, Vegard Nossum, Jani Nikula

The code currently leaks the absolute path of the ABI files into the
rendered documentation.

There exists code to prevent this, but it is not effective when an
absolute path is passed, which it is when $srctree is used.

I consider this to be a minimal, stop-gap fix; a better fix would strip
off the actual prefix instead of hacking it off with a regex.

Link: https://mastodon.social/@vegard/111677490643495163
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
 scripts/get_abi.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
index 0ffd5531242a..408bfd0216da 100755
--- a/scripts/get_abi.pl
+++ b/scripts/get_abi.pl
@@ -98,7 +98,7 @@ sub parse_abi {
 	$name =~ s,.*/,,;
 
 	my $fn = $file;
-	$fn =~ s,Documentation/ABI/,,;
+	$fn =~ s,.*Documentation/ABI/,,;
 
 	my $nametag = "File $fn";
 	$data{$nametag}->{what} = "File $name";
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-03 21:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-31 23:59 [RFC PATCH 1/2] scripts/get_abi: fix source path leak Vegard Nossum
2023-12-31 23:59 ` [RFC PATCH 2/2] docs: kernel_abi.py: fix command injection Vegard Nossum
2024-01-03 21:02 ` [RFC PATCH 1/2] scripts/get_abi: fix source path leak Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).