Re: [PATCH] usb: roles: fix a potential use after free
From: Heikki Krogerus
Date: Tue Nov 26 2019 - 10:51:05 EST
On Tue, Nov 26, 2019 at 05:49:17PM +0200, Heikki Krogerus wrote:
> On Sun, Nov 24, 2019 at 10:22:36PM +0800, Wen Yang wrote:
> > Free the sw structure only after we are done using it.
> > This patch just moves the put_device() down a bit to avoid the
> > use after free.
> >
> > Fixes: 5c54fcac9a9d ("usb: roles: Take care of driver module reference counting")
> > Signed-off-by: Wen Yang <wenyang@xxxxxxxxxxxxxxxxx>
> > Cc: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> > Cc: Hans de Goede <hdegoede@xxxxxxxxxx>
> > Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> > Cc: Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx>
> > Cc: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
> > Cc: linux-usb@xxxxxxxxxxxxxxx
> > Cc: linux-kernel@xxxxxxxxxxxxxxx
Ups, sorry. I meant:
Reviewed-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
thanks,
--
heikki