Commit e3f16d6
riscv: ftrace: Properly acquire text_mutex to fix a race condition
As reported by lockdep, some patching was done without acquiring
text_mutex, so there could be a race when mapping the page to patch
since we use the same fixmap entry.
Reported-by: Han Gao <[email protected]>
Reported-by: Vivian Wang <[email protected]>
Reported-by: Yao Zi <[email protected]>
Closes: https://lore.kernel.org/linux-riscv/[email protected]/
Tested-by: Yao Zi <[email protected]>
Tested-by: Han Gao <[email protected]>
Reviewed-by: Masami Hiramatsu (Google) <[email protected]>
Signed-off-by: Alexandre Ghiti <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>1 parent 16d7436 commit e3f16d6
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
17 | 29 | | |
18 | 30 | | |
19 | 31 | | |
| |||
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
32 | | - | |
33 | 44 | | |
34 | 45 | | |
35 | | - | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| |||
149 | 159 | | |
150 | 160 | | |
151 | 161 | | |
| 162 | + | |
| 163 | + | |
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
| |||
157 | 169 | | |
158 | 170 | | |
159 | 171 | | |
160 | | - | |
161 | 172 | | |
162 | | - | |
163 | 173 | | |
164 | 174 | | |
165 | 175 | | |
| |||
0 commit comments