From nobody Mon Apr 1 08:45:03 2024 X-Original-To: pf@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 4V7Phw0lJqz5G0FY for ; Mon, 1 Apr 2024 08:45:04 +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 4V7Phv4ycRz4t8V for ; Mon, 1 Apr 2024 08:45:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711961103; a=rsa-sha256; cv=none; b=siUeczH/iYPGL4d6EP07pN7Z1N6nxffiyGhGJ2x0rWnfX5BYXioS9TMU+aIkpfJN/0M4/S Twat4WVQJ8CFN8AtoIGEZiErWfR1GA5USJWHzP6ipENBAixs0e5LHdPv0lUNiKO0tpUZMF nOuZejkqiiY1bA77pYMJgC61fwb6Mz8yRPbuJlYuB7Ekc2MuzQlUwKuV+lo6tOChzpc3Me PGqOrDPJ9pNyUPDYQVegKkIGF5G+nBJIKuZGL4/NKyvZwqFHqv1KaL9Y1ZZ56/s1kOcadO JToejysBISudZ1NC2O+5Rrkz5x+kmy65EA1E0ypEmxGBYjQ9B9MwHZJYRRB9zg== 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=1711961103; 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=dE2tKbJmNy48XUv43GGeQqHs0oeZMgH+yZ9agj9UJsc=; b=flFHsDG1sO+UK2K0D+b03I1qxvy8hg2RcQdBpnUyKmMpPT0RiLWr6M/7NLRVHgivuHfX/k pMXiC3UXQm+AJJp0jTT+RG2+CZehc5i+qMiR8X29TcOS5yssbcrU0X/Af8/Fwn5P/7cl5r HaMXhHBw7i9PJLdNvOdRHA/wr11e753judUKiDCtXi962grkjJIOK7p7xlnculrQ1Aa8uW ppItrV3BB6sd5NGvxoTriyn3oU293rJG2weNaZIxCIizeAEPtZ8E1Q9BzrL9tHbKuMfcYb 7SFjSx5MGV7uV61RViLy8ZFfwBe5urv6nEXJq75vgZtCBVGTzGWUUODezE9+YQ== 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 4V7Phv4SMXz1DnY for ; Mon, 1 Apr 2024 08:45: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 4318j3sA050286 for ; Mon, 1 Apr 2024 08:45:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4318j3v4050285 for pf@FreeBSD.org; Mon, 1 Apr 2024 08:45:03 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: pf@FreeBSD.org Subject: [Bug 278034] tcpdump's ip6_print can read beyond buffer end Date: Mon, 01 Apr 2024 08:45:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kp@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: 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 List-Id: Technical discussion and general questions about packet filter (pf) List-Archive: https://lists.freebsd.org/archives/freebsd-pf List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-pf@freebsd.org X-BeenThere: freebsd-pf@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278034 --- Comment #3 from Kristof Provost --- To answer my own question, I think this may suffice: diff --git a/contrib/tcpdump/print-pfsync.c b/contrib/tcpdump/print-pfsync.c index 5710e36ded6c..e22c11a2df2d 100644 --- a/contrib/tcpdump/print-pfsync.c +++ b/contrib/tcpdump/print-pfsync.c @@ -86,7 +86,7 @@ pfsync_ip_print(netdissect_options *ndo , const u_char *b= p, u_int len) { struct pfsync_header *hdr =3D (struct pfsync_header *)bp; - if (len < PFSYNC_HDRLEN) + if (len < PFSYNC_HDRLEN || ! ND_TTEST_LEN(bp, len)) ND_PRINT("[|pfsync]"); else pfsync_print(ndo, hdr, bp + sizeof(struct pfsync_header), At the very least it makes valgrind happy without actually appearing to bre= ak tcpdump's support for pfsync. --=20 You are receiving this mail because: You are the assignee for the bug.=