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  linux-cve-announce  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: Fri, 21 Jun 2024 15:02:55 +0000
From: Asbjørn Sloth Tønnesen <ast@...erby.net>
To: Davide Caratti <dcaratti@...hat.com>
Cc: "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, David Ahern <dsahern@...nel.org>,
 Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org, Ilya Maximets <i.maximets@....org>,
 Jamal Hadi Salim <jhs@...atatu.com>, Cong Wang <xiyou.wangcong@...il.com>,
 Jiri Pirko <jiri@...nulli.us>
Subject: Re: [RFC PATCH net-next 5/9] flow_dissector: set encapsulated control
 flags from tun_flags

Hi Davide,

On 6/11/24 11:53 PM, Asbjørn Sloth Tønnesen wrote:
> Set the new FLOW_DIS_F_TUNNEL_* encapsulated control flags, based
> on if their counter-part is set in tun_flags.
> 
> These flags are not userspace visible yet, as the code to dump
> encapsulated control flags will first be added, and later activated
> in the following patches.
> 
> Signed-off-by: Asbjørn Sloth Tønnesen <ast@...erby.net>
> ---
>   net/core/flow_dissector.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 86a11a01445ad..6e9bd4cecab66 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -396,6 +396,15 @@ skb_flow_dissect_tunnel_info(const struct sk_buff *skb,
>   
>   	key = &info->key;
>   
> +	if (test_bit(IP_TUNNEL_CSUM_BIT, key->tun_flags))
> +		ctrl_flags |= FLOW_DIS_F_TUNNEL_CSUM;
> +	if (test_bit(IP_TUNNEL_DONT_FRAGMENT_BIT, key->tun_flags))
> +		ctrl_flags |= FLOW_DIS_F_TUNNEL_DONT_FRAGMENT;
> +	if (test_bit(IP_TUNNEL_OAM_BIT, key->tun_flags))
> +		ctrl_flags |= FLOW_DIS_F_TUNNEL_OAM;
> +	if (test_bit(IP_TUNNEL_CRIT_OPT_BIT, key->tun_flags))
> +		ctrl_flags |= FLOW_DIS_F_TUNNEL_CRIT_OPT;
> +
>   	switch (ip_tunnel_info_af(info)) {
>   	case AF_INET:
>   		skb_flow_dissect_set_enc_control(FLOW_DISSECTOR_KEY_IPV4_ADDRS,

I am not too familiar with the bitmap helpers, so this is the part of this
RFC series that I am most unsure of.

These should maybe have been test_bit(*_BIT, &key->tun_flags), test_bit() in
general is mostly used with a reference, but with tun_flags it's a mixed bag:

git grep 'test_bit(' | grep tun_flags

-- 
Best regards
Asbjørn Sloth Tønnesen
Network Engineer
Fiberby - AS42541

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ