Commit 75f5307
committed
tracing: fprobe events: Fix possible UAF on modules
JIRA: https://issues.redhat.com/browse/RHEL-86682
Conflicts: Context change from missing commit 8275637 ("tracing:
Adopt __free() and guard() for trace_fprobe.c")
commit dd94150
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date: Mon Mar 31 23:05:07 2025 +0900
tracing: fprobe events: Fix possible UAF on modules
Commit ac91052 ("tracing: tprobe-events: Fix leakage of module
refcount") moved try_module_get() from __find_tracepoint_module_cb()
to find_tracepoint() caller, but that introduced a possible UAF
because the module can be unloaded before try_module_get(). In this
case, the module object should be freed too. Thus, try_module_get()
does not only fail but may access to the freed object.
To avoid that, try_module_get() in __find_tracepoint_module_cb()
again.
Link: https://lore.kernel.org/all/174342990779.781946.9138388479067729366.stgit@devnote2/
Fixes: ac91052 ("tracing: tprobe-events: Fix leakage of module refcount")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>1 parent 631b6f5 commit 75f5307
1 file changed
+17
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
891 | | - | |
892 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
893 | 897 | | |
| 898 | + | |
| 899 | + | |
894 | 900 | | |
895 | 901 | | |
896 | 902 | | |
| |||
902 | 908 | | |
903 | 909 | | |
904 | 910 | | |
905 | | - | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
906 | 916 | | |
907 | 917 | | |
908 | 918 | | |
| |||
931 | 941 | | |
932 | 942 | | |
933 | 943 | | |
934 | | - | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
935 | 948 | | |
936 | 949 | | |
937 | 950 | | |
| |||
1167 | 1180 | | |
1168 | 1181 | | |
1169 | 1182 | | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | 1183 | | |
1176 | 1184 | | |
1177 | 1185 | | |
| |||
0 commit comments