From owner-freebsd-pf@freebsd.org Fri Sep 2 11:57:45 2016 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C79D4BCBB09 for ; Fri, 2 Sep 2016 11:57:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F054F36 for ; Fri, 2 Sep 2016 11:57:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u82Bvj2n072960 for ; Fri, 2 Sep 2016 11:57:45 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-pf@FreeBSD.org Subject: [Bug 185633] [pf] scrubbing bug in transparent mode bug with bigger than MTU UDP packet Date: Fri, 02 Sep 2016 11:57:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: olivier@freebsd.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-pf@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 MIME-Version: 1.0 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2016 11:57:45 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D185633 --- Comment #13 from Olivier Cochard --- funny, after lot's of printf() for debuging, it seems it's the first suspic= ious function that was source of the panic that is corrupting my mbuf/packet: in bridge_fragment(): M_PREPEND(m0, ETHER_HDR_LEN, M_NOWAIT); Here is the new output of my debug output: bridge0: [DEBUG] bridge_pfil() enter, dir: 1(IN:1/OUT:2), frag :0xfffff8000386e800(m_len: 1514) pf_normalize_ip: DEBUG branch frag: 0xfffff8000386e800(m_pkthrd.len:1500) pf_normalize_ip: reass frag 44538 @ 0-1480 pf_fillup_fragment: reass frag 44538 @ 0-1480bridge0:=20 [DEBUG] bridge_pfil() enter, dir: 1(IN:1/OUT:2), frag :0xfffff8000386e700(m_len: 62) pf_normalize_ip: DEBUG branch frag: 0xfffff8000386e700(m_pkthrd.len:48) pf_normalize_ip: reass frag 44538 @ 1480-1508 pf_fillup_fragment: reass frag 44538 @ 1480-1508 pf_isfull_fragment: 1508 < 1508? pf_reassemble: complete: 0xfffff8000386e800(m_pkthrd.len:1528, p_len: 1528) bridge0: [DEBUG] bridge_pfil() exit, dir: 1(IN:1/OUT:2), frag: 0xfffff8000386e800(m_len: 1542) bridge0: [DEBUG] bridge_pfil() enter, dir: 2(IN:1/OUT:2), frag :0xfffff8000386e800(m_len: 1542) vtnet1: [DEBUG] bridge_fragment() entering, frag:0xfffff8000386e800(m_len: 1528), ether_dhost : 58:9c:fc:02:03:03 vtnet1: [DEBUG] bridge_fragment() after ip_fragment, first mbuf in chain is frag:0xfffff8000386e800(m_len: 1500), second is 0xfffff80003796c00(m_len: 2= 0) vtnet1: [DEBUG] bridge_fragment() walking chain, frag m0:0xfffff8000386e800(m_len: 1500), frag m:0xfffff8000386e800(m_len: 1500) vtnet1: [DEBUG] bridge_fragment() walking chain after M_PREPEND, frag m0:0xfffff80003796d00(m_len: 14), frag m:0xfffff8000386e800(m_len: 1500) vtnet1: [DEBUG] bridge_fragment() walking chain after bcopy, frag m0:0xfffff80003796d00(m_len: 14), frag m:0xfffff8000386e800(m_len: 1500) vtnet1: [DEBUG] bridge_fragment() exiting, m_len: 1500 panic: bridge_enqueue: no mbuf packet header! =3D> Before calling M_PREPEND, there is a mbuf chain: - first element is 1500 bytes long - second element is 20 bytes long Then we need to add ETHER_HDR_LEN to the begining of the first element: After M_PREPEND, the 1500 bytes long should be 1514 bytes long=E2=80=A6 but= we obtain a 14 bytes long mbuf!!!! --=20 You are receiving this mail because: You are the assignee for the bug.=