Commit 7a0104c
committed
Harden Linux process/OS metadata reporting
Follow-ups from the Linux backend soundness audit:
- Decode the waitpid(2)-style status word from /proc/<pid>/stat into a
real exit code in Process::state(): normal exits report the exit(3)
code, signal deaths report the negated signal number. Previously the
raw status word leaked through (exit(3) surfaced as Dead(768)).
- Derive OsInfo.arch and ProcessInfo::{sys_arch,proc_arch} from the
compile target (x86_64/x86/aarch64) instead of hardcoding x86-64, and
make the process module list callback emit the same arch field that
module_by_address keys on.
- Replace OS kernel-module handles (indices into a name-sorted snapshot
that shift on module load/unload) with a stable hash of the module
name (std DefaultHasher, fixed-seeded), resolved against the live
snapshot.
- Report the real process state in process_info_by_pid via the shared
process_state() helper instead of hardcoding Alive.1 parent cbe66e3 commit 7a0104c
2 files changed
Lines changed: 121 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
17 | 66 | | |
18 | 67 | | |
19 | 68 | | |
| |||
46 | 95 | | |
47 | 96 | | |
48 | 97 | | |
49 | | - | |
| 98 | + | |
50 | 99 | | |
51 | 100 | | |
52 | 101 | | |
| |||
108 | 157 | | |
109 | 158 | | |
110 | 159 | | |
| 160 | + | |
| 161 | + | |
111 | 162 | | |
112 | 163 | | |
113 | 164 | | |
114 | 165 | | |
115 | 166 | | |
116 | 167 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
120 | 171 | | |
121 | 172 | | |
122 | 173 | | |
| |||
145 | 196 | | |
146 | 197 | | |
147 | 198 | | |
148 | | - | |
149 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
150 | 202 | | |
151 | 203 | | |
152 | 204 | | |
| |||
161 | 213 | | |
162 | 214 | | |
163 | 215 | | |
164 | | - | |
| 216 | + | |
| 217 | + | |
165 | 218 | | |
166 | 219 | | |
167 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
150 | 185 | | |
151 | 186 | | |
152 | 187 | | |
| |||
171 | 206 | | |
172 | 207 | | |
173 | 208 | | |
174 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
175 | 212 | | |
176 | 213 | | |
177 | 214 | | |
| |||
264 | 301 | | |
265 | 302 | | |
266 | 303 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
| 304 | + | |
277 | 305 | | |
278 | 306 | | |
279 | 307 | | |
| |||
393 | 421 | | |
394 | 422 | | |
395 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
0 commit comments