Hi Jonathan, On Tue, Jan 03, 2023 at 01:35:14PM -0700, Jonathan Corbet wrote: > I have one quick question... > > Ming Lei <ming.lei@xxxxxxxxxx> writes: > > > In case of UBLK_F_UNPRIVILEGED_DEV: > > > > 1) for command UBLK_CMD_ADD_DEV, it is always allowed, and user needs > > to provide owner's uid/gid in this command, so that udev can set correct > > ownership for the created ublk device, since the device owner uid/gid > > can be queried via command of UBLK_CMD_GET_DEV_INFO. > > Why do you have the user provide the uid/gid rather than just using the > user's credentials directly? It seems a bit strange to me to let > unprivileged users create devices with arbitrary ownership. What am I > missing here? It is one good question. The original idea is to allow user A to create device for another user B, and it still depends on user A's capability, such as, if the created daemon can open the created device which is owned by user B actually. The above behavior may be extended in future if there is such requirement. I will switch to just allow to create device for the current user in V4, then we can start with this easy/simple model. BTW, that is exactly the current userspace implementation, only the current uid/gid is passed. https://github.com/ming1/ubdsrv/tree/unprivileged-ublk Thanks, Ming