Blame SOURCES/bcc-0.25.0-Fix-get_kprobe_functions.patch

6fc629
From c27899b15bca6188d34c0b87b3389eeda2a90cb5 Mon Sep 17 00:00:00 2001
6fc629
From: Jerome Marchand <jmarchan@redhat.com>
6fc629
Date: Mon, 9 Jan 2023 18:17:20 +0100
6fc629
Subject: [PATCH] Fix get_kprobe_functions
6fc629
6fc629
get_kprobe_functions will not only return a function that matches the
6fc629
regular expression, but also any function that starts with a
6fc629
substrings that matches it. This is obviously not the intended
6fc629
behavior.
6fc629
The issue is easily fixed by replacing re.match by re.fullmatch.
6fc629
---
6fc629
 src/python/bcc/__init__.py | 2 +-
6fc629
 1 file changed, 1 insertion(+), 1 deletion(-)
6fc629
6fc629
diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py
6fc629
index 7175b98e..970ddcc2 100644
6fc629
--- a/src/python/bcc/__init__.py
6fc629
+++ b/src/python/bcc/__init__.py
6fc629
@@ -745,7 +745,7 @@ DEBUG_BTF = 0x20
6fc629
                 # Exclude all gcc 8's extra .cold functions
6fc629
                 elif re.match(b'^.*\.cold(\.\d+)?$', fn):
6fc629
                     continue
6fc629
-                if (t.lower() in [b't', b'w']) and re.match(event_re, fn) \
6fc629
+                if (t.lower() in [b't', b'w']) and re.fullmatch(event_re, fn) \
6fc629
                     and fn not in blacklist:
6fc629
                     fns.append(fn)
6fc629
         return set(fns)     # Some functions may appear more than once
6fc629
-- 
6fc629
2.38.1
6fc629