[lvc-project] [PATCH] usb: gadget: fix device data management error in gadgetfs_bind()

Greg Kroah-Hartman gregkh at linuxfoundation.org
Mon Aug 3 12:15:48 MSK 2026


On Mon, Aug 03, 2026 at 12:12:58PM +0300, Dmitry Antipov wrote:
> In 'gadgetfs_bind()', 'get_dev()' on appropriate 'struct dev_data'
> instance should be performed immediately after the pointer is stored.
> Otherwise an attempt to handle -ENOMEM later will issue an unbalanced
> 'put_dev()' in 'gadgetfs_unbind()', thus leading to UAF errors.
> 
> Reported-by: syzbot+6aa97991da41499aa852 at syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=6aa97991da41499aa852
> Cc: stable at vger.kernel.org
> Signed-off-by: Dmitry Antipov <dmantipov at yandex.ru>
> ---
>  drivers/usb/gadget/legacy/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

What commit id does this fix?

thanks,

greg k-h



More information about the lvc-project mailing list