All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
Date: Sat, 23 Nov 2019 22:11:39 +0800	[thread overview]
Message-ID: <201911232205.uBVUISxf%lkp@intel.com> (raw)
In-Reply-To: <1993c1c08a6e3e278afeb173e4f4584eea5e14aa.1574331087.git.lucien.xin@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 7045 bytes --]

Hi Xin,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net/master]
[also build test ERROR on v5.4-rc8]
[cannot apply to net-next/master next-20191122]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Xin-Long/lwtunnel-be-STRICT-to-validate-the-new-LWTUNNEL_IP-6-_OPTS/20191123-204806
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git 5b1d9c17a3e0c16e1c9adf9c8a89f2735cb6dff8
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> net/ipv4/ip_tunnel_core.c:214:48: error: 'LWTUNNEL_IP_OPTS' undeclared here (not in a function); did you mean 'LWTUNNEL_IP_PAD'?
     [LWTUNNEL_IP_UNSPEC] = { .strict_start_type = LWTUNNEL_IP_OPTS },
                                                   ^~~~~~~~~~~~~~~~
                                                   LWTUNNEL_IP_PAD
>> net/ipv4/ip_tunnel_core.c:332:49: error: 'LWTUNNEL_IP6_OPTS' undeclared here (not in a function); did you mean 'LWTUNNEL_IP_OPTS'?
     [LWTUNNEL_IP6_UNSPEC] = { .strict_start_type = LWTUNNEL_IP6_OPTS },
                                                    ^~~~~~~~~~~~~~~~~
                                                    LWTUNNEL_IP_OPTS
>> net/ipv4/ip_tunnel_core.c:339:3: error: array index in initializer not of integer type
     [LWTUNNEL_IP6_OPTS]  = { .type = NLA_NESTED },
      ^~~~~~~~~~~~~~~~~
   net/ipv4/ip_tunnel_core.c:339:3: note: (near initialization for 'ip6_tun_policy')

vim +214 net/ipv4/ip_tunnel_core.c

   212	
   213	static const struct nla_policy ip_tun_policy[LWTUNNEL_IP_MAX + 1] = {
 > 214		[LWTUNNEL_IP_UNSPEC]	= { .strict_start_type = LWTUNNEL_IP_OPTS },
   215		[LWTUNNEL_IP_ID]	= { .type = NLA_U64 },
   216		[LWTUNNEL_IP_DST]	= { .type = NLA_U32 },
   217		[LWTUNNEL_IP_SRC]	= { .type = NLA_U32 },
   218		[LWTUNNEL_IP_TTL]	= { .type = NLA_U8 },
   219		[LWTUNNEL_IP_TOS]	= { .type = NLA_U8 },
   220		[LWTUNNEL_IP_FLAGS]	= { .type = NLA_U16 },
   221	};
   222	
   223	static int ip_tun_build_state(struct nlattr *attr,
   224				      unsigned int family, const void *cfg,
   225				      struct lwtunnel_state **ts,
   226				      struct netlink_ext_ack *extack)
   227	{
   228		struct ip_tunnel_info *tun_info;
   229		struct lwtunnel_state *new_state;
   230		struct nlattr *tb[LWTUNNEL_IP_MAX + 1];
   231		int err;
   232	
   233		err = nla_parse_nested_deprecated(tb, LWTUNNEL_IP_MAX, attr,
   234						  ip_tun_policy, extack);
   235		if (err < 0)
   236			return err;
   237	
   238		new_state = lwtunnel_state_alloc(sizeof(*tun_info));
   239		if (!new_state)
   240			return -ENOMEM;
   241	
   242		new_state->type = LWTUNNEL_ENCAP_IP;
   243	
   244		tun_info = lwt_tun_info(new_state);
   245	
   246	#ifdef CONFIG_DST_CACHE
   247		err = dst_cache_init(&tun_info->dst_cache, GFP_KERNEL);
   248		if (err) {
   249			lwtstate_free(new_state);
   250			return err;
   251		}
   252	#endif
   253	
   254		if (tb[LWTUNNEL_IP_ID])
   255			tun_info->key.tun_id = nla_get_be64(tb[LWTUNNEL_IP_ID]);
   256	
   257		if (tb[LWTUNNEL_IP_DST])
   258			tun_info->key.u.ipv4.dst = nla_get_in_addr(tb[LWTUNNEL_IP_DST]);
   259	
   260		if (tb[LWTUNNEL_IP_SRC])
   261			tun_info->key.u.ipv4.src = nla_get_in_addr(tb[LWTUNNEL_IP_SRC]);
   262	
   263		if (tb[LWTUNNEL_IP_TTL])
   264			tun_info->key.ttl = nla_get_u8(tb[LWTUNNEL_IP_TTL]);
   265	
   266		if (tb[LWTUNNEL_IP_TOS])
   267			tun_info->key.tos = nla_get_u8(tb[LWTUNNEL_IP_TOS]);
   268	
   269		if (tb[LWTUNNEL_IP_FLAGS])
   270			tun_info->key.tun_flags = nla_get_be16(tb[LWTUNNEL_IP_FLAGS]);
   271	
   272		tun_info->mode = IP_TUNNEL_INFO_TX;
   273		tun_info->options_len = 0;
   274	
   275		*ts = new_state;
   276	
   277		return 0;
   278	}
   279	
   280	static void ip_tun_destroy_state(struct lwtunnel_state *lwtstate)
   281	{
   282	#ifdef CONFIG_DST_CACHE
   283		struct ip_tunnel_info *tun_info = lwt_tun_info(lwtstate);
   284	
   285		dst_cache_destroy(&tun_info->dst_cache);
   286	#endif
   287	}
   288	
   289	static int ip_tun_fill_encap_info(struct sk_buff *skb,
   290					  struct lwtunnel_state *lwtstate)
   291	{
   292		struct ip_tunnel_info *tun_info = lwt_tun_info(lwtstate);
   293	
   294		if (nla_put_be64(skb, LWTUNNEL_IP_ID, tun_info->key.tun_id,
   295				 LWTUNNEL_IP_PAD) ||
   296		    nla_put_in_addr(skb, LWTUNNEL_IP_DST, tun_info->key.u.ipv4.dst) ||
   297		    nla_put_in_addr(skb, LWTUNNEL_IP_SRC, tun_info->key.u.ipv4.src) ||
   298		    nla_put_u8(skb, LWTUNNEL_IP_TOS, tun_info->key.tos) ||
   299		    nla_put_u8(skb, LWTUNNEL_IP_TTL, tun_info->key.ttl) ||
   300		    nla_put_be16(skb, LWTUNNEL_IP_FLAGS, tun_info->key.tun_flags))
   301			return -ENOMEM;
   302	
   303		return 0;
   304	}
   305	
   306	static int ip_tun_encap_nlsize(struct lwtunnel_state *lwtstate)
   307	{
   308		return nla_total_size_64bit(8)	/* LWTUNNEL_IP_ID */
   309			+ nla_total_size(4)	/* LWTUNNEL_IP_DST */
   310			+ nla_total_size(4)	/* LWTUNNEL_IP_SRC */
   311			+ nla_total_size(1)	/* LWTUNNEL_IP_TOS */
   312			+ nla_total_size(1)	/* LWTUNNEL_IP_TTL */
   313			+ nla_total_size(2);	/* LWTUNNEL_IP_FLAGS */
   314	}
   315	
   316	static int ip_tun_cmp_encap(struct lwtunnel_state *a, struct lwtunnel_state *b)
   317	{
   318		return memcmp(lwt_tun_info(a), lwt_tun_info(b),
   319			      sizeof(struct ip_tunnel_info));
   320	}
   321	
   322	static const struct lwtunnel_encap_ops ip_tun_lwt_ops = {
   323		.build_state = ip_tun_build_state,
   324		.destroy_state = ip_tun_destroy_state,
   325		.fill_encap = ip_tun_fill_encap_info,
   326		.get_encap_size = ip_tun_encap_nlsize,
   327		.cmp_encap = ip_tun_cmp_encap,
   328		.owner = THIS_MODULE,
   329	};
   330	
   331	static const struct nla_policy ip6_tun_policy[LWTUNNEL_IP6_MAX + 1] = {
 > 332		[LWTUNNEL_IP6_UNSPEC]	= { .strict_start_type = LWTUNNEL_IP6_OPTS },
   333		[LWTUNNEL_IP6_ID]		= { .type = NLA_U64 },
   334		[LWTUNNEL_IP6_DST]		= { .len = sizeof(struct in6_addr) },
   335		[LWTUNNEL_IP6_SRC]		= { .len = sizeof(struct in6_addr) },
   336		[LWTUNNEL_IP6_HOPLIMIT]		= { .type = NLA_U8 },
   337		[LWTUNNEL_IP6_TC]		= { .type = NLA_U8 },
   338		[LWTUNNEL_IP6_FLAGS]		= { .type = NLA_U16 },
 > 339		[LWTUNNEL_IP6_OPTS]		= { .type = NLA_NESTED },
   340	};
   341	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28171 bytes --]

  parent reply	other threads:[~2019-11-23 14:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 10:11 [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS Xin Long
2019-11-21 19:48 ` David Miller
2019-11-23 14:11 ` kbuild test robot [this message]
2019-11-24 12:31   ` Xin Long
2019-11-25  0:33     ` Rong Chen
2019-11-25  6:38     ` Li Zhijian
2019-11-25  6:43       ` Xin Long
2019-11-25  7:05         ` Li Zhijian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201911232205.uBVUISxf%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.