From nobody Wed Nov 13 18:01:05 2024 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XpWLD0z3Hz5cNyL for ; Wed, 13 Nov 2024 18:01:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XpWLC73mTz3y7p for ; Wed, 13 Nov 2024 18:01:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731520868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iZDzjXGloU6b8w9fqqf/zp2MNogW7dL9qgkoGHPn+nQ=; b=WA8mj2ffhHx8y+y/D4ruIhhO0BwiaU6GiM7geb7SwPaR+30Xwk5nW2IyeOWZjDV2DJIYZB HcOzYYpGh6eJ+LTcLIAWJ8P+zM4KqfJFtParzhxR1UgTa2PIjbB3Wh3PbfuA00fzcoh+YZ ylb8mqgIVfmHc/ddNH/l/qsRQxIWkKzd2iTque2oobu1ZmNwOmxir32mIkSW02Ae4zKy8i gYi5/Q1bwgcozgHFwnpmaoojqemW3eaqvNkFE9ZPZ5fyWCN3SE/cO8Wc4odW/SL9Z0CT4l DGtMvzdHb3++rQVHmQi3xgyqaTBdoCVCpJVPVPaWtI29rb8LZFTXlrZ5Wo8QIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731520868; a=rsa-sha256; cv=none; b=SIu/IyUDF0M+GTnhlujp0zVc7Wpfz9ehgnrnU4g5iX424JaTbTtu5zQQUdLCq9+fy2cgZa kP2gAb1+kJ/j8vi+wKtQGgSmzmA5gLEZpY7XERhrzdIS9dxIyoBk5Mse0ipTVGXYHnkYHt vCbjtRVfAu3dfglF0NgCkBTVMaLAvHiS/dPMjCBO4Wn4tlwBY3Yjp+F0r5dtrVJM4fiM5y 7Td7SeVAYWkwzweeYImKdRDNUSHc15y0C6rxCm2X0kXiHn039r4HzYGvRiz/uV6UFH4eRb PWkLVeQ5dw0a/gbEMyWBqmNl7RD+ox1CxKWJWpt/TdDDqRBPP/hsALsUEm63ag== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XpWLC6gR4z14ZZ for ; Wed, 13 Nov 2024 18:01:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 4ADI17tj021169 for ; Wed, 13 Nov 2024 18:01:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4ADI17jk021168 for net@FreeBSD.org; Wed, 13 Nov 2024 18:01:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 252165] usb network and mii bus media status race condition Date: Wed, 13 Nov 2024 18:01:05 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: ali.abdallah@suse.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252165 --- Comment #36 from Ali Abdallah --- (In reply to Hans Petter Selasky from comment #26) The issue is that ioctl thread to get the media status, which basically sta= rted by userspace races with ue_tick_task. And I finally know why. The usbd_do_request_flags called releases the lock and then later acquire it (see the code). So, an ioctl waiting on the same lock will be executed toge= ther with ue_tick_task (because they aren't executed from the same thread), caus= ing the race observed here and basically breaking all usb ethernet devices. I will shortly attach a patch to Sync ioctl/tick media status changes. --=20 You are receiving this mail because: You are the assignee for the bug.=