Re: [PATCH 1/2] 9p: client_create/destroy: only call trans_mod->close after create
From: Dominique Martinet
Date: Tue Oct 04 2022 - 18:05:46 EST
Dominique Martinet wrote on Wed, Oct 05, 2022 at 06:51:13AM +0900:
> destroy code would incorrectly call close() if trans_mod exists after some
> hasty code cleanup: we need to make sure we only call close after create
>
> The new bool added to track this has been added in a hole of the struct
> and will not increase p9_client's size.
> It might be possible to do better with a bit more work, but that will
> have to do for now.
>
> Link: https://lkml.kernel.org/r/00000000000015ac7905e97ebaed@xxxxxxxxxx
> Reported-by: syzbot+67d13108d855f451cafc@xxxxxxxxxxxxxxxxxxxxxxxxx
> Reported-by: Leon Romanovsky <leon@xxxxxxxxxx>
> Fixes: 3ff51294a055 ("9p: p9_client_create: use p9_client_destroy on failure")
Oh... Fixing tags for stable made me notice this actually wasn't merged
into 5.19 unlike what I thought, so we only have the original bug of
potentially freeing the idr with tags still in it.
That's a much smaller bug and I'll just remove the first
p9_client_destroy on failure patch for this merge window (small leak
that requires root on error) ; then we can take time to properly fix
this one way or another for next cycle.
--
Dominique