From nobody Fri Dec 10 12:33:44 2021 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 D4AA718D3583 for ; Fri, 10 Dec 2021 12:33:45 +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 4J9Vgr6qMvz3vJf for ; Fri, 10 Dec 2021 12:33:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 572EB1A369 for ; Fri, 10 Dec 2021 12:33:44 +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 1BACXi3M050714 for ; Fri, 10 Dec 2021 12:33:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 1BACXiEm050713 for net@FreeBSD.org; Fri, 10 Dec 2021 12:33:44 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 259458] iflib_rxeof NULL pointer crash with vmxnet3 driver Date: Fri, 10 Dec 2021 12:33:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.2-RELEASE X-Bugzilla-Keywords: crash X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: avg@FreeBSD.org X-Bugzilla-Flags: mfc-stable13? mfc-stable12? 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639139625; 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=dz890hghj9gYvck3FnbNenvUOHxrnwVaUGYiE+8V5/E=; b=GqZCNeOghuUlNZ27mZZJ4K5K3yHgKeBnAybXh1HFWvL5XtUTDS3XFiDgLO5hJ2qWQAajLi jyJYbVjros6gQ1YOR+UpoEjc11qtDQJVrRf8TQP4ySi/cAR2Op++jbJ1ROqmJxMNPsbhCd MqnxmCT7NEZf7HpChZpGe+nTcdhbzyWapX9RWhueHq41KFrmlg3D/iSfW9X0HAup3fNEqw A/k4EVukaat8XvFJVZ5dktlqOu/CQgMOcOsLwIrkDzHk7cHVlJmIhZL83sfYt8VFWjAKXy L9WP3R0ePL2+jdD6znjG4qCVDBWk3d/7bMJuu/ExnL94IFtal/dB65QWRSGp8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639139625; a=rsa-sha256; cv=none; b=e2VB+SMnD/I3P4lyW/b52Y9b4fTFFTy2KagA79ziAbrL/QeFDwHoC6oSLySToWnCKqczf4 9mPsylR5TxbRQzPfddsrZ91AoQXIZkd7cuODqGI+Lu4/S2GtObI4hEls/yyH2sPv6xGG7e BiGhK78uRmwAHGd+Tl0UprJU+NJibO2bFNshatkfaWLeXRma9un0kVgCGE/7Q/gXmWhtu+ ExMCrw/t9k5mXTvd3EvwCOQ77bC1WRMVKo3IjHEb3P7z9rVN22g7Z5uwy5e0UgJNCLrNbQ ab3wLRAgsDhbz9MEN5zV383OCuTYnomHb58JQ3KM3Yx5/MQ7PM0xiXAC4LDqJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259458 --- Comment #22 from commit-hook@FreeBSD.org --- A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Df43d2e1199b9fd265b72281d2779e2554= fa7cb6d commit f43d2e1199b9fd265b72281d2779e2554fa7cb6d Author: Andriy Gapon AuthorDate: 2021-11-19 07:56:30 +0000 Commit: Andriy Gapon CommitDate: 2021-12-10 12:33:12 +0000 iflib_stop: drain rx tasks to prevent any data races iflib_stop modifies iflib data structures that are used by _task_fn_rx, most prominently the free lists. So, iflib_stop has to ensure that the rx task threads are not active. This should help to fix a crash seen when iflib_if_ioctl (e.g., SIOCSIFCAP) is called while there is already traffic flowing. The crash has been seen on VMWare guests with vmxnet3 driver. My guess is that on physical hardware the couple of 1ms delays that iflib_stop has after disabling interrupts are enough for the queued work to be completed before any iflib state is touched. But on busy hypervisors the guests might not get enough CPU time to complete the work, thus there can be a race between the taskqueue threads and the work done to handle an ioctl, specifically in iflib_stop and iflib_init_locked. PR: 259458 (cherry picked from commit 1bfdb812c786ac2607a82633f9c84a5d16f54079) sys/net/iflib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --=20 You are receiving this mail because: You are on the CC list for the bug.=