libublksrv: support un-privileged ublk dev
For supporting un-privileged ublk device, the system or administrator
needs to do the following things by using two udev rules:
1) chmod 666 /dev/ublk-control
2) after /dev/ublkcN and /dev/ublkbN are added, change the owner into
the user which owns the two device, and owner uid/gid is passed to
ADD_DEV command, and udev rule can retrieve owner uid/gid info via
one small ublk utility.
After /dev/ublk-control is available for everyone, except for ADD_DEV
command, all others are only allowed for the owner of the specified
/dev/ublkcN, so user have to provide path of ublkcN in command payload
buffer, then kernel can verify if the user is permitted to send the
control command.
Signed-off-by: Ming Lei <[email protected]>
6 files changed