tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 
netlink-validate-build-test-2
head:   963dafe164a051f6763a6fddf7b6d7933076985c
commit: e2e82c1203c1ab2423a79f486567a49228f546ab [2/6] netlink: make validation 
more configurable for future strictness
config: x86_64-rhel-7.6 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout e2e82c1203c1ab2423a79f486567a49228f546ab
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   net//sched/act_tunnel_key.c: In function 'tunnel_key_copy_opts':
>> net//sched/act_tunnel_key.c:128:8: error: implicit declaration of function 
>> 'nla_validate_deprecated'; did you mean 'nlmsg_validate_deprecated'? 
>> [-Werror=implicit-function-declaration]
     err = nla_validate_deprecated(head, len, TCA_TUNNEL_KEY_ENC_OPTS_MAX,
           ^~~~~~~~~~~~~~~~~~~~~~~
           nlmsg_validate_deprecated
   cc1: some warnings being treated as errors

vim +128 net//sched/act_tunnel_key.c

   121  
   122  static int tunnel_key_copy_opts(const struct nlattr *nla, u8 *dst,
   123                                  int dst_len, struct netlink_ext_ack 
*extack)
   124  {
   125          int err, rem, opt_len, len = nla_len(nla), opts_len = 0;
   126          const struct nlattr *attr, *head = nla_data(nla);
   127  
 > 128          err = nla_validate_deprecated(head, len, 
 > TCA_TUNNEL_KEY_ENC_OPTS_MAX,
   129                                        enc_opts_policy, extack);
   130          if (err)
   131                  return err;
   132  
   133          nla_for_each_attr(attr, head, len, rem) {
   134                  switch (nla_type(attr)) {
   135                  case TCA_TUNNEL_KEY_ENC_OPTS_GENEVE:
   136                          opt_len = tunnel_key_copy_geneve_opt(attr, dst,
   137                                                               dst_len, 
extack);
   138                          if (opt_len < 0)
   139                                  return opt_len;
   140                          opts_len += opt_len;
   141                          if (dst) {
   142                                  dst_len -= opt_len;
   143                                  dst += opt_len;
   144                          }
   145                          break;
   146                  }
   147          }
   148  
   149          if (!opts_len) {
   150                  NL_SET_ERR_MSG(extack, "Empty list of tunnel options");
   151                  return -EINVAL;
   152          }
   153  
   154          if (rem > 0) {
   155                  NL_SET_ERR_MSG(extack, "Trailing data after parsing 
tunnel key options attributes");
   156                  return -EINVAL;
   157          }
   158  
   159          return opts_len;
   160  }
   161  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to