From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99E36C433F5 for ; Fri, 30 Sep 2022 10:01:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbiI3KBV (ORCPT ); Fri, 30 Sep 2022 06:01:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbiI3KAj (ORCPT ); Fri, 30 Sep 2022 06:00:39 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C264C1005C1 for ; Fri, 30 Sep 2022 03:00:36 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3450B1F86B; Fri, 30 Sep 2022 10:00:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664532035; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=t1tICXShoQ7NB6GmGDH64bVW//UAFg02t7BL9gYsELE=; b=OsEE0Y4dmTujBJPoDKgFHxu4QTZIEdzGUaqHQbv3A+x2rnZh6h8iGV5BCe/DS54aD7FJRQ HougvknI0tdbbQwO9w2MMIHrVMIJXMxgHHi3fLHVfcOarNnQfJ0dsQB7JZ8G4XarqMjUA4 OS9tiqSaKRpGS18d+vnKuhnAVtrfmXQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664532035; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=t1tICXShoQ7NB6GmGDH64bVW//UAFg02t7BL9gYsELE=; b=PqYn2rnUQIhvzJ5diMB7sw8Oq6xdRHjHQE17mvMEI/RXUcHBrI1j7Q4bOctpblIc21lQoH nUGRjz5kh/RTbdAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0E84F13677; Fri, 30 Sep 2022 10:00:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qKP7AkO+NmOLagAAMHmgww (envelope-from ); Fri, 30 Sep 2022 10:00:35 +0000 Date: Fri, 30 Sep 2022 12:00:34 +0200 Message-ID: <874jwp6v25.wl-tiwai@suse.de> From: Takashi Iwai To: "Sabri N. Ferreiro" 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 In-Reply-To: <877d1l6w20.wl-tiwai@suse.de> References: <87bkqx6ws6.wl-tiwai@suse.de> <877d1l6w20.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 Sep 2022 11:39:03 +0200, Takashi Iwai wrote: > > 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. ... and I believe it's happening no matter which version. I'm going to submit the proper patch, in anyway. thanks, Takashi > > > 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)