From nobody Fri Jun 23 17:01:29 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 4Qnk6L3Mzxz4h2pR for ; Fri, 23 Jun 2023 17:01:30 +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 4Qnk6K6BW7z4KL8 for ; Fri, 23 Jun 2023 17:01:29 +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=1687539689; 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=mMvob3uaeWLCw6S87Ve92umpYU84wF+LSqQ8B2ZO7h8=; b=i/Mud4Z/qpjjs7BA0lYzoL/SNP/hzCxCO2O7NRopqHSCTmUa0apSqs9AFeIhm9Rq3PM4E/ /q7iZW1BD7mSaTG+4A/27175I5ZfeLA1f399rqUSWDnrpMGxmy5lZg9Rsa3HpHgXMpc7nr EgQjLE3GsqrBxFVvhWx8fj4W+3kUOfh/KYGWJF77kjW87p6oBgwh4+tzULf44QcNCPBe3/ BJzjJHcun5zClV7bISBzC9pN3rWxyFAzuAITKrzSFrMvjVAHsFlFqJFmQNtlWWzLQi1cs4 KgllEWZ83xNVIX715AyQqvqP2FIbtlDFjLFgqIi9UUeKH8vcrzwXRZuicUTreQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687539689; a=rsa-sha256; cv=none; b=HH9EuW5JATfM0OA+lH7uU7l/OeGPsm5+r3kv8NxQq771iKOUArKa7vgfAEm96C6drQZ/KC 84Am+htZfGRppf9GBPksWtzSJoEfFeLYpol1WvpE2mJshzGmfVQp7aTXs/cYYfhyOXIr/1 JWZ2uGOz3OsvIgO3BmmCF5p8uYE4fdAhMH+twlinWdZW86ZEYzDgAxTBr4lfs+jjTNnbZJ Hc2nikMPIrVBxGxwtlM0spWQCw8y3uS3eEFbqFcRFJpWoA3BRbAO4Opm9SBD9B1oy2KCjD sMYcQ8Q+v5UZuTl8nstXTTdP5jnLna4MhpsWn28bXuZY+6akyKvvgp2hSyJEHw== 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 4Qnk6K57vnz1BsC for ; Fri, 23 Jun 2023 17:01:29 +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 35NH1T9Z066390 for ; Fri, 23 Jun 2023 17:01:29 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 35NH1Txf066389 for net@FreeBSD.org; Fri, 23 Jun 2023 17:01:29 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 272089] FreeBSD -CURRENT panic: panic invalid slot (wg(4) related) Date: Fri, 23 Jun 2023 17:01:29 +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: CURRENT X-Bugzilla-Keywords: crash X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: kevans@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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272089 --- Comment #4 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Db08ee10c0646e683cd03c9e28f537d9a7= ba306af commit b08ee10c0646e683cd03c9e28f537d9a7ba306af Author: Kyle Evans AuthorDate: 2023-06-21 18:56:58 +0000 Commit: Kyle Evans CommitDate: 2023-06-23 17:00:09 +0000 wg: fix a number of issues with module load failure handling If MOD_LOAD fails, then MOD_UNLOAD will be called to unwind module state, but wg_module_init() will have already deinitialized everything it needs to in a manner that renders it unsafe to call MOD_UNLOAD after (e.g., freed zone not reset to NULL, wg_osd_jail_slot not reset to 0). Let's simply stop trying to handle freeing everything in wg_module_init() to simplify it; let the subsequent MOD_UNLOAD deal with it, and let's make that robust against partially-constructed state. jhb@ notes that MOD_UNLOAD being called if MOD_LOAD fails is kind of an anomaly that doesn't match other paradigms in the kernel; e.g., if device_attach() fails, we don't invoke device_detach(). It's likely that a future commit will revert this and instead stop calling MOD_UNLOAD if MOD_LOAD fails, expecting modules to clean up after themselves in MOD_LOAD upon failure. Some other modules already do this and may see similar problems to the wg module (see: carp). The proper fix is decidedly a bit too invasive to do this close to 14 branching, and it requires auditing all kmods (base + ports) for potential leaks. PR: 272089 Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D40708 sys/dev/wg/if_wg.c | 28 +++++++++------------------- sys/dev/wg/wg_cookie.c | 9 ++++++++- 2 files changed, 17 insertions(+), 20 deletions(-) --=20 You are receiving this mail because: You are on the CC list for the bug.=