From nobody Tue Nov 28 10:33:57 2023 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 4Sff2G2yfxz52K14 for ; Tue, 28 Nov 2023 10:33:58 +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 4Sff2G1Gwvz4RMg for ; Tue, 28 Nov 2023 10:33:58 +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=1701167638; 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=EYrj0TgsjXPZXPeZTMWsBFooh9QE8Bxo+r3UlGxoWQE=; b=b26N6jyMd6+UlK4Hgm2D7TwXTNe1kgXkhKYbTllUhywMwOmymyJyw149Cfo76npD0RdMQd R3VSQvDaD6BR0wrr6RnjfTkZq3PPfjhgZHuWTfmSZK1di4GLYt7oujhcxb6wa6dOxXeSL8 l4RZT05ykxDL6Y8yjgyo7hpEmOy/YSRr9QFvbyaqm2dV6Oiz0VmmUHW1M/17tdYdZk+vau zUkos6se8sH9cEZB6RF9bNbxvg2wNBQI8as+77rgqFjRbgo5kI4QBBAIs9xz801+010T9D XPTh9pOU799yyWVOlJnQUMraeDF8cjc3BUr43svoOfvB7D9fHowbX84kVi/eqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701167638; a=rsa-sha256; cv=none; b=bLYFz1LoPGrVLsAxDPOWMbetZWXfQ63qwAJPmgbtXnXF+S332GG15TD3Zm5UZ+s4an8RKw 23czQbH2wqFpNUHnPtKV65BWqUDVJrrRRWAYutjqMEh7F5zgtryxXttTEEVquaHn5Pjl1Y pjEoyD5A8MqH7xi58M1E/Wrub49x8G6qjPPl723ZIo31CaBKpWC9VCwxfUshKhxeSEhTPQ D6vwr3fRc2dsaVdFCHXXqJQz+TDGJgLa67MLze1r0r4a29SzTQjOp63ywAusyAAgQ7FV7B moHyD07qcWYh0TjIReObV7d/i5GWqFKo81PSO93q1QRyM/oZyUOWhrgYpBAXJQ== 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 4Sff2G0MZFz3PL for ; Tue, 28 Nov 2023 10:33:58 +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 3ASAXvPu040780 for ; Tue, 28 Nov 2023 10:33:57 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3ASAXvXn040779 for net@FreeBSD.org; Tue, 28 Nov 2023 10:33:57 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 264549] HardenedBSD: panic: e1000/bridge: "sleep on wchan ... with sleeping prohibited" Date: Tue, 28 Nov 2023 10:33:57 +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: 13.1-STABLE X-Bugzilla-Keywords: IntelNetworking, crash X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: zlei@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D264549 Zhenlei Huang changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mmacy@FreeBSD.org --- Comment #2 from Zhenlei Huang --- (In reply to mfbott from comment #0) > I've solved this issue by replacing "pause" with "DELAY" inside the e1000= driver > (see attachment). > This certainly works for me, but could point to a deeper problem within a= nything > bridge-related. (I couldn't reproduce this panic outside a bridge.) IIUC this is an issue that combines use _sleep() with epoch_enter_preempt(). bridge_linkstate() will enter net epoch and then calls bstp_linkstate() and eventually e1000_write_phy_reg_mdic() / pause() / _sleep(). As per EPOCH(9), EPOCH_PREEMPT The epoch will allow preemption during sections. O= nly non-sleepable locks may be acquired during a preempti= ble epoch. The functions epoch_enter_preempt= (), epoch_exit_preempt(), and epoch_wait_preempt() must = be used in place of epoch_enter(), epoch_exit(), = and epoch_wait(), respectively. it is wrong to sleep within net epoch (allow preemption). > There's possibly a better solution in which we allow "pause" under some > circumstances (unlike my blanket replacement), but I haven't found one. There's also problem report by Jean-S=C3=A9bastien in https://reviews.freebsd.org/D14984 which has the same cause. CC the author @Matt Macy --=20 You are receiving this mail because: You are the assignee for the bug.=