From: Takashi Iwai <tiwai@suse.de>
To: "Šerif Rami" <ramiserifpersia@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan Carpenter <dan.carpenter@linaro.org>,
lkp@intel.com
Subject: Re: [PATCH v2] ALSA: usb-audio: us144mkii: Fix null-deref in tascam_midi_in_urb_complete()
Date: Wed, 20 Aug 2025 07:33:21 +0200 [thread overview]
Message-ID: <87frdm8sm6.wl-tiwai@suse.de> (raw)
In-Reply-To: <20250819185133.10464-1-ramiserifpersia@gmail.com>
On Tue, 19 Aug 2025 20:51:33 +0200,
Šerif Rami wrote:
>
> Changes in v2:
> - Removed duplicate call to usb_put_urb() on submission failure.
> - Removed extra blank line after the function.
>
> The smatch tool reported a potential null pointer dereference in
> tascam_midi_in_urb_complete(). The 'tascam' variable, derived from
> 'urb->context', was checked for nullity in one place, but dereferenced
> without a check in several other places.
>
> This patch fixes the issue by adding a null check at the beginning of
> the function. If 'tascam' is null, the function now safely exits.
> This prevents any potential crashes from null pointer dereferences.
>
> It also fixes a latent bug where 'usb_put_urb()' could
> be called twice for the same URB on submission failure, which would
> lead to a use-after-free error.
>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/r/202508192109.lcMrINK1-lkp@intel.com/
> Signed-off-by: Šerif Rami <ramiserifpersia@gmail.com>
Applied now. Thanks.
Takashi
next prev parent reply other threads:[~2025-08-20 5:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 18:51 [PATCH v2] ALSA: usb-audio: us144mkii: Fix null-deref in tascam_midi_in_urb_complete() Šerif Rami
2025-08-20 5:33 ` Takashi Iwai [this message]
2025-08-20 6:44 ` Dan Carpenter
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=87frdm8sm6.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=lkp@intel.com \
--cc=perex@perex.cz \
--cc=ramiserifpersia@gmail.com \
--cc=sfr@canb.auug.org.au \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.