From nobody Thu Feb 09 21:21:26 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 4PCVD65Cdsz3nkvr for ; Thu, 9 Feb 2023 21:21:26 +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 4PCVD64F75z49VS for ; Thu, 9 Feb 2023 21:21:26 +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=1675977686; 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=mB6LLtVZntI380o31bJ2snI7/YTbz67uJcVPbfsHr4U=; b=JlQBpN4kbZhs9N4pIMcxJSTzq6J9UGTTv7PWAKVSY7IwCaa8HqG3K2R5FKAAcEmhQnXs7c +R+F5QFaXHjf/IjxnXyiV9UT3AThOFVACpzRQPciPqtka+pGJkmEJLaOfeMcHqoSSDMbQx CikLYmtDbn/5QJxSgy9txiqs2kTWqJVjfu9jaFe9ZQ4viB+xM33tuxsP+jm33yfwTlGjsK NRn/lhf10Y7X1XjoM+27MoA0vmO1UkJhc5rReF5OUoHiqWSzXXVp2bEfF8WoGxMVjIl8Vd GUsQEFxjeejP+jorEu+ES8FaZqKasb1NelE7NTDe/GncaeECpjHWHb0CpHof7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675977686; a=rsa-sha256; cv=none; b=Xisw4jgfEkywg8JPDTB0pkPDVfwiesBApofaf3yvU3yiUPZQxi8BuY0y+fWL5bqtn5zP0S EkcNCqjWLPQ4lPX+7XFdV7psI+icyqonizvjbV77f+qZVa7zjGcMeF5y4QtKQalXZDn4es 4omrDWM1K2gMtS5BA5rXgokHHKA4ZPDfFTXi82pkmhr4JvW9PRx1E4iJLqnWtFGUFA1OxT b7YNwkkPDzHrimoBO1VyvLq6Vyo1MosxwiJN2UWvyaKG23R+NFzapw2Vvox8YTnmVGJmR1 L7D4qa5zFUQYAfT8IpDljlptFVj+BsmbsSThG0ghpBAXT5SMjuMotvMYIDVCPQ== 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 4PCVD63J8gzscb for ; Thu, 9 Feb 2023 21:21:26 +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 319LLQdU085240 for ; Thu, 9 Feb 2023 21:21:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 319LLQeB085238 for net@FreeBSD.org; Thu, 9 Feb 2023 21:21:26 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 266442] kernel page fault on packet with broken lengths if ipfilter is loaded Date: Thu, 09 Feb 2023 21:21:26 +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: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: cy@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=3D266442 --- Comment #10 from commit-hook@FreeBSD.org --- A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D351f2f68852ac3e1d0ef745dc024dd745= b07a34f commit 351f2f68852ac3e1d0ef745dc024dd745b07a34f Author: Cy Schubert AuthorDate: 2023-02-02 00:49:08 +0000 Commit: Cy Schubert CommitDate: 2023-02-09 21:20:51 +0000 ipfilter: Fix use after free on packet with broken lengths Under the scenario with a packet with length of 67 bytes, a header leng= th using the default of 20 bytes and a TCP data offset (th_off) of 48 will cause m_pullup() to fail to make sure bytes are arragned contiguously. m_pullup() will free the mbuf chain and return a null. ipfilter stores the resultant mbuf address (or the resulting NULL) in its fr_info_t structure. Unfortuntely the eroneous packet is not flagged for drop. This results in a kernel page fault at line 410 of sys/netinet/ip_fastf= wd.c as it tries to use a now previously freed, by m_pullup(), mbuf. PR: 266442 Reported by: Robert Morris (cherry picked from commit 79f7745c098a766d34a4e072cdd1a06e6d0829d5) sys/netpfil/ipfilter/netinet/fil.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) --=20 You are receiving this mail because: You are on the CC list for the bug.=