Commit 336d4b8
committed
ptrace: Move setting/clearing ptrace_message into ptrace_stop
Today ptrace_message is easy to overlook as it not a core part of
ptrace_stop. It has been overlooked so much that there are places
that set ptrace_message and don't clear it, and places that never set
it. So if you get an unlucky sequence of events the ptracer may be
able to read a ptrace_message that does not apply to the current
ptrace stop.
Move setting of ptrace_message into ptrace_stop so that it always gets
set before the stop, and always gets cleared after the stop. This
prevents non-sense from being reported to userspace and makes
ptrace_message more visible in the ptrace helper functions so that
kernel developers can see it.
Link: https://lkml.kernel.org/r/87bky67qfv.fsf_-_@email.froward.int.ebiederm.org
Acked-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>1 parent 355f841 commit 336d4b8
3 files changed
Lines changed: 16 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
| 158 | + | |
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
| |||
424 | 423 | | |
425 | 424 | | |
426 | 425 | | |
427 | | - | |
428 | | - | |
| 426 | + | |
429 | 427 | | |
430 | 428 | | |
431 | 429 | | |
| |||
437 | 435 | | |
438 | 436 | | |
439 | 437 | | |
440 | | - | |
441 | 438 | | |
442 | 439 | | |
443 | 440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2191 | 2191 | | |
2192 | 2192 | | |
2193 | 2193 | | |
2194 | | - | |
| 2194 | + | |
| 2195 | + | |
2195 | 2196 | | |
2196 | 2197 | | |
2197 | 2198 | | |
| |||
2237 | 2238 | | |
2238 | 2239 | | |
2239 | 2240 | | |
| 2241 | + | |
2240 | 2242 | | |
2241 | 2243 | | |
2242 | 2244 | | |
| |||
2315 | 2317 | | |
2316 | 2318 | | |
2317 | 2319 | | |
| 2320 | + | |
2318 | 2321 | | |
2319 | 2322 | | |
2320 | 2323 | | |
| |||
2327 | 2330 | | |
2328 | 2331 | | |
2329 | 2332 | | |
2330 | | - | |
| 2333 | + | |
2331 | 2334 | | |
2332 | 2335 | | |
2333 | 2336 | | |
| |||
2338 | 2341 | | |
2339 | 2342 | | |
2340 | 2343 | | |
2341 | | - | |
| 2344 | + | |
2342 | 2345 | | |
2343 | 2346 | | |
2344 | | - | |
| 2347 | + | |
2345 | 2348 | | |
2346 | 2349 | | |
2347 | 2350 | | |
2348 | 2351 | | |
2349 | 2352 | | |
2350 | 2353 | | |
2351 | | - | |
| 2354 | + | |
2352 | 2355 | | |
2353 | 2356 | | |
2354 | 2357 | | |
| |||
2504 | 2507 | | |
2505 | 2508 | | |
2506 | 2509 | | |
2507 | | - | |
| 2510 | + | |
2508 | 2511 | | |
2509 | 2512 | | |
2510 | | - | |
| 2513 | + | |
2511 | 2514 | | |
2512 | 2515 | | |
2513 | 2516 | | |
| |||
2561 | 2564 | | |
2562 | 2565 | | |
2563 | 2566 | | |
2564 | | - | |
| 2567 | + | |
2565 | 2568 | | |
2566 | 2569 | | |
2567 | 2570 | | |
| |||
2891 | 2894 | | |
2892 | 2895 | | |
2893 | 2896 | | |
2894 | | - | |
| 2897 | + | |
2895 | 2898 | | |
2896 | 2899 | | |
2897 | 2900 | | |
| |||
0 commit comments