From nobody Mon Jan 31 21:57:21 2022 X-Original-To: bugs@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 EA1E51982603 for ; Mon, 31 Jan 2022 21:57:21 +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 4Jnhk94r7Kz4RRJ for ; Mon, 31 Jan 2022 21:57:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 7BD2D23F41 for ; Mon, 31 Jan 2022 21:57:21 +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 20VLvLD8061898 for ; Mon, 31 Jan 2022 21:57:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 20VLvL8p061897 for bugs@FreeBSD.org; Mon, 31 Jan 2022 21:57:21 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: bugs@FreeBSD.org Subject: [Bug 261566] Padding of DLT_PFLOG packets should be done differently Date: Mon, 31 Jan 2022 21:57:21 +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: 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: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643666241; 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=FqYDU2k0/q72jPNMgRq0hRFESS+1YCEEea3c9akXWcc=; b=Wn8ehcnGzoUhc56bOU1RVP2vtlAoPKqYFeqeAAq4YU0h6VkpiMHVpFQRs29VmKqfdNoemr VBoTVHwsCY9PealekD0SbzeL8Ik3JzqKuAed7yL0fXQQcysgs2jota13cDanDH5kGcF65/ YnGDmOxNjry7SjuP8pTWjd84wmSbKwsKNMHWxD1ZyBTF9+B0Y7FrwnP2Z4/lliGGvwcpr6 VVpyHNOJWykdvHFsMESPevODxNQILDp6QSwpnTrbojpEo7dDZe/B4Zs/5HF1EHTCYgz1EI R2TNAchQEwfuyfQ0QhLAZfgq1kS9IwzygtwKm7trESC8hcSnKIZErmhrZXaggg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643666241; a=rsa-sha256; cv=none; b=ku8wae0lghtTsM48E17UrVuq6Z268HAuDzEjTJRApZMRCJMy/mOsFts5PFhAak4KziTmv9 5mZfk5dHclUpWxVEIgAI7ak6mH2F0fFrJ68y4tWHABOeLerbQqQAJCCvkCGHIMbHmTigvu lGr9uTFvIyr8De+1vjs2hrk8gfn9bj42MU1bXNV6ADKCKq2HeOqidUbvLxIKAHDnbPaK97 L3aMGoq/tOga4Ejk3dzIlXfwxjBCbQoI2QYLXWZOKlggoG8O0zlHo54Dq0zC7PuTyVq3GP +D1nFXVKpHBtzzYi3biHHQr2kX5DU5toLmJW1YNmN8zJ+KGW4UDmlBbR/oVmNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D261566 Kristof Provost changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kp@freebsd.org --- Comment #2 from Kristof Provost --- Thanks for the report. I distinctly recall looking at the Wireshark code before implementing the BPF_WORDALIGN(), however it clearly does `padded_length =3D WS_ROUNDUP_4(length);`, so I don't know what happened there. How does this look to you: diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h index 0406f78474a8..443c1cc36cf6 100644 --- a/sys/net/if_pflog.h +++ b/sys/net/if_pflog.h @@ -33,7 +33,6 @@ #include -#include #include #define PFLOGIFS_MAX 16 @@ -60,7 +59,9 @@ struct pfloghdr { u_int8_t pad2[3]; }; -#define PFLOG_HDRLEN BPF_WORDALIGN(offsetof(struct pflog= hdr, pad2)) +#define PFLOG_ALIGNMENT sizeof(uint32_t) +#define PFLOG_ALIGN(x) (((x) + PFLOG_ALIGNMENT - 1) & ~(PFLOG_ALIGNMENT - 1)) +#define PFLOG_HDRLEN PFLOG_ALIGN(offsetof(struct pfloghd= r, pad2)) /* minus pad, also used as a signature */ #define PFLOG_REAL_HDRLEN offsetof(struct pfloghdr, pad2) --=20 You are receiving this mail because: You are the assignee for the bug.=