Re: [PATCH blktests] nvme/046: add test for unprivileged passthrough

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 09, 2023 / 15:15, Kanchan Joshi wrote:
> Ths creates a non-root user "blktest46", alters permissions for
> char-device node (/dev/ngX) and runs few passthrough commands.
> At the end of the test, user is deleted and permissions are reverted.
> 
> Signed-off-by: Kanchan Joshi <joshi.k@xxxxxxxxxxx>

Thanks for the patch. I guess this test case exercises nvme_cmd_allowed() in
drivers/nvme/host/ioctl.c. The test contents look valid and good.

This test case adds and deletes a user. For every test case run, it creates and
removes the user home directory and touches /etc files. It does not sound right
for me. It changes system set up, and sudden test case stop will leave the user.

I suggest to ask blktests users to prepare the normal user and specify it to a
config file variable (it can be named NORMAL_USER or something). I also suggest
to add two new helper functions: _require_user() will check that the specified
user is valid, and _run_user() will wrap the "su $NORMAL_USER -c" command line.

If you don't mind, I can create another patch for further discussion based on
the suggestion above, and modify your patch to use the new helper functions.

-- 
Shin'ichiro Kawasaki



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux