All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Sabri N. Ferreiro" <snferreiro1@gmail.com>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	tiwai@suse.com
Subject: Re: general protection fault in release_urbs
Date: Fri, 30 Sep 2022 11:39:03 +0200	[thread overview]
Message-ID: <877d1l6w20.wl-tiwai@suse.de> (raw)
In-Reply-To: <87bkqx6ws6.wl-tiwai@suse.de>

On Fri, 30 Sep 2022 11:23:21 +0200,
Takashi Iwai wrote:
> 
> On Fri, 30 Sep 2022 04:23:23 +0200,
> Sabri N. Ferreiro wrote:
> > 
> > Hi,
> > 
> > When I used fuzz testing to test Linux kernel 6.0.0-rc6, the kernel
> > triggered the following error:
> > HEAD commit: 521a547ced6477c54b4b0cc206000406c221b4d6
> > git tree: upstream
> 
> Could you retest with 6.0-rc7 or later?
> A commit reverting the change might influence on the behavior
> significantly.

And if it's reproducible on 6.0-rc7, please try the following fix.


thanks,

Takashi

-- 8< --
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -95,12 +95,13 @@ static inline unsigned get_usb_high_speed_rate(unsigned int rate)
  */
 static void release_urb_ctx(struct snd_urb_ctx *u)
 {
-	if (u->buffer_size)
+	if (u->urb && u->buffer_size)
 		usb_free_coherent(u->ep->chip->dev, u->buffer_size,
 				  u->urb->transfer_buffer,
 				  u->urb->transfer_dma);
 	usb_free_urb(u->urb);
 	u->urb = NULL;
+	u->buffer_size = 0;
 }
 
 static const char *usb_error_string(int err)

WARNING: multiple messages have this Message-ID (diff)
From: Takashi Iwai <tiwai@suse.de>
To: "Sabri N. Ferreiro" <snferreiro1@gmail.com>
Cc: perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: general protection fault in release_urbs
Date: Fri, 30 Sep 2022 11:39:03 +0200	[thread overview]
Message-ID: <877d1l6w20.wl-tiwai@suse.de> (raw)
In-Reply-To: <87bkqx6ws6.wl-tiwai@suse.de>

On Fri, 30 Sep 2022 11:23:21 +0200,
Takashi Iwai wrote:
> 
> On Fri, 30 Sep 2022 04:23:23 +0200,
> Sabri N. Ferreiro wrote:
> > 
> > Hi,
> > 
> > When I used fuzz testing to test Linux kernel 6.0.0-rc6, the kernel
> > triggered the following error:
> > HEAD commit: 521a547ced6477c54b4b0cc206000406c221b4d6
> > git tree: upstream
> 
> Could you retest with 6.0-rc7 or later?
> A commit reverting the change might influence on the behavior
> significantly.

And if it's reproducible on 6.0-rc7, please try the following fix.


thanks,

Takashi

-- 8< --
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -95,12 +95,13 @@ static inline unsigned get_usb_high_speed_rate(unsigned int rate)
  */
 static void release_urb_ctx(struct snd_urb_ctx *u)
 {
-	if (u->buffer_size)
+	if (u->urb && u->buffer_size)
 		usb_free_coherent(u->ep->chip->dev, u->buffer_size,
 				  u->urb->transfer_buffer,
 				  u->urb->transfer_dma);
 	usb_free_urb(u->urb);
 	u->urb = NULL;
+	u->buffer_size = 0;
 }
 
 static const char *usb_error_string(int err)

  reply	other threads:[~2022-09-30  9:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30  2:23 general protection fault in release_urbs Sabri N. Ferreiro
2022-09-30  9:23 ` Takashi Iwai
2022-09-30  9:23   ` Takashi Iwai
2022-09-30  9:39   ` Takashi Iwai [this message]
2022-09-30  9:39     ` Takashi Iwai
2022-09-30 10:00     ` Takashi Iwai
2022-09-30 10:00       ` 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=877d1l6w20.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snferreiro1@gmail.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 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.