From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B63A3C13F8; Thu, 26 Mar 2026 10:35:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774521355; cv=none; b=ABGdA5aEZYPKseYV7gh9MX5AcSZ39/wseyLxrq8L8zcyIFotPMUxo7rAUY2sbzILV9EviP5pLvJNgyomgXq6XzxnJCccd4ejkJrUN3wJ813P4o0Bgm86ROa7RGdzffbOVMfT6CVBlQpkB502YI8OoElZp/hvvUkJkAl5o66gZHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774521355; c=relaxed/simple; bh=T+tLJajTyOj4cDuHYlCGpyyZ8ZAzb5glWR6e0jJZxUg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K2NIOSKWjojW6ng8GrBIqncREPMO26jWbc8XOdael9vfjZqbufwDgOqZ0kKkitQ+XUQs6wzQmFLmiMP689pKkhbi66KeJUKZfrcOeQSYgUBdwUUVh08f6dV4EolKyt+cJINEMrs3hc7kriHAL0hNSQl2KL8MFFJmZim/B2FNEgs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hn1ToLLB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hn1ToLLB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C138EC116C6; Thu, 26 Mar 2026 10:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774521355; bh=T+tLJajTyOj4cDuHYlCGpyyZ8ZAzb5glWR6e0jJZxUg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hn1ToLLB2byk1NZDFwKzsUicxXfVcpJWB2UGJWqAAa6O6Mg1F6OCgCOm8+ZcdD7US 53YcIQH/1t1M8tTmiFuw0+K3ah+GP08177/30dA36jyr1uzLO5mNjciwPoA8wqedf6 aA4XdlPTkWshdiohafwCmMu92n8PqcGjGDctfrJ4= Date: Thu, 26 Mar 2026 11:35:31 +0100 From: Greg Kroah-Hartman To: Dayu Jiang Cc: Kuen-Han Tsai , David Brownell , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] usb: gadget: u_ether: Fix race between gether_disconnect and eth_stop Message-ID: <2026032614-most-opposing-4363@gregkh> References: <20260311-gether-disconnect-npe-v1-1-454966adf7c7@google.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Mar 26, 2026 at 03:53:13PM +0800, Dayu Jiang wrote: > On Wed, Mar 11, 2026 at 05:12:15PM +0800, Kuen-Han Tsai wrote: > > A race condition between gether_disconnect() and eth_stop() leads to a > > NULL pointer dereference. Specifically, if eth_stop() is triggered > > concurrently while gether_disconnect() is tearing down the endpoints, > > eth_stop() attempts to access the cleared endpoint descriptor, causing > > the following NPE: > > > > Unable to handle kernel NULL pointer dereference > > Call trace: > > __dwc3_gadget_ep_enable+0x60/0x788 > > dwc3_gadget_ep_enable+0x70/0xe4 > > usb_ep_enable+0x60/0x15c > > eth_stop+0xb8/0x108 > > > > Because eth_stop() crashes while holding the dev->lock, the thread > > running gether_disconnect() fails to acquire the same lock and spins > > forever, resulting in a hardlockup: > > > > Core - Debugging Information for Hardlockup core(7) > > Call trace: > > queued_spin_lock_slowpath+0x94/0x488 > > _raw_spin_lock+0x64/0x6c > > gether_disconnect+0x19c/0x1e8 > > ncm_set_alt+0x68/0x1a0 > > composite_setup+0x6a0/0xc50 > > > Hi Greg, > Hit the same issue during NCM switch stress test. > Can you take a look at this patch and check if it’s ready for merge? This is already in my tree and in linux-next and will go to Linus this weekend. thanks, greg k-h