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: <201510062030.ZFzfsmcF%fengguang.wu@intel.com>
Date:	Tue, 6 Oct 2015 20:30:58 +0800
From:	kbuild test robot <lkp@...el.com>
To:	Nikolay Aleksandrov <razor@...ckwall.org>
Cc:	kbuild-all@...org, netdev@...r.kernel.org,
	roopa@...ulusnetworks.com, davem@...emloft.net,
	stephen@...workplumber.org, bridge@...ts.linux-foundation.org,
	shm@...ulusnetworks.com,
	Nikolay Aleksandrov <nikolay@...ulusnetworks.com>
Subject: Re: [PATCH net-next 1/8] bridge: netlink: export port's root id

Hi Nikolay,

[auto build test WARNING on v4.3-rc4 -- if it's inappropriate base, please ignore]

config: i386-randconfig-x006-201540 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   net/bridge/br_netlink.c: In function 'br_port_info_size':
   net/bridge/br_netlink.c:116:27: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
      + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */
                              ^
   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from net/bridge/br_netlink.c:13:
   net/bridge/br_netlink.c: In function 'br_port_fill_attrs':
   net/bridge/br_netlink.c:151:47: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
         nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
                                                  ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                               ^
>> net/bridge/br_netlink.c:139:2: note: in expansion of macro 'if'
     if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
     ^
   net/bridge/br_netlink.c:151:47: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
         nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
                                                  ^
   include/linux/compiler.h:147:40: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                                           ^
>> net/bridge/br_netlink.c:139:2: note: in expansion of macro 'if'
     if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
     ^
   net/bridge/br_netlink.c:151:47: error: invalid application of 'sizeof' to incomplete type 'struct ifla_bridge_id'
         nla_put(skb, IFLA_BRPORT_ROOT_ID, sizeof(struct ifla_bridge_id),
                                                  ^
   include/linux/compiler.h:158:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
>> net/bridge/br_netlink.c:139:2: note: in expansion of macro 'if'
     if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
     ^
   net/bridge/br_netlink.c: In function 'br_port_info_size':
   net/bridge/br_netlink.c:118:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^

vim +/if +139 net/bridge/br_netlink.c

11dc1f36 Stephen Hemminger   2006-05-25    7   *	This program is free software; you can redistribute it and/or
11dc1f36 Stephen Hemminger   2006-05-25    8   *	modify it under the terms of the GNU General Public License
11dc1f36 Stephen Hemminger   2006-05-25    9   *	as published by the Free Software Foundation; either version
11dc1f36 Stephen Hemminger   2006-05-25   10   *	2 of the License, or (at your option) any later version.
11dc1f36 Stephen Hemminger   2006-05-25   11   */
11dc1f36 Stephen Hemminger   2006-05-25   12  
11dc1f36 Stephen Hemminger   2006-05-25  @13  #include <linux/kernel.h>
5a0e3ad6 Tejun Heo           2010-03-24   14  #include <linux/slab.h>
bb900b27 stephen hemminger   2011-04-04   15  #include <linux/etherdevice.h>
32fe21c0 Thomas Graf         2007-03-22   16  #include <net/rtnetlink.h>
881d966b Eric W. Biederman   2007-09-17   17  #include <net/net_namespace.h>
b854272b Denis V. Lunev      2007-12-01   18  #include <net/sock.h>
407af329 Vlad Yasevich       2013-02-13   19  #include <uapi/linux/if_bridge.h>
bb900b27 stephen hemminger   2011-04-04   20  
11dc1f36 Stephen Hemminger   2006-05-25   21  #include "br_private.h"
b03b6dd5 Vitalii Demianets   2011-11-25   22  #include "br_private_stp.h"
11dc1f36 Stephen Hemminger   2006-05-25   23  
fed0a159 Roopa Prabhu        2015-02-25   24  static int br_get_num_vlan_infos(const struct net_port_vlans *pv,
fed0a159 Roopa Prabhu        2015-02-25   25  				 u32 filter_mask)
fed0a159 Roopa Prabhu        2015-02-25   26  {
fed0a159 Roopa Prabhu        2015-02-25   27  	u16 vid_range_start = 0, vid_range_end = 0;
fed0a159 Roopa Prabhu        2015-02-25   28  	u16 vid_range_flags = 0;
fed0a159 Roopa Prabhu        2015-02-25   29  	u16 pvid, vid, flags;
fed0a159 Roopa Prabhu        2015-02-25   30  	int num_vlans = 0;
fed0a159 Roopa Prabhu        2015-02-25   31  
fed0a159 Roopa Prabhu        2015-02-25   32  	if (filter_mask & RTEXT_FILTER_BRVLAN)
fed0a159 Roopa Prabhu        2015-02-25   33  		return pv->num_vlans;
fed0a159 Roopa Prabhu        2015-02-25   34  
fed0a159 Roopa Prabhu        2015-02-25   35  	if (!(filter_mask & RTEXT_FILTER_BRVLAN_COMPRESSED))
fed0a159 Roopa Prabhu        2015-02-25   36  		return 0;
fed0a159 Roopa Prabhu        2015-02-25   37  
fed0a159 Roopa Prabhu        2015-02-25   38  	/* Count number of vlan info's
fed0a159 Roopa Prabhu        2015-02-25   39  	 */
fed0a159 Roopa Prabhu        2015-02-25   40  	pvid = br_get_pvid(pv);
fed0a159 Roopa Prabhu        2015-02-25   41  	for_each_set_bit(vid, pv->vlan_bitmap, VLAN_N_VID) {
fed0a159 Roopa Prabhu        2015-02-25   42  		flags = 0;
fed0a159 Roopa Prabhu        2015-02-25   43  		if (vid == pvid)
fed0a159 Roopa Prabhu        2015-02-25   44  			flags |= BRIDGE_VLAN_INFO_PVID;
fed0a159 Roopa Prabhu        2015-02-25   45  
fed0a159 Roopa Prabhu        2015-02-25   46  		if (test_bit(vid, pv->untagged_bitmap))
fed0a159 Roopa Prabhu        2015-02-25   47  			flags |= BRIDGE_VLAN_INFO_UNTAGGED;
fed0a159 Roopa Prabhu        2015-02-25   48  
fed0a159 Roopa Prabhu        2015-02-25   49  		if (vid_range_start == 0) {
fed0a159 Roopa Prabhu        2015-02-25   50  			goto initvars;
fed0a159 Roopa Prabhu        2015-02-25   51  		} else if ((vid - vid_range_end) == 1 &&
fed0a159 Roopa Prabhu        2015-02-25   52  			flags == vid_range_flags) {
fed0a159 Roopa Prabhu        2015-02-25   53  			vid_range_end = vid;
fed0a159 Roopa Prabhu        2015-02-25   54  			continue;
fed0a159 Roopa Prabhu        2015-02-25   55  		} else {
fed0a159 Roopa Prabhu        2015-02-25   56  			if ((vid_range_end - vid_range_start) > 0)
fed0a159 Roopa Prabhu        2015-02-25   57  				num_vlans += 2;
fed0a159 Roopa Prabhu        2015-02-25   58  			else
fed0a159 Roopa Prabhu        2015-02-25   59  				num_vlans += 1;
fed0a159 Roopa Prabhu        2015-02-25   60  		}
fed0a159 Roopa Prabhu        2015-02-25   61  initvars:
fed0a159 Roopa Prabhu        2015-02-25   62  		vid_range_start = vid;
fed0a159 Roopa Prabhu        2015-02-25   63  		vid_range_end = vid;
fed0a159 Roopa Prabhu        2015-02-25   64  		vid_range_flags = flags;
fed0a159 Roopa Prabhu        2015-02-25   65  	}
fed0a159 Roopa Prabhu        2015-02-25   66  
fed0a159 Roopa Prabhu        2015-02-25   67  	if (vid_range_start != 0) {
fed0a159 Roopa Prabhu        2015-02-25   68  		if ((vid_range_end - vid_range_start) > 0)
fed0a159 Roopa Prabhu        2015-02-25   69  			num_vlans += 2;
fed0a159 Roopa Prabhu        2015-02-25   70  		else
fed0a159 Roopa Prabhu        2015-02-25   71  			num_vlans += 1;
fed0a159 Roopa Prabhu        2015-02-25   72  	}
fed0a159 Roopa Prabhu        2015-02-25   73  
fed0a159 Roopa Prabhu        2015-02-25   74  	return num_vlans;
fed0a159 Roopa Prabhu        2015-02-25   75  }
fed0a159 Roopa Prabhu        2015-02-25   76  
fed0a159 Roopa Prabhu        2015-02-25   77  static size_t br_get_link_af_size_filtered(const struct net_device *dev,
fed0a159 Roopa Prabhu        2015-02-25   78  					   u32 filter_mask)
b7853d73 Roopa Prabhu        2015-02-21   79  {
b7853d73 Roopa Prabhu        2015-02-21   80  	struct net_port_vlans *pv;
fed0a159 Roopa Prabhu        2015-02-25   81  	int num_vlan_infos;
b7853d73 Roopa Prabhu        2015-02-21   82  
2f56f6be Johannes Berg       2015-03-03   83  	rcu_read_lock();
b7853d73 Roopa Prabhu        2015-02-21   84  	if (br_port_exists(dev))
2f56f6be Johannes Berg       2015-03-03   85  		pv = nbp_get_vlan_info(br_port_get_rcu(dev));
b7853d73 Roopa Prabhu        2015-02-21   86  	else if (dev->priv_flags & IFF_EBRIDGE)
b7853d73 Roopa Prabhu        2015-02-21   87  		pv = br_get_vlan_info((struct net_bridge *)netdev_priv(dev));
b7853d73 Roopa Prabhu        2015-02-21   88  	else
2f56f6be Johannes Berg       2015-03-03   89  		pv = NULL;
2f56f6be Johannes Berg       2015-03-03   90  	if (pv)
fed0a159 Roopa Prabhu        2015-02-25   91  		num_vlan_infos = br_get_num_vlan_infos(pv, filter_mask);
2f56f6be Johannes Berg       2015-03-03   92  	else
2f56f6be Johannes Berg       2015-03-03   93  		num_vlan_infos = 0;
2f56f6be Johannes Berg       2015-03-03   94  	rcu_read_unlock();
2f56f6be Johannes Berg       2015-03-03   95  
fed0a159 Roopa Prabhu        2015-02-25   96  	if (!num_vlan_infos)
fed0a159 Roopa Prabhu        2015-02-25   97  		return 0;
fed0a159 Roopa Prabhu        2015-02-25   98  
b7853d73 Roopa Prabhu        2015-02-21   99  	/* Each VLAN is returned in bridge_vlan_info along with flags */
fed0a159 Roopa Prabhu        2015-02-25  100  	return num_vlan_infos * nla_total_size(sizeof(struct bridge_vlan_info));
b7853d73 Roopa Prabhu        2015-02-21  101  }
b7853d73 Roopa Prabhu        2015-02-21  102  
25c71c75 stephen hemminger   2012-11-13  103  static inline size_t br_port_info_size(void)
25c71c75 stephen hemminger   2012-11-13  104  {
25c71c75 stephen hemminger   2012-11-13  105  	return nla_total_size(1)	/* IFLA_BRPORT_STATE  */
25c71c75 stephen hemminger   2012-11-13  106  		+ nla_total_size(2)	/* IFLA_BRPORT_PRIORITY */
25c71c75 stephen hemminger   2012-11-13  107  		+ nla_total_size(4)	/* IFLA_BRPORT_COST */
25c71c75 stephen hemminger   2012-11-13  108  		+ nla_total_size(1)	/* IFLA_BRPORT_MODE */
a2e01a65 stephen hemminger   2012-11-13  109  		+ nla_total_size(1)	/* IFLA_BRPORT_GUARD */
1007dd1a stephen hemminger   2012-11-13  110  		+ nla_total_size(1)	/* IFLA_BRPORT_PROTECT */
3da889b6 stephen hemminger   2013-03-11  111  		+ nla_total_size(1)	/* IFLA_BRPORT_FAST_LEAVE */
9ba18891 Vlad Yasevich       2013-06-05  112  		+ nla_total_size(1)	/* IFLA_BRPORT_LEARNING */
867a5943 Vlad Yasevich       2013-06-05  113  		+ nla_total_size(1)	/* IFLA_BRPORT_UNICAST_FLOOD */
355b9f9d Nikolay Aleksandrov 2015-08-04  114  		+ nla_total_size(1)	/* IFLA_BRPORT_PROXYARP */
786c2077 Nikolay Aleksandrov 2015-08-04  115  		+ nla_total_size(1)	/* IFLA_BRPORT_PROXYARP_WIFI */
1706db4b Nikolay Aleksandrov 2015-10-06  116  		+ nla_total_size(sizeof(struct ifla_bridge_id))	/* IFLA_BRPORT_ROOT_ID */
25c71c75 stephen hemminger   2012-11-13  117  		+ 0;
25c71c75 stephen hemminger   2012-11-13  118  }
25c71c75 stephen hemminger   2012-11-13  119  
fed0a159 Roopa Prabhu        2015-02-25  120  static inline size_t br_nlmsg_size(struct net_device *dev, u32 filter_mask)
339bf98f Thomas Graf         2006-11-10  121  {
339bf98f Thomas Graf         2006-11-10  122  	return NLMSG_ALIGN(sizeof(struct ifinfomsg))
339bf98f Thomas Graf         2006-11-10  123  		+ nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */
339bf98f Thomas Graf         2006-11-10  124  		+ nla_total_size(MAX_ADDR_LEN) /* IFLA_ADDRESS */
339bf98f Thomas Graf         2006-11-10  125  		+ nla_total_size(4) /* IFLA_MASTER */
339bf98f Thomas Graf         2006-11-10  126  		+ nla_total_size(4) /* IFLA_MTU */
339bf98f Thomas Graf         2006-11-10  127  		+ nla_total_size(4) /* IFLA_LINK */
339bf98f Thomas Graf         2006-11-10  128  		+ nla_total_size(1) /* IFLA_OPERSTATE */
b7853d73 Roopa Prabhu        2015-02-21  129  		+ nla_total_size(br_port_info_size()) /* IFLA_PROTINFO */
fed0a159 Roopa Prabhu        2015-02-25  130  		+ nla_total_size(br_get_link_af_size_filtered(dev,
fed0a159 Roopa Prabhu        2015-02-25  131  				 filter_mask)); /* IFLA_AF_SPEC */
25c71c75 stephen hemminger   2012-11-13  132  }
25c71c75 stephen hemminger   2012-11-13  133  
25c71c75 stephen hemminger   2012-11-13  134  static int br_port_fill_attrs(struct sk_buff *skb,
25c71c75 stephen hemminger   2012-11-13  135  			      const struct net_bridge_port *p)
25c71c75 stephen hemminger   2012-11-13  136  {
25c71c75 stephen hemminger   2012-11-13  137  	u8 mode = !!(p->flags & BR_HAIRPIN_MODE);
25c71c75 stephen hemminger   2012-11-13  138  
25c71c75 stephen hemminger   2012-11-13 @139  	if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
25c71c75 stephen hemminger   2012-11-13  140  	    nla_put_u16(skb, IFLA_BRPORT_PRIORITY, p->priority) ||
25c71c75 stephen hemminger   2012-11-13  141  	    nla_put_u32(skb, IFLA_BRPORT_COST, p->path_cost) ||
a2e01a65 stephen hemminger   2012-11-13  142  	    nla_put_u8(skb, IFLA_BRPORT_MODE, mode) ||

:::::: The code at line 139 was first introduced by commit
:::::: 25c71c75ac87508528db053b818944f3650dd7a6 bridge: bridge port parameters over netlink

:::::: TO: stephen hemminger <shemminger@...tta.com>
:::::: CC: David S. Miller <davem@...emloft.net>

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

Download attachment ".config.gz" of type "application/octet-stream" (30865 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ