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: <20170821.110226.325505016722205417.davem@davemloft.net>
Date:   Mon, 21 Aug 2017 11:02:26 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     u9012063@...il.com
Cc:     netdev@...r.kernel.org, mvohra@...are.com, kuznet@....inr.ac.ru,
        yoshfuji@...ux-ipv6.org
Subject: Re: [PATCHv3 net-next] gre: introduce native tunnel support for
 ERSPAN

From: William Tu <u9012063@...il.com>
Date: Fri, 18 Aug 2017 06:24:40 -0700

> +static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
> +		      int gre_hdr_len)
> +{
> +	struct net *net = dev_net(skb->dev);
> +	struct ip_tunnel_net *itn;
> +	struct ip_tunnel *tunnel;
> +	struct metadata_dst *tun_dst = NULL;
> +	const struct iphdr *iph;
> +	struct erspanhdr *ershdr;
> +	__be32 index;
> +	__be32 session_id;
> +	int len;

Please order local variables from longest to shortest line, ie. reverse
christmas tree format.

> +
> +	itn = net_generic(net, erspan_net_id);
> +	iph = ip_hdr(skb);
> +	len =  iph->ihl * 4 + gre_hdr_len + sizeof(*ershdr);
> +
> +	if (unlikely(!pskb_may_pull(skb, len)))
> +		return -ENOMEM;

I think the len passed here is wrong, it should be
"gre_hdr_len + sizeof(*ershdr)".
> +static void erspan_build_header(struct sk_buff *skb,
> +				__be32 id, u32 index, bool truncate)
> +{
> +	struct erspanhdr *ershdr;
> +	struct iphdr *iphdr = ip_hdr(skb);
> +	struct ethhdr *eth = eth_hdr(skb);
> +	struct qtag_prefix {
> +		__be16 eth_type;
> +		__be16 tci;
> +	} *qp;
> +	u16 vlan_tci = 0;
> +	enum erspan_encap_type enc_type = ERSPAN_ENCAP_NOVLAN;

Reverse christmas tree for the local variables, please.

> +static int erspan_validate(struct nlattr *tb[], struct nlattr *data[],
> +			   struct netlink_ext_ack *extack)
> +{
> +	int ret;
> +	__be16 flags = 0;

Likewise.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ