From nobody Wed Jul 12 03:11:17 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 4R12ng38k7z4h3gR for ; Wed, 12 Jul 2023 03:11:19 +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 4R12nf6HZYz4CXv for ; Wed, 12 Jul 2023 03:11:18 +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=1689131479; 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=WJuOihQbEoOG8IjGoNvva3tm5xhQw65yJU2b0gTW4EI=; b=qdRlF+1U7f9FBSQkqKsquPQNRs2gZy/QNWRsrTR8FYe8QcRhPQ0BCH7cU/AhRjoEzFH36r lsEM675/Nkk+b/2BvqL0tVuDYUnhj3z3JerjlHCkMEei1Xt1kiZ4+FVZgoxa9IR4567bSS iMpVAfW+EmxMfUQmkXsdNu0SY+mUfz/72e27hjSsK8c09b//Hf8nl9U62YvVDm29f0NUzB +/bJXfXIELejpBiw3CnkZKcNhgwm0EmI+9H+4iUv/804PR3YXq1BwPZ9T2SDeNXcIOKsc8 MiydxznWlER7qKWf5sfDDwk4WLgVNFhlP8KAv4P57/Vk4su5zD8DQ8UT9rJqHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689131479; a=rsa-sha256; cv=none; b=QsosFfobcBZ3UNjd0SVyuA4hM/MZCbZKu5L1WTzLK5RQkPGuHDIXUqrYT2l2cMijaCnACR HUvbZiSZ2j63kvtxqD0BAietU6QMg/cxciPiosTvr9ySfc1CrYqZYziNcSLADmSbR4qC1D X18k9slNuz1juAreP6uBG6UuK2mmEPD8RKaw0wzDJTL5oI57Y0IkWORUbBNq7kab3hGmUq 2JzqZxBJNBARiaDWudRDi69TTmMpEt/9NgiEqJqqlHmePcCzmge05mOgiiUjELnGU3oVB/ PBlnWIJ0LdZGSU31ac6EmltgOiUhWwUa7+8LFGMT2aaXbe+NYDn7A5uAUbN9Ng== 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 4R12nf4DGRzsR5 for ; Wed, 12 Jul 2023 03:11:18 +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 36C3BITk004545 for ; Wed, 12 Jul 2023 03:11:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36C3BI7x004527 for net@FreeBSD.org; Wed, 12 Jul 2023 03:11:18 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: Wed, 12 Jul 2023 03:11:17 +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: 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272089 --- Comment #5 from commit-hook@FreeBSD.org --- A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Db39545f7bc38ec9865ac9cb4e703a6344= ad8310b commit b39545f7bc38ec9865ac9cb4e703a6344ad8310b Author: Kyle Evans AuthorDate: 2023-06-21 18:56:58 +0000 Commit: Kyle Evans CommitDate: 2023-07-11 15:05:45 +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 (cherry picked from commit b08ee10c0646e683cd03c9e28f537d9a7ba306af) 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.=