Linux USB
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jeffin Philip <jeffinphilip14@gmail.com>
Cc: Frank.Li@nxp.com, kees@kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, panjunzhong@linux.spacemit.com,
	xu.yang_2@nxp.com,
	syzbot+8dcac923582c28505fd7@syzkaller.appspotmail.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v5] usb: gadget: uvc: Fix Null Pointer Dereference in uvcg_video_init()
Date: Thu, 30 Jul 2026 14:44:31 +0200	[thread overview]
Message-ID: <2026073005-shadiness-untracked-9efc@gregkh> (raw)
In-Reply-To: <20260730123941.8180-1-jeffinphilip14@gmail.com>

On Thu, Jul 30, 2026 at 06:09:41PM +0530, Jeffin Philip wrote:
> In uvcg_video_init(), if kthread_run_worker() fails,
> the error logged uses uvcg_err(), however, the pointer it uses:
> video->uvc is not assigned at this point, triggering a null
> pointer dereference. Fix this by directly using uvc->func which
> is assigned already.
> 
> Reported-by: syzbot+8dcac923582c28505fd7@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=8dcac923582c28505fd7
> Fixes: 7ea95b110811 ("usb: gadget: uvc: rename functions to avoid conflicts with host uvc")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jeffin Philip <jeffinphilip14@gmail.com>
> ---
> Changelog:
>  -Small fixes addressed in v4 discussion
>   https://lore.kernel.org/all/20260730093948.7800-1-jeffinphilip14@gmail.com/T/#u
> 
>  drivers/usb/gadget/function/uvc_video.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c
> index 2f9700b3f1b6..9ba09118bb74 100644
> --- a/drivers/usb/gadget/function/uvc_video.c
> +++ b/drivers/usb/gadget/function/uvc_video.c
> @@ -821,7 +821,7 @@ int uvcg_video_init(struct uvc_video *video, struct uvc_device *uvc)
>  	/* Allocate a kthread for asynchronous hw submit handler. */
>  	video->kworker = kthread_run_worker(0, "UVCG");
>  	if (IS_ERR(video->kworker)) {
> -		uvcg_err(&video->uvc->func, "failed to create UVCG kworker\n");
> +		uvcg_err(&uvc->func, "failed to create UVCG kworker\n");
>  		return PTR_ERR(video->kworker);
>  	}
> 
> --
> 2.55.0
> 

Dropped due to lack of following directions...

  reply	other threads:[~2026-07-30 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 12:39 [PATCH v5] usb: gadget: uvc: Fix Null Pointer Dereference in uvcg_video_init() Jeffin Philip
2026-07-30 12:44 ` Greg KH [this message]
2026-07-30 13:18   ` Jeffin Philip

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026073005-shadiness-untracked-9efc@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=Frank.Li@nxp.com \
    --cc=jeffinphilip14@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=panjunzhong@linux.spacemit.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+8dcac923582c28505fd7@syzkaller.appspotmail.com \
    --cc=xu.yang_2@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox