lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 3 Aug 2020 17:19:40 -0700
From:   Eric Dumazet <>
To:     Martin KaFai Lau <>
Cc:     bpf <>, Alexei Starovoitov <>,
        Daniel Borkmann <>,
        kernel-team <>,
        Lawrence Brakmo <>,
        Neal Cardwell <>,
        netdev <>,
        Yuchung Cheng <>
Subject: Re: [RFC PATCH v4 bpf-next 01/12] tcp: Use a struct to represent a saved_syn

On Mon, Aug 3, 2020 at 4:10 PM Martin KaFai Lau <> wrote:
> The TCP_SAVE_SYN has both the network header and tcp header.
> The total length of the saved syn packet is currently stored in
> the first 4 bytes (u32) of an array and the actual packet data is
> stored after that.
> A later patch will add a bpf helper that allows to get the tcp header
> alone from the saved syn without the network header.  It will be more
> convenient to have a direct offset to a specific header instead of
> re-parsing it.  This requires to separately store the network hdrlen.
> The total header length (i.e. network + tcp) is still needed for the
> current usage in getsockopt.  Although this total length can be obtained
> by looking into the tcphdr and then get the (th->doff << 2), this patch
> chooses to directly store the tcp hdrlen in the second four bytes of
> this newly created "struct saved_syn".  By using a new struct, it can
> give a readable name to each individual header length.
> Signed-off-by: Martin KaFai Lau <>
> ---

Reviewed-by: Eric Dumazet <>

Powered by blists - more mailing lists