From nobody Tue Jun 02 09:16:03 2026 X-Original-To: ipfw@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 4gV4v75CXjz6fMZn for ; Tue, 02 Jun 2026 09:16:03 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gV4v74gxzz41tR for ; Tue, 02 Jun 2026 09:16:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780391763; 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=TBj99RqnczUvmFE+OIG0Lfp6/+hBZ1hsB17Q9l/wvkI=; b=CxUa+4ljoOnp1JD7w+h578VCEdpGoiHP5xpRhX9G1wWuNmyk3xUGcvUZcpujMOxiQ0044+ 3Uswquo4sXLJTNV/MD2a7YJ6+sbStV7zTx1E9mOdCFkLhvLP0DP+5/xsp3Az/z9aEo/yGI l2PdzCi3APFpJbKikIjxLQww17v1npHmCCYx7OtUhmMkby+hHyPrj4X9MBjoMHUaYZtAk2 5mpIO3V2gUPjdgSSxGLCgU5yPiJxbPWsQyw4PrQTsQkR/qv+UwDkf94ndlT+y0/B2LRlIE ry1mY96E2Cj48RFB+AhZth7dN1F8D7GMJvkA4b8duoRWLhOVRGD6vplurEv2KQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780391763; a=rsa-sha256; cv=none; b=Jha3ZagzbgjtiJX/HmOfWOWlq7d5lkhkRTxExrCdHfvoynLSIXomJ2Q6TZ+5V6WkPHEa/d KOWR+iVJN8b3yONNsW7X6Q+nyft72eXft0FAf41JzxkvpDMz6cYlyD20BRorWGmyDRrcNK OoPuUEQAOHahncMppspkSBfFbbnCAXnSr0l7UxPnKqgSFMnJjowAeC9uwBHfUHg3/c54vA wiUf9oM1jlVu38C6gsSy27aMKPtr1HtB7Q1ZT6h6u5nslFgdA6S4LeStlgBhsnBW/c3t5z TxGQmLkMnnNSyYvYWt0brR6V5Z0A084iqYNxOfNB1bBBu+aPWvJd6o3FHcr/Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780391763; 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=TBj99RqnczUvmFE+OIG0Lfp6/+hBZ1hsB17Q9l/wvkI=; b=V4ThJlVk1VBSH04/NMgP9hki9yWo87dsK3aWVFZORw+eYArxK2ewnQvE+gzm3ncHNfVcK3 ob6C1M9KvT51bNscJtO1Qpyvg2Tx25UantmrSdclntADZ+6lmrs3aRTSBovJ0l65ag2eWC HcjyK6tfwMBttqgPTXDV472XWf2aYIQYlwFRoTNOngRzfJsi3JBq1clrcJogsi9KYz5WBi 2eHBk6UBj/7PlQj1Ab1RV1R6p3HE+LIO2PIfyjUPfUS/s5kcu67YDLPsYumAHmLPt+tuoB YrhcFuN5bI8KAgD6TlcDsH/2F4tC9Z2rMwv41tezbdkctASIV4kJ4Wmj00qO5Q== 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 4gV4v745NPz3M5 for ; Tue, 02 Jun 2026 09:16:03 +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 6529G39u069159 for ; Tue, 2 Jun 2026 09:16:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 6529G3m6069158 for ipfw@FreeBSD.org; Tue, 2 Jun 2026 09:16:03 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: ipfw@FreeBSD.org Subject: [Bug 292023] ipfw_nat64: kernel panic when combining nat64lsn + nat64clat over a bridge Date: Tue, 02 Jun 2026 09:16:03 +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: 16.0-CURRENT X-Bugzilla-Keywords: crash X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pouria@freebsd.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: IPFW Technical Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-ipfw List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ipfw@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D292023 --- Comment #5 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Dea4888e63f6ac89c38982ffee693f89a5= 927e9c9 commit ea4888e63f6ac89c38982ffee693f89a5927e9c9 Author: Teddy Engel AuthorDate: 2026-06-01 16:42:56 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-06-02 09:14:26 +0000 nat64lsn: Fix type confusion panic when using wrong NAT64 instance type When an ipfw rule references a NAT64 instance by name using 'nat64lsn', the kernel looks up the instance in the shared srvstate[] array without verifying the instance type. If the named instance is actually a nat64clat or nat64stl instance (created with 'nat64clat' or 'nat64stl'), the code incorrectly casts the instance to nat64lsn_instance and dereferences the ->cfg pointer, which causes a kernel panic. The root cause is that all NAT64 instance types share the same srvstate[] array but have different struct layouts. For nat64lsn_instance, the field after 'no' is a pointer to nat64lsn_cf= g. For nat64clat_cfg, the same offset contains an embedded nat64_config struct. Fix by adding a type check after NAT64_LOOKUP() to verify that the instance's etlv matches IPFW_TLV_NAT64LSN_NAME before proceeding. If the type doesn't match, return IP_FW_DENY to reject the packet safely rather than crashing. Signed-off-by: Teddy Engel PR: 292023 Reported by: pouria Reviewed by: ae Pull-Request: https://github.com/freebsd/freebsd-src/pull/2249 sys/netpfil/ipfw/nat64/nat64lsn.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.=