Commit dd94150
committed
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>1 parent d24fa97 commit dd94150
1 file changed
Lines changed: 17 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
923 | | - | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
924 | 928 | | |
| 929 | + | |
| 930 | + | |
925 | 931 | | |
926 | 932 | | |
927 | 933 | | |
| |||
933 | 939 | | |
934 | 940 | | |
935 | 941 | | |
936 | | - | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
937 | 947 | | |
938 | 948 | | |
939 | 949 | | |
| |||
962 | 972 | | |
963 | 973 | | |
964 | 974 | | |
965 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
966 | 979 | | |
967 | 980 | | |
968 | 981 | | |
| |||
1169 | 1182 | | |
1170 | 1183 | | |
1171 | 1184 | | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | 1185 | | |
1178 | 1186 | | |
1179 | 1187 | | |
| |||
0 commit comments