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 802ACC433F5 for ; Fri, 30 Sep 2022 09:39:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230435AbiI3JjK (ORCPT ); Fri, 30 Sep 2022 05:39:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbiI3JjG (ORCPT ); Fri, 30 Sep 2022 05:39:06 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE20613790B for ; Fri, 30 Sep 2022 02:39:05 -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 371021F8D5; Fri, 30 Sep 2022 09:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664530744; 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=SRMQb52MbT2bpBHYWiJH2YSSNU2RuItMYhSPzZoa3Oc=; b=14KXKiQ6OMLquAPciWpAAvyKma1y1RL97TV6u/7k8/JJEuNL0nd1STpj+pXtJLB5ZJVTej eOAdAkBpUnh32r4q2m9S+5d982k1F1XSMq7AygftZ7IT5c8D7PQPPiorohX9sxQzxjS8iW SVdJZfgre5bU2BgbHvm/1OD6ZnUEFfg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664530744; 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=SRMQb52MbT2bpBHYWiJH2YSSNU2RuItMYhSPzZoa3Oc=; b=mn4mnAGADK9HEeTXESCzmZCdK020MkeghP+NEh4Vj9Te0Uz+GK7isyLf4KAnsWKVVj6fS4 6EAF+dpTdOoQmCAQ== 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 1A52213677; Fri, 30 Sep 2022 09:39:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LHKuBTi5NmP3YQAAMHmgww (envelope-from ); Fri, 30 Sep 2022 09:39:04 +0000 Date: Fri, 30 Sep 2022 11:39:03 +0200 Message-ID: <877d1l6w20.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: <87bkqx6ws6.wl-tiwai@suse.de> References: <87bkqx6ws6.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: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)