From nobody Wed Nov 8 17:30:13 2023 X-Original-To: bugs@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 4SQXCn253fz50Yny for ; Wed, 8 Nov 2023 17:30:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SQXCn0LJtz3LP4 for ; Wed, 8 Nov 2023 17:30:13 +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=1699464613; 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; bh=r1YnPHZlYRujei5aQVP+rFWSDn0sw+LKAVj9MS1QWQY=; b=k87v/B8ULJncwfib7AgQO3TbF4wUesX6J2mrNuIBP/6hh/kY6OsA5NNdMlR2a7ZrbaOebV NoXs7q5t/3YJsd+Ir82rdenWBVfNyeUlR5z+3S2Sh06G7UIbucrX0hA5ox0PXw5tzeL6UC KxBWvCNpfsKMzFfEtB+Fvvk8qClrKfuf9R5txHE8GywZgPQekd3RJURBfp1qoqiXmUtmQK ds0ycrd4qk2/cGJg3wqlpdwrPeOj9lczatkEIoyNldYwM5ZQcFTwrKGedH8b+cFohcBd79 8kRGEH1+vsLmJMYw/Z+ATbFpkRLxaaYHWow1Wp6pLSexFHZe+jA2xOMp75PGFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699464613; a=rsa-sha256; cv=none; b=iFJlB4voToqJ2mz6g+hf5Af7YtY6rcY4Zr5dKkPNkm1pa+A/d347IleSfbYAr2M5F3fvpl uPbE8DhwTKavba8B3NjYhyL27/mEsLw4E6vP7gIH44DGOpdJ/uZEGPCLP42LWqLt3m4vGe 4FJjDlMO+rvBU4hSessGhYYy3vzXFGQoFKdK/bj127goZrtrJntNhxoXroSO3Y39byhsVV U1/2Lab/DOBtXVczLGvIcSOEkrFJaUewZXUZi7r5xaUF/ga/G6z8WR+QaRpS+jN1tngFgN VYBUG7qeLoB0/w4OIPKnJe2lQCF6M3bqM1U5RQZSfrOaDgyJQzL8ScdzWXdwww== 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 4SQXCm6X9pzh30 for ; Wed, 8 Nov 2023 17:30:12 +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 3A8HUCOr036067 for ; Wed, 8 Nov 2023 17:30:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3A8HUCtS036065 for bugs@FreeBSD.org; Wed, 8 Nov 2023 17:30:12 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: bugs@FreeBSD.org Subject: [Bug 274966] A possible data race in sys/dev/firewire/firewire.c Date: Wed, 08 Nov 2023 17:30:13 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: islituo@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274966 Bug ID: 274966 Summary: A possible data race in sys/dev/firewire/firewire.c Product: Base System Version: 14.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: islituo@gmail.com Hello, Our static analysis tool finds a possible data race in firewire.c. The accesses to fwdev->dst and fwdev->status are often protected by the lock FW_GLOCK(fc). Here is an example in firewire.c: 146. fw_noderesolve_nodeid() { ...... 150. FW_GLOCK(fc); 151. STAILQ_FOREACH(fwdev, &fc->devices, link) 152. if (fwdev->dst =3D=3D dst && fwdev->status !=3D FWDEVINVAL) 153. break; 154. FW_GUNLOCK(fc); ...... 157. } But they are accessed in the following calling context without holding the lock: fw_bus_probe_thread() --> Line 1737 fw_explore(fc); --> Line 1747 err =3D fw_explore_node(&dfwdev); --> Line 1723 fwdev->dst =3D node; --> Line 1630 fwdev->status =3D FWDEVINIT; --> Line 1631 And thus can cause possible data races. I am not quite sure whether these possible data races are real andhow to fix them if they are real.=20 Any feedback would be appreciated, thanks! Reported-by: BassCheck --=20 You are receiving this mail because: You are the assignee for the bug.=