public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Jiaming Zhang <r772577952@gmail.com>
Cc: 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:26:41 +0200	[thread overview]
Message-ID: <2025101453-backboned-shine-17b8@gregkh> (raw)
In-Reply-To: <20251014040149.1031348-1-r772577952@gmail.com>

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:" :)

thanks,

greg k-h

  reply	other threads:[~2025-10-14  5:26 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 [this message]
2025-10-14  5:53       ` Takashi Iwai
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=2025101453-backboned-shine-17b8@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=broonie@kernel.org \
    --cc=cryolitia@uniontech.com \
    --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