From: Takashi Iwai <tiwai@suse.de>
To: Jiaming Zhang <r772577952@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
broonie@kernel.org, cryolitia@uniontech.com,
linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org,
perex@perex.cz, pierre-louis.bossart@linux.dev,
quic_wcheng@quicinc.com, syzkaller@googlegroups.com,
tiwai@suse.com
Subject: Re: [PATCH] ALSA: usb-audio: Fix NULL pointer deference in try_to_register_card
Date: Tue, 14 Oct 2025 07:53:33 +0200 [thread overview]
Message-ID: <877bwy81wi.wl-tiwai@suse.de> (raw)
In-Reply-To: <2025101453-backboned-shine-17b8@gregkh>
On Tue, 14 Oct 2025 07:26:41 +0200,
Greg KH wrote:
>
> On Tue, Oct 14, 2025 at 12:01:49PM +0800, Jiaming Zhang wrote:
> > Hi Greg,
> >
> > Thanks for the guidance. You're right, the root cause of this issue is
> > that a USB audio device is created without a proper interface.
> >
> > To fix this issue, I added a check for the NULL return value in
> > try_to_register_card() before calling usb_interface_claimed().
> > I have tested patch with the reproducer on the latest version (v6.18-rc1),
> > the issue was not triggered again.
> >
> > Please let me know if any changes are needed.
> >
> > Best regards,
> > Jiaming Zhang
>
> Can you resend this without this text above the changelog comment?
>
> > ---
> >
> > In try_to_register_card(), the return value of usb_ifnum_to_if() is
> > passed directly to usb_interface_claimed() without a NULL check, which
> > will lead to a NULL pointer dereference when creating an invalid
> > USB audio device. Fix this by adding a check to ensure the interface
> > pointer is valid before passing it to usb_interface_claimed().
> >
> > Reported-by: Jiaming Zhang <r772577952@gmail.com>
> > Signed-off-by: Jiaming Zhang <r772577952@gmail.com>
>
> And as you authored this, no need for "Reported-by:" :)
Also try to point to a breaker commit via Fixes tag.
And, pointing to the bug report thread via Closes tag would be nicer,
too.
The code change itself looks good, so only those cosmetic things.
thanks,
Takashi
next prev parent reply other threads:[~2025-10-14 5:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-12 11:11 [Linux Kernel Bug] general protection fault in try_to_register_card Jiaming Zhang
2025-10-12 11:18 ` Greg KH
2025-10-14 4:01 ` [PATCH] ALSA: usb-audio: Fix NULL pointer deference " Jiaming Zhang
2025-10-14 5:26 ` Greg KH
2025-10-14 5:53 ` Takashi Iwai [this message]
2025-10-15 5:16 ` [PATCH v2 0/1] " Jiaming Zhang
2025-10-15 5:16 ` [PATCH v2 1/1] " Jiaming Zhang
2025-10-15 8:18 ` Takashi Iwai
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=877bwy81wi.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=broonie@kernel.org \
--cc=cryolitia@uniontech.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=quic_wcheng@quicinc.com \
--cc=r772577952@gmail.com \
--cc=syzkaller@googlegroups.com \
--cc=tiwai@suse.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