All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
@ 2019-11-21 10:11 Xin Long
  2019-11-21 19:48 ` David Miller
  2019-11-23 14:11 ` kbuild test robot
  0 siblings, 2 replies; 8+ messages in thread
From: Xin Long @ 2019-11-21 10:11 UTC (permalink / raw)
  To: network dev; +Cc: davem, simon.horman, jakub.kicinski

LWTUNNEL_IP(6)_OPTS are the new items in ip(6)_tun_policy, which
are parsed by nla_parse_nested_deprecated(). We should check it
strictly by setting .strict_start_type = LWTUNNEL_IP(6)_OPTS.

This patch also adds missing LWTUNNEL_IP6_OPTS in ip6_tun_policy.

Fixes: 4ece47787077 ("lwtunnel: add options setting and dumping for geneve")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/ipv4/ip_tunnel_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 45405d2..0a7eaad 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -215,6 +215,7 @@ void ip_tunnel_get_stats64(struct net_device *dev,
 EXPORT_SYMBOL_GPL(ip_tunnel_get_stats64);
 
 static const struct nla_policy ip_tun_policy[LWTUNNEL_IP_MAX + 1] = {
+	[LWTUNNEL_IP_UNSPEC]	= { .strict_start_type = LWTUNNEL_IP_OPTS },
 	[LWTUNNEL_IP_ID]	= { .type = NLA_U64 },
 	[LWTUNNEL_IP_DST]	= { .type = NLA_U32 },
 	[LWTUNNEL_IP_SRC]	= { .type = NLA_U32 },
@@ -700,12 +701,14 @@ static const struct lwtunnel_encap_ops ip_tun_lwt_ops = {
 };
 
 static const struct nla_policy ip6_tun_policy[LWTUNNEL_IP6_MAX + 1] = {
+	[LWTUNNEL_IP6_UNSPEC]	= { .strict_start_type = LWTUNNEL_IP6_OPTS },
 	[LWTUNNEL_IP6_ID]		= { .type = NLA_U64 },
 	[LWTUNNEL_IP6_DST]		= { .len = sizeof(struct in6_addr) },
 	[LWTUNNEL_IP6_SRC]		= { .len = sizeof(struct in6_addr) },
 	[LWTUNNEL_IP6_HOPLIMIT]		= { .type = NLA_U8 },
 	[LWTUNNEL_IP6_TC]		= { .type = NLA_U8 },
 	[LWTUNNEL_IP6_FLAGS]		= { .type = NLA_U16 },
+	[LWTUNNEL_IP6_OPTS]		= { .type = NLA_NESTED },
 };
 
 static int ip6_tun_build_state(struct nlattr *attr,
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
  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
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2019-11-21 19:48 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, simon.horman, jakub.kicinski

From: Xin Long <lucien.xin@gmail.com>
Date: Thu, 21 Nov 2019 18:11:27 +0800

> LWTUNNEL_IP(6)_OPTS are the new items in ip(6)_tun_policy, which
> are parsed by nla_parse_nested_deprecated(). We should check it
> strictly by setting .strict_start_type = LWTUNNEL_IP(6)_OPTS.
> 
> This patch also adds missing LWTUNNEL_IP6_OPTS in ip6_tun_policy.
> 
> Fixes: 4ece47787077 ("lwtunnel: add options setting and dumping for geneve")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
  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
  2019-11-24 12:31   ` Xin Long
  1 sibling, 1 reply; 8+ messages in thread
From: kbuild test robot @ 2019-11-23 14:11 UTC (permalink / raw)
  To: kbuild-all

[-- 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 --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
  2019-11-23 14:11 ` kbuild test robot
@ 2019-11-24 12:31   ` Xin Long
  2019-11-25  0:33     ` Rong Chen
  2019-11-25  6:38     ` Li Zhijian
  0 siblings, 2 replies; 8+ messages in thread
From: Xin Long @ 2019-11-24 12:31 UTC (permalink / raw)
  To: kbuild-all

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

On Sat, Nov 23, 2019 at 10:11 PM kbuild test robot <lkp@intel.com> wrote:
>
> 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
This patch shouldn't be applied to net.git without:

commit 4ece477870774698e6e73d5821a3dd1605ca123b
Author: Xin Long <lucien.xin@gmail.com>
Date:   Wed Nov 6 17:01:05 2019 +0800

    lwtunnel: add options setting and dumping for geneve

> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
  2019-11-24 12:31   ` Xin Long
@ 2019-11-25  0:33     ` Rong Chen
  2019-11-25  6:38     ` Li Zhijian
  1 sibling, 0 replies; 8+ messages in thread
From: Rong Chen @ 2019-11-25  0:33 UTC (permalink / raw)
  To: kbuild-all

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



On 11/24/19 8:31 PM, Xin Long wrote:
> On Sat, Nov 23, 2019 at 10:11 PM kbuild test robot <lkp@intel.com> wrote:
>> 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
> This patch shouldn't be applied to net.git without:
>
> commit 4ece477870774698e6e73d5821a3dd1605ca123b
> Author: Xin Long <lucien.xin@gmail.com>
> Date:   Wed Nov 6 17:01:05 2019 +0800
>
>      lwtunnel: add options setting and dumping for geneve

Hi Xin,

Thanks for clarifying, we'll take a look.

Best Regards,
Rong Chen

>
>> 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
> _______________________________________________
> kbuild-all mailing list -- kbuild-all(a)lists.01.org
> To unsubscribe send an email to kbuild-all-leave(a)lists.01.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
  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
  1 sibling, 1 reply; 8+ messages in thread
From: Li Zhijian @ 2019-11-25  6:38 UTC (permalink / raw)
  To: kbuild-all

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


On 11/24/19 8:31 PM, Xin Long wrote:
> On Sat, Nov 23, 2019 at 10:11 PM kbuild test robot<lkp@intel.com>  wrote:
>> 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 seehttps://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
> This patch shouldn't be applied to net.git without:
>
> commit 4ece477870774698e6e73d5821a3dd1605ca123b
> Author: Xin Long<lucien.xin@gmail.com>
> Date:   Wed Nov 6 17:01:05 2019 +0800
>
>      lwtunnel: add options setting and dumping for geneve
>
Hi,

May i know which tree/branch you are basing on for the patch "[PATCH] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS"
Your inputs could be helpful for us to improve our kbuild robot continuously.

As the mentioned above, the kbuild robot failed to apply to net-next/master which i have checked that
4ece477870774698e6e73d5821a3dd1605ca123b was already included


Thanks
Zhijian


[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 2621 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
  2019-11-25  6:38     ` Li Zhijian
@ 2019-11-25  6:43       ` Xin Long
  2019-11-25  7:05         ` Li Zhijian
  0 siblings, 1 reply; 8+ messages in thread
From: Xin Long @ 2019-11-25  6:43 UTC (permalink / raw)
  To: kbuild-all

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

On Mon, Nov 25, 2019 at 2:39 PM Li Zhijian <zhijianx.li@intel.com> wrote:
>
>
> On 11/24/19 8:31 PM, Xin Long wrote:
>
> On Sat, Nov 23, 2019 at 10:11 PM kbuild test robot <lkp@intel.com> wrote:
>
> 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
>
> This patch shouldn't be applied to net.git without:
>
> commit 4ece477870774698e6e73d5821a3dd1605ca123b
> Author: Xin Long <lucien.xin@gmail.com>
> Date:   Wed Nov 6 17:01:05 2019 +0800
>
>     lwtunnel: add options setting and dumping for geneve
>
> Hi,
>
> May i know which tree/branch you are basing on for the patch "[PATCH] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS"
> Your inputs could be helpful for us to improve our kbuild robot continuously.
>
> As the mentioned above, the kbuild robot failed to apply to net-next/master which i have checked that
> 4ece477870774698e6e73d5821a3dd1605ca123b was already included
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
on this tree, it worked to me.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-next] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS
  2019-11-25  6:43       ` Xin Long
@ 2019-11-25  7:05         ` Li Zhijian
  0 siblings, 0 replies; 8+ messages in thread
From: Li Zhijian @ 2019-11-25  7:05 UTC (permalink / raw)
  To: kbuild-all

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


On 11/25/19 2:43 PM, Xin Long wrote:

> On Mon, Nov 25, 2019 at 2:39 PM Li Zhijian<zhijianx.li@intel.com>  wrote:
>> On 11/24/19 8:31 PM, Xin Long wrote:
>>
>> On Sat, Nov 23, 2019 at 10:11 PM kbuild test robot<lkp@intel.com>  wrote:
>>
>> 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 seehttps://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
>>
>> This patch shouldn't be applied to net.git without:
>>
>> commit 4ece477870774698e6e73d5821a3dd1605ca123b
>> Author: Xin Long<lucien.xin@gmail.com>
>> Date:   Wed Nov 6 17:01:05 2019 +0800
>>
>>      lwtunnel: add options setting and dumping for geneve
>>
>> Hi,
>>
>> May i know which tree/branch you are basing on for the patch "[PATCH] lwtunnel: be STRICT to validate the new LWTUNNEL_IP(6)_OPTS"
>> Your inputs could be helpful for us to improve our kbuild robot continuously.
>>
>> As the mentioned above, the kbuild robot failed to apply to net-next/master which i have checked that
>> 4ece477870774698e6e73d5821a3dd1605ca123b was already included
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
> on this tree, it worked to me.

thanks. i knew what happened i think.

this patch have been merged into net-next/master already, so this is a negative report.


Thanks
Zhijian


[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3250 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-11-25  7:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.