Re: [RFC PATCH 1/5] misc: introduce FDBox

From: Greg Kroah-Hartman
Date: Fri Mar 07 2025 - 01:03:26 EST


One quick review note:

On Fri, Mar 07, 2025 at 12:57:35AM +0000, Pratyush Yadav wrote:
> +/**
> + * struct fdbox - A box of FDs.
> + * @name: Name of the box. Must be unique.
> + * @rwsem: Used to ensure exclusive access to the box during SEAL/UNSEAL
> + * operations.
> + * @dev: Backing device for the character device.
> + * @cdev: Character device which accepts ioctls from userspace.

You now have a structure that contains 2 different reference counts,
which is going to be impossible to handle properly. Which one defines
the lifetime of the object? That's not going to work, please fix.

thanks,

greg k-h