Re: [PATCH 3/5] fs: Add DEFINE_FREE for struct inode

2023-12-05 Thread Christian Brauner
On Sat, Dec 02, 2023 at 01:34:32PM -0800, Kees Cook wrote: > On Sat, Dec 02, 2023 at 09:28:46PM +, Al Viro wrote: > > On Sat, Dec 02, 2023 at 01:22:13PM -0800, Kees Cook wrote: > > > Allow __free(iput) markings for easier cleanup on inode allocations. > > > > NAK. That's a bloody awful idea f

Re: [PATCH 3/5] fs: Add DEFINE_FREE for struct inode

2023-12-02 Thread Al Viro
On Sat, Dec 02, 2023 at 09:42:12PM +, Al Viro wrote: > I'll poke around and see what I can suggest; said that, one thing I have > spotted there on the quick look is that you are exposing hashed dentry > associated > with your inode before you set its ->i_private. ... and on the second look,

Re: [PATCH 3/5] fs: Add DEFINE_FREE for struct inode

2023-12-02 Thread Al Viro
On Sat, Dec 02, 2023 at 01:34:32PM -0800, Kees Cook wrote: > On Sat, Dec 02, 2023 at 09:28:46PM +, Al Viro wrote: > > On Sat, Dec 02, 2023 at 01:22:13PM -0800, Kees Cook wrote: > > > Allow __free(iput) markings for easier cleanup on inode allocations. > > > > NAK. That's a bloody awful idea f

Re: [PATCH 3/5] fs: Add DEFINE_FREE for struct inode

2023-12-02 Thread Kees Cook
On Sat, Dec 02, 2023 at 09:28:46PM +, Al Viro wrote: > On Sat, Dec 02, 2023 at 01:22:13PM -0800, Kees Cook wrote: > > Allow __free(iput) markings for easier cleanup on inode allocations. > > NAK. That's a bloody awful idea for that particular data type, since > 1) ERR_PTR(...) is not un

Re: [PATCH 3/5] fs: Add DEFINE_FREE for struct inode

2023-12-02 Thread Al Viro
On Sat, Dec 02, 2023 at 01:22:13PM -0800, Kees Cook wrote: > Allow __free(iput) markings for easier cleanup on inode allocations. NAK. That's a bloody awful idea for that particular data type, since 1) ERR_PTR(...) is not uncommon and passing it to iput() is a bug. 2) the common p

[PATCH 3/5] fs: Add DEFINE_FREE for struct inode

2023-12-02 Thread Kees Cook
Allow __free(iput) markings for easier cleanup on inode allocations. Cc: Christian Brauner Cc: Peter Zijlstra (Intel) Cc: Alexander Viro Cc: linux-fsde...@vger.kernel.org Signed-off-by: Kees Cook --- include/linux/fs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/fs.h b