All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Xin Tan <tanxin.ctf@gmail.com>, "Geoffrey D. Bennett" <g@b4.vu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Colin Ian King <colin.king@canonical.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	yuanxzhang@fudan.edu.cn, kjlu@umn.edu
Subject: Re: [PATCH] ALSA: usb-audio: Fix usb audio refcnt leak when getting spdif
Date: Thu, 23 Apr 2020 09:11:10 +0200	[thread overview]
Message-ID: <s5h1roey8vl.wl-tiwai@suse.de> (raw)
In-Reply-To: <1587617711-13200-1-git-send-email-xiyuyang19@fudan.edu.cn>

On Thu, 23 Apr 2020 06:54:19 +0200,
Xiyu Yang wrote:
> 
> snd_microii_spdif_default_get() invokes snd_usb_lock_shutdown(), which
> increases the refcount of the snd_usb_audio object "chip".
> 
> When snd_microii_spdif_default_get() returns, local variable "chip"
> becomes invalid, so the refcount should be decreased to keep refcount
> balanced.
> 
> The reference counting issue happens in several exception handling paths
> of snd_microii_spdif_default_get(). When those error scenarios occur
> such as usb_ifnum_to_if() returns NULL, the function forgets to decrease
> the refcnt increased by snd_usb_lock_shutdown(), causing a refcnt leak.
> 
> Fix this issue by jumping to "end" label when those error scenarios
> occur.
> 
> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>

Applied now (with Cc-to-stable and Fixes tags).


thanks,

Takashi

WARNING: multiple messages have this Message-ID (diff)
From: Takashi Iwai <tiwai@suse.de>
To: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Xin Tan <tanxin.ctf@gmail.com>,
	alsa-devel@alsa-project.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	yuanxzhang@fudan.edu.cn, kjlu@umn.edu,
	Takashi Iwai <tiwai@suse.com>,
	Colin Ian King <colin.king@canonical.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Geoffrey D. Bennett" <g@b4.vu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: usb-audio: Fix usb audio refcnt leak when getting spdif
Date: Thu, 23 Apr 2020 09:11:10 +0200	[thread overview]
Message-ID: <s5h1roey8vl.wl-tiwai@suse.de> (raw)
In-Reply-To: <1587617711-13200-1-git-send-email-xiyuyang19@fudan.edu.cn>

On Thu, 23 Apr 2020 06:54:19 +0200,
Xiyu Yang wrote:
> 
> snd_microii_spdif_default_get() invokes snd_usb_lock_shutdown(), which
> increases the refcount of the snd_usb_audio object "chip".
> 
> When snd_microii_spdif_default_get() returns, local variable "chip"
> becomes invalid, so the refcount should be decreased to keep refcount
> balanced.
> 
> The reference counting issue happens in several exception handling paths
> of snd_microii_spdif_default_get(). When those error scenarios occur
> such as usb_ifnum_to_if() returns NULL, the function forgets to decrease
> the refcnt increased by snd_usb_lock_shutdown(), causing a refcnt leak.
> 
> Fix this issue by jumping to "end" label when those error scenarios
> occur.
> 
> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>

Applied now (with Cc-to-stable and Fixes tags).


thanks,

Takashi

  reply	other threads:[~2020-04-23  7:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23  4:54 [PATCH] ALSA: usb-audio: Fix usb audio refcnt leak when getting spdif Xiyu Yang
2020-04-23  7:11 ` Takashi Iwai [this message]
2020-04-23  7:11   ` 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=s5h1roey8vl.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=colin.king@canonical.com \
    --cc=g@b4.vu \
    --cc=gregkh@linuxfoundation.org \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tanxin.ctf@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=tiwai@suse.com \
    --cc=xiyuyang19@fudan.edu.cn \
    --cc=yuanxzhang@fudan.edu.cn \
    /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.