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]
Message-ID: <20201019093225.GF169425@azazel.net>
Date:   Mon, 19 Oct 2020 10:32:25 +0100
From:   Jeremy Sowden <jeremy@...zel.net>
To:     Pablo Neira Ayuso <pablo@...filter.org>
Cc:     netfilter-devel@...r.kernel.org, davem@...emloft.net,
        netdev@...r.kernel.org, kuba@...nel.org
Subject: Re: [PATCH net-next,v2 8/9] netfilter: flowtable: bridge port support

On 2020-10-15, at 18:30:37 +0200, Pablo Neira Ayuso wrote:
> Update hardware destination address to the master bridge device to
> emulate the forwarding behaviour.
>
> Signed-off-by: Pablo Neira Ayuso <pablo@...filter.org>
> ---
> v2: no changes.
>
>  include/net/netfilter/nf_flow_table.h | 1 +
>  net/netfilter/nf_flow_table_core.c    | 4 ++++
>  net/netfilter/nft_flow_offload.c      | 6 +++++-
>  3 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/netfilter/nf_flow_table.h b/include/net/netfilter/nf_flow_table.h
> index 1b57d1d1270d..4ec3f9bb2f32 100644
> --- a/include/net/netfilter/nf_flow_table.h
> +++ b/include/net/netfilter/nf_flow_table.h
> @@ -172,6 +172,7 @@ struct nf_flow_route {
>  			u32		ifindex;
>  			u8		h_source[ETH_ALEN];
>  			u8		h_dest[ETH_ALEN];
> +			enum flow_offload_xmit_type xmit_type;
>  		} out;
>  		struct dst_entry	*dst;
>  	} tuple[FLOW_OFFLOAD_DIR_MAX];
> diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
> index 725366339b85..e80dcabe3668 100644
> --- a/net/netfilter/nf_flow_table_core.c
> +++ b/net/netfilter/nf_flow_table_core.c
> @@ -100,6 +100,10 @@ static int flow_offload_fill_route(struct flow_offload *flow,
>
>  	if (dst_xfrm(dst))
>  		flow_tuple->xmit_type = FLOW_OFFLOAD_XMIT_XFRM;
> +	else
> +		flow_tuple->xmit_type = route->tuple[dir].out.xmit_type;
> +
> +	flow_tuple->dst_cache = dst;
>
>  	flow_tuple->dst_cache = dst;

Accidentally duplicated assignment?

> diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c
> index d440e436cb16..9efb5d584290 100644
> --- a/net/netfilter/nft_flow_offload.c
> +++ b/net/netfilter/nft_flow_offload.c
> @@ -54,6 +54,7 @@ struct nft_forward_info {
>  	u32 iifindex;
>  	u8 h_source[ETH_ALEN];
>  	u8 h_dest[ETH_ALEN];
> +	enum flow_offload_xmit_type xmit_type;
>  };
>
>  static int nft_dev_forward_path(struct nf_flow_route *route,
> @@ -83,7 +84,9 @@ static int nft_dev_forward_path(struct nf_flow_route *route,
>  		case DEV_PATH_VLAN:
>  			return -1;
>  		case DEV_PATH_BRIDGE:
> -			return -1;
> +			memcpy(info.h_dest, path->dev->dev_addr, ETH_ALEN);
> +			info.xmit_type = FLOW_OFFLOAD_XMIT_DIRECT;
> +			break;
>  		}
>  	}
>
> @@ -91,6 +94,7 @@ static int nft_dev_forward_path(struct nf_flow_route *route,
>  	memcpy(route->tuple[dir].out.h_dest, info.h_source, ETH_ALEN);
>  	memcpy(route->tuple[dir].out.h_source, info.h_dest, ETH_ALEN);
>  	route->tuple[dir].out.ifindex = info.iifindex;
> +	route->tuple[dir].out.xmit_type = info.xmit_type;
>
>  	return 0;
>  }
> --
> 2.20.1

J.

Download attachment "signature.asc" of type "application/pgp-signature" (660 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ