Commit bb77e83
ublk: fix ublksrv pid handling for pid namespaces
When ublksrv runs inside a pid namespace, START/END_RECOVERY compared
the stored init-ns tgid against the userspace pid (getpid vnr), so the
check failed and control ops could not proceed. Compare against the
caller’s init-ns tgid and store that value, then translate it back to
the caller’s pid namespace when reporting GET_DEV_INFO so ublk list
shows a sensible pid.
Testing: start/recover in a pid namespace; `ublk list` shows
reasonable pid values in init, child, and sibling namespaces.
Fixes: d37a224fc119 ("ublk: validate ublk server pid")
Signed-off-by: Seamus Connor <sconnor@purestorage.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>1 parent f962a4d commit bb77e83
1 file changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2946 | 2946 | | |
2947 | 2947 | | |
2948 | 2948 | | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
2949 | 2953 | | |
2950 | 2954 | | |
2951 | 2955 | | |
| |||
3313 | 3317 | | |
3314 | 3318 | | |
3315 | 3319 | | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
3316 | 3324 | | |
3317 | 3325 | | |
3318 | 3326 | | |
3319 | 3327 | | |
3320 | 3328 | | |
3321 | | - | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
3322 | 3346 | | |
3323 | 3347 | | |
3324 | 3348 | | |
| |||
3463 | 3487 | | |
3464 | 3488 | | |
3465 | 3489 | | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
3466 | 3494 | | |
3467 | 3495 | | |
3468 | 3496 | | |
| |||
0 commit comments