Commit 47bdf1d
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: c2c8089 ("ublk: validate ublk server pid")
Signed-off-by: Seamus Connor <sconnor@purestorage.com>
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 07a1bc5 commit 47bdf1d
1 file changed
Lines changed: 34 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2885 | 2885 | | |
2886 | 2886 | | |
2887 | 2887 | | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
2888 | 2897 | | |
2889 | 2898 | | |
2890 | 2899 | | |
| |||
2953 | 2962 | | |
2954 | 2963 | | |
2955 | 2964 | | |
2956 | | - | |
| 2965 | + | |
2957 | 2966 | | |
2958 | 2967 | | |
2959 | 2968 | | |
| |||
2972 | 2981 | | |
2973 | 2982 | | |
2974 | 2983 | | |
2975 | | - | |
| 2984 | + | |
2976 | 2985 | | |
2977 | 2986 | | |
2978 | 2987 | | |
| |||
3320 | 3329 | | |
3321 | 3330 | | |
3322 | 3331 | | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
3323 | 3336 | | |
3324 | 3337 | | |
3325 | 3338 | | |
3326 | 3339 | | |
3327 | 3340 | | |
3328 | | - | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
3329 | 3358 | | |
3330 | 3359 | | |
3331 | 3360 | | |
| |||
3470 | 3499 | | |
3471 | 3500 | | |
3472 | 3501 | | |
3473 | | - | |
| 3502 | + | |
3474 | 3503 | | |
3475 | 3504 | | |
3476 | 3505 | | |
| |||
3481 | 3510 | | |
3482 | 3511 | | |
3483 | 3512 | | |
3484 | | - | |
| 3513 | + | |
3485 | 3514 | | |
3486 | 3515 | | |
3487 | 3516 | | |
| |||
0 commit comments