lists.openwall.net | 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
| ||
|
Date: Mon, 3 Aug 2020 17:19:40 -0700 From: Eric Dumazet <edumazet@...gle.com> To: Martin KaFai Lau <kafai@...com> Cc: bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, kernel-team <kernel-team@...com>, Lawrence Brakmo <brakmo@...com>, Neal Cardwell <ncardwell@...gle.com>, netdev <netdev@...r.kernel.org>, Yuchung Cheng <ycheng@...gle.com> 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 <kafai@...com> 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 <kafai@...com> > --- Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Powered by blists - more mailing lists