All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next:master 375/376] net/core/rtnetlink.c:3099:1: warning: the frame size of 1280 bytes is larger than 1024 bytes
@ 2018-06-01  5:07 kbuild test robot
  2018-06-01 22:06 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2018-06-01  5:07 UTC (permalink / raw)
  To: Kees Cook; +Cc: kbuild-all, netdev

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   4b8e6ac41a594ea67ded6af6af5935f03221ea4c
commit: ccf8dbcd062a930e64741c939ca784d15316aa0c [375/376] rtnetlink: Remove VLA usage
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        git checkout ccf8dbcd062a930e64741c939ca784d15316aa0c
        # save the attached .config to linux build tree
        make ARCH=um SUBARCH=x86_64

All warnings (new ones prefixed by >>):

   net/core/rtnetlink.c: In function 'rtnl_newlink':
>> net/core/rtnetlink.c:3099:1: warning: the frame size of 1280 bytes is larger than 1024 bytes [-Wframe-larger-than=]
    }
    ^

vim +3099 net/core/rtnetlink.c

e7ed828f1 Vlad Dogaru       2011-01-13  2842  
c21ef3e34 David Ahern       2017-04-16  2843  static int rtnl_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
c21ef3e34 David Ahern       2017-04-16  2844  			struct netlink_ext_ack *extack)
38f7b870d Patrick McHardy   2007-06-13  2845  {
3b1e0a655 YOSHIFUJI Hideaki 2008-03-26  2846  	struct net *net = sock_net(skb->sk);
38f7b870d Patrick McHardy   2007-06-13  2847  	const struct rtnl_link_ops *ops;
ba7d49b1f Jiri Pirko        2014-01-22  2848  	const struct rtnl_link_ops *m_ops = NULL;
38f7b870d Patrick McHardy   2007-06-13  2849  	struct net_device *dev;
ba7d49b1f Jiri Pirko        2014-01-22  2850  	struct net_device *master_dev = NULL;
38f7b870d Patrick McHardy   2007-06-13  2851  	struct ifinfomsg *ifm;
38f7b870d Patrick McHardy   2007-06-13  2852  	char kind[MODULE_NAME_LEN];
38f7b870d Patrick McHardy   2007-06-13  2853  	char ifname[IFNAMSIZ];
38f7b870d Patrick McHardy   2007-06-13  2854  	struct nlattr *tb[IFLA_MAX+1];
38f7b870d Patrick McHardy   2007-06-13  2855  	struct nlattr *linkinfo[IFLA_INFO_MAX+1];
5517750f0 Tom Gundersen     2014-07-14  2856  	unsigned char name_assign_type = NET_NAME_USER;
38f7b870d Patrick McHardy   2007-06-13  2857  	int err;
38f7b870d Patrick McHardy   2007-06-13  2858  
95a5afca4 Johannes Berg     2008-10-16  2859  #ifdef CONFIG_MODULES
38f7b870d Patrick McHardy   2007-06-13  2860  replay:
8072f085d Thomas Graf       2007-07-31  2861  #endif
c21ef3e34 David Ahern       2017-04-16  2862  	err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
38f7b870d Patrick McHardy   2007-06-13  2863  	if (err < 0)
38f7b870d Patrick McHardy   2007-06-13  2864  		return err;
38f7b870d Patrick McHardy   2007-06-13  2865  
4ff66cae7 Christian Brauner 2018-02-07  2866  	err = rtnl_ensure_unique_netns(tb, extack, false);
4ff66cae7 Christian Brauner 2018-02-07  2867  	if (err < 0)
4ff66cae7 Christian Brauner 2018-02-07  2868  		return err;
4ff66cae7 Christian Brauner 2018-02-07  2869  
38f7b870d Patrick McHardy   2007-06-13  2870  	if (tb[IFLA_IFNAME])
38f7b870d Patrick McHardy   2007-06-13  2871  		nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
38f7b870d Patrick McHardy   2007-06-13  2872  	else
38f7b870d Patrick McHardy   2007-06-13  2873  		ifname[0] = '\0';
38f7b870d Patrick McHardy   2007-06-13  2874  
38f7b870d Patrick McHardy   2007-06-13  2875  	ifm = nlmsg_data(nlh);
38f7b870d Patrick McHardy   2007-06-13  2876  	if (ifm->ifi_index > 0)
881d966b4 Eric W. Biederman 2007-09-17  2877  		dev = __dev_get_by_index(net, ifm->ifi_index);
e7ed828f1 Vlad Dogaru       2011-01-13  2878  	else {
e7ed828f1 Vlad Dogaru       2011-01-13  2879  		if (ifname[0])
881d966b4 Eric W. Biederman 2007-09-17  2880  			dev = __dev_get_by_name(net, ifname);
38f7b870d Patrick McHardy   2007-06-13  2881  		else
38f7b870d Patrick McHardy   2007-06-13  2882  			dev = NULL;
e7ed828f1 Vlad Dogaru       2011-01-13  2883  	}
38f7b870d Patrick McHardy   2007-06-13  2884  
ba7d49b1f Jiri Pirko        2014-01-22  2885  	if (dev) {
ba7d49b1f Jiri Pirko        2014-01-22  2886  		master_dev = netdev_master_upper_dev_get(dev);
ba7d49b1f Jiri Pirko        2014-01-22  2887  		if (master_dev)
ba7d49b1f Jiri Pirko        2014-01-22  2888  			m_ops = master_dev->rtnl_link_ops;
ba7d49b1f Jiri Pirko        2014-01-22  2889  	}
ba7d49b1f Jiri Pirko        2014-01-22  2890  
e0d087af7 Eric Dumazet      2009-11-07  2891  	err = validate_linkmsg(dev, tb);
e0d087af7 Eric Dumazet      2009-11-07  2892  	if (err < 0)
1840bb13c Thomas Graf       2008-02-23  2893  		return err;
1840bb13c Thomas Graf       2008-02-23  2894  
38f7b870d Patrick McHardy   2007-06-13  2895  	if (tb[IFLA_LINKINFO]) {
38f7b870d Patrick McHardy   2007-06-13  2896  		err = nla_parse_nested(linkinfo, IFLA_INFO_MAX,
fceb6435e Johannes Berg     2017-04-12  2897  				       tb[IFLA_LINKINFO], ifla_info_policy,
fceb6435e Johannes Berg     2017-04-12  2898  				       NULL);
38f7b870d Patrick McHardy   2007-06-13  2899  		if (err < 0)
38f7b870d Patrick McHardy   2007-06-13  2900  			return err;
38f7b870d Patrick McHardy   2007-06-13  2901  	} else
38f7b870d Patrick McHardy   2007-06-13  2902  		memset(linkinfo, 0, sizeof(linkinfo));
38f7b870d Patrick McHardy   2007-06-13  2903  
38f7b870d Patrick McHardy   2007-06-13  2904  	if (linkinfo[IFLA_INFO_KIND]) {
38f7b870d Patrick McHardy   2007-06-13  2905  		nla_strlcpy(kind, linkinfo[IFLA_INFO_KIND], sizeof(kind));
38f7b870d Patrick McHardy   2007-06-13  2906  		ops = rtnl_link_ops_get(kind);
38f7b870d Patrick McHardy   2007-06-13  2907  	} else {
38f7b870d Patrick McHardy   2007-06-13  2908  		kind[0] = '\0';
38f7b870d Patrick McHardy   2007-06-13  2909  		ops = NULL;
38f7b870d Patrick McHardy   2007-06-13  2910  	}
38f7b870d Patrick McHardy   2007-06-13  2911  
38f7b870d Patrick McHardy   2007-06-13  2912  	if (1) {
ccf8dbcd0 Kees Cook         2018-05-30  2913  		struct nlattr *attr[RTNL_MAX_TYPE + 1];
ccf8dbcd0 Kees Cook         2018-05-30  2914  		struct nlattr *slave_attr[RTNL_SLAVE_MAX_TYPE + 1];
ba7d49b1f Jiri Pirko        2014-01-22  2915  		struct nlattr **data = NULL;
ba7d49b1f Jiri Pirko        2014-01-22  2916  		struct nlattr **slave_data = NULL;
317f4810e Nicolas Dichtel   2015-01-15  2917  		struct net *dest_net, *link_net = NULL;
38f7b870d Patrick McHardy   2007-06-13  2918  
38f7b870d Patrick McHardy   2007-06-13  2919  		if (ops) {
ccf8dbcd0 Kees Cook         2018-05-30  2920  			if (ops->maxtype > RTNL_MAX_TYPE)
ccf8dbcd0 Kees Cook         2018-05-30  2921  				return -EINVAL;
ccf8dbcd0 Kees Cook         2018-05-30  2922  
38f7b870d Patrick McHardy   2007-06-13  2923  			if (ops->maxtype && linkinfo[IFLA_INFO_DATA]) {
38f7b870d Patrick McHardy   2007-06-13  2924  				err = nla_parse_nested(attr, ops->maxtype,
38f7b870d Patrick McHardy   2007-06-13  2925  						       linkinfo[IFLA_INFO_DATA],
fceb6435e Johannes Berg     2017-04-12  2926  						       ops->policy, NULL);
38f7b870d Patrick McHardy   2007-06-13  2927  				if (err < 0)
38f7b870d Patrick McHardy   2007-06-13  2928  					return err;
38f7b870d Patrick McHardy   2007-06-13  2929  				data = attr;
38f7b870d Patrick McHardy   2007-06-13  2930  			}
38f7b870d Patrick McHardy   2007-06-13  2931  			if (ops->validate) {
a8b8a889e Matthias Schiffer 2017-06-25  2932  				err = ops->validate(tb, data, extack);
38f7b870d Patrick McHardy   2007-06-13  2933  				if (err < 0)
38f7b870d Patrick McHardy   2007-06-13  2934  					return err;
38f7b870d Patrick McHardy   2007-06-13  2935  			}
38f7b870d Patrick McHardy   2007-06-13  2936  		}
38f7b870d Patrick McHardy   2007-06-13  2937  
ba7d49b1f Jiri Pirko        2014-01-22  2938  		if (m_ops) {
ccf8dbcd0 Kees Cook         2018-05-30  2939  			if (ops->slave_maxtype > RTNL_SLAVE_MAX_TYPE)
ccf8dbcd0 Kees Cook         2018-05-30  2940  				return -EINVAL;
ccf8dbcd0 Kees Cook         2018-05-30  2941  
ba7d49b1f Jiri Pirko        2014-01-22  2942  			if (m_ops->slave_maxtype &&
ba7d49b1f Jiri Pirko        2014-01-22  2943  			    linkinfo[IFLA_INFO_SLAVE_DATA]) {
ba7d49b1f Jiri Pirko        2014-01-22  2944  				err = nla_parse_nested(slave_attr,
ba7d49b1f Jiri Pirko        2014-01-22  2945  						       m_ops->slave_maxtype,
ba7d49b1f Jiri Pirko        2014-01-22  2946  						       linkinfo[IFLA_INFO_SLAVE_DATA],
fceb6435e Johannes Berg     2017-04-12  2947  						       m_ops->slave_policy,
fceb6435e Johannes Berg     2017-04-12  2948  						       NULL);
ba7d49b1f Jiri Pirko        2014-01-22  2949  				if (err < 0)
ba7d49b1f Jiri Pirko        2014-01-22  2950  					return err;
ba7d49b1f Jiri Pirko        2014-01-22  2951  				slave_data = slave_attr;
ba7d49b1f Jiri Pirko        2014-01-22  2952  			}
ba7d49b1f Jiri Pirko        2014-01-22  2953  		}
ba7d49b1f Jiri Pirko        2014-01-22  2954  
38f7b870d Patrick McHardy   2007-06-13  2955  		if (dev) {
90c325e3b Nicolas Dichtel   2014-09-01  2956  			int status = 0;
38f7b870d Patrick McHardy   2007-06-13  2957  
38f7b870d Patrick McHardy   2007-06-13  2958  			if (nlh->nlmsg_flags & NLM_F_EXCL)
38f7b870d Patrick McHardy   2007-06-13  2959  				return -EEXIST;
38f7b870d Patrick McHardy   2007-06-13  2960  			if (nlh->nlmsg_flags & NLM_F_REPLACE)
38f7b870d Patrick McHardy   2007-06-13  2961  				return -EOPNOTSUPP;
38f7b870d Patrick McHardy   2007-06-13  2962  
38f7b870d Patrick McHardy   2007-06-13  2963  			if (linkinfo[IFLA_INFO_DATA]) {
38f7b870d Patrick McHardy   2007-06-13  2964  				if (!ops || ops != dev->rtnl_link_ops ||
38f7b870d Patrick McHardy   2007-06-13  2965  				    !ops->changelink)
38f7b870d Patrick McHardy   2007-06-13  2966  					return -EOPNOTSUPP;
38f7b870d Patrick McHardy   2007-06-13  2967  
ad744b223 Matthias Schiffer 2017-06-25  2968  				err = ops->changelink(dev, tb, data, extack);
38f7b870d Patrick McHardy   2007-06-13  2969  				if (err < 0)
38f7b870d Patrick McHardy   2007-06-13  2970  					return err;
ba9989069 Nicolas Dichtel   2014-09-01  2971  				status |= DO_SETLINK_NOTIFY;
38f7b870d Patrick McHardy   2007-06-13  2972  			}
38f7b870d Patrick McHardy   2007-06-13  2973  
ba7d49b1f Jiri Pirko        2014-01-22  2974  			if (linkinfo[IFLA_INFO_SLAVE_DATA]) {
ba7d49b1f Jiri Pirko        2014-01-22  2975  				if (!m_ops || !m_ops->slave_changelink)
ba7d49b1f Jiri Pirko        2014-01-22  2976  					return -EOPNOTSUPP;
ba7d49b1f Jiri Pirko        2014-01-22  2977  
ba7d49b1f Jiri Pirko        2014-01-22  2978  				err = m_ops->slave_changelink(master_dev, dev,
17dd0ec47 Matthias Schiffer 2017-06-25  2979  							      tb, slave_data,
17dd0ec47 Matthias Schiffer 2017-06-25  2980  							      extack);
ba7d49b1f Jiri Pirko        2014-01-22  2981  				if (err < 0)
ba7d49b1f Jiri Pirko        2014-01-22  2982  					return err;
ba9989069 Nicolas Dichtel   2014-09-01  2983  				status |= DO_SETLINK_NOTIFY;
ba7d49b1f Jiri Pirko        2014-01-22  2984  			}
ba7d49b1f Jiri Pirko        2014-01-22  2985  
ddf9f9707 Jakub Kicinski    2017-04-30  2986  			return do_setlink(skb, dev, ifm, extack, tb, ifname,
ddf9f9707 Jakub Kicinski    2017-04-30  2987  					  status);
38f7b870d Patrick McHardy   2007-06-13  2988  		}
38f7b870d Patrick McHardy   2007-06-13  2989  
ffa934f19 Patrick McHardy   2011-01-20  2990  		if (!(nlh->nlmsg_flags & NLM_F_CREATE)) {
ffa934f19 Patrick McHardy   2011-01-20  2991  			if (ifm->ifi_index == 0 && tb[IFLA_GROUP])
90f62cf30 Eric W. Biederman 2014-04-23  2992  				return rtnl_group_changelink(skb, net,
ffa934f19 Patrick McHardy   2011-01-20  2993  						nla_get_u32(tb[IFLA_GROUP]),
ddf9f9707 Jakub Kicinski    2017-04-30  2994  						ifm, extack, tb);
38f7b870d Patrick McHardy   2007-06-13  2995  			return -ENODEV;
ffa934f19 Patrick McHardy   2011-01-20  2996  		}
38f7b870d Patrick McHardy   2007-06-13  2997  
160ca0142 Theuns Verwoerd   2017-01-31  2998  		if (tb[IFLA_MAP] || tb[IFLA_PROTINFO])
38f7b870d Patrick McHardy   2007-06-13  2999  			return -EOPNOTSUPP;
38f7b870d Patrick McHardy   2007-06-13  3000  
38f7b870d Patrick McHardy   2007-06-13  3001  		if (!ops) {
95a5afca4 Johannes Berg     2008-10-16  3002  #ifdef CONFIG_MODULES
38f7b870d Patrick McHardy   2007-06-13  3003  			if (kind[0]) {
38f7b870d Patrick McHardy   2007-06-13  3004  				__rtnl_unlock();
38f7b870d Patrick McHardy   2007-06-13  3005  				request_module("rtnl-link-%s", kind);
38f7b870d Patrick McHardy   2007-06-13  3006  				rtnl_lock();
38f7b870d Patrick McHardy   2007-06-13  3007  				ops = rtnl_link_ops_get(kind);
38f7b870d Patrick McHardy   2007-06-13  3008  				if (ops)
38f7b870d Patrick McHardy   2007-06-13  3009  					goto replay;
38f7b870d Patrick McHardy   2007-06-13  3010  			}
38f7b870d Patrick McHardy   2007-06-13  3011  #endif
38f7b870d Patrick McHardy   2007-06-13  3012  			return -EOPNOTSUPP;
38f7b870d Patrick McHardy   2007-06-13  3013  		}
38f7b870d Patrick McHardy   2007-06-13  3014  
b0ab2fabb Jiri Pirko        2014-06-26  3015  		if (!ops->setup)
b0ab2fabb Jiri Pirko        2014-06-26  3016  			return -EOPNOTSUPP;
b0ab2fabb Jiri Pirko        2014-06-26  3017  
5517750f0 Tom Gundersen     2014-07-14  3018  		if (!ifname[0]) {
38f7b870d Patrick McHardy   2007-06-13  3019  			snprintf(ifname, IFNAMSIZ, "%s%%d", ops->kind);
5517750f0 Tom Gundersen     2014-07-14  3020  			name_assign_type = NET_NAME_ENUM;
5517750f0 Tom Gundersen     2014-07-14  3021  		}
38f7b870d Patrick McHardy   2007-06-13  3022  
5bb8ed075 Christian Brauner 2018-01-29  3023  		dest_net = rtnl_link_get_net_capable(skb, net, tb, CAP_NET_ADMIN);
13ad17745 Eric W. Biederman 2011-01-29  3024  		if (IS_ERR(dest_net))
13ad17745 Eric W. Biederman 2011-01-29  3025  			return PTR_ERR(dest_net);
13ad17745 Eric W. Biederman 2011-01-29  3026  
317f4810e Nicolas Dichtel   2015-01-15  3027  		if (tb[IFLA_LINK_NETNSID]) {
317f4810e Nicolas Dichtel   2015-01-15  3028  			int id = nla_get_s32(tb[IFLA_LINK_NETNSID]);
317f4810e Nicolas Dichtel   2015-01-15  3029  
317f4810e Nicolas Dichtel   2015-01-15  3030  			link_net = get_net_ns_by_id(dest_net, id);
317f4810e Nicolas Dichtel   2015-01-15  3031  			if (!link_net) {
317f4810e Nicolas Dichtel   2015-01-15  3032  				err =  -EINVAL;
317f4810e Nicolas Dichtel   2015-01-15  3033  				goto out;
317f4810e Nicolas Dichtel   2015-01-15  3034  			}
06615bed6 Eric W. Biederman 2015-02-26  3035  			err = -EPERM;
06615bed6 Eric W. Biederman 2015-02-26  3036  			if (!netlink_ns_capable(skb, link_net->user_ns, CAP_NET_ADMIN))
06615bed6 Eric W. Biederman 2015-02-26  3037  				goto out;
317f4810e Nicolas Dichtel   2015-01-15  3038  		}
317f4810e Nicolas Dichtel   2015-01-15  3039  
317f4810e Nicolas Dichtel   2015-01-15  3040  		dev = rtnl_create_link(link_net ? : dest_net, ifname,
317f4810e Nicolas Dichtel   2015-01-15  3041  				       name_assign_type, ops, tb);
9c7dafbfa Pavel Emelyanov   2012-08-08  3042  		if (IS_ERR(dev)) {
e71992889 Pavel Emelianov   2007-08-08  3043  			err = PTR_ERR(dev);
9c7dafbfa Pavel Emelyanov   2012-08-08  3044  			goto out;
9c7dafbfa Pavel Emelyanov   2012-08-08  3045  		}
9c7dafbfa Pavel Emelyanov   2012-08-08  3046  
9c7dafbfa Pavel Emelyanov   2012-08-08  3047  		dev->ifindex = ifm->ifi_index;
9c7dafbfa Pavel Emelyanov   2012-08-08  3048  
0e0eee246 Cong Wang         2014-02-11  3049  		if (ops->newlink) {
7a3f4a185 Matthias Schiffer 2017-06-25  3050  			err = ops->newlink(link_net ? : net, dev, tb, data,
7a3f4a185 Matthias Schiffer 2017-06-25  3051  					   extack);
0e0eee246 Cong Wang         2014-02-11  3052  			/* Drivers should call free_netdev() in ->destructor
e51fb1523 Cong Wang         2014-06-03  3053  			 * and unregister it on failure after registration
e51fb1523 Cong Wang         2014-06-03  3054  			 * so that device could be finally freed in rtnl_unlock.
0e0eee246 Cong Wang         2014-02-11  3055  			 */
e51fb1523 Cong Wang         2014-06-03  3056  			if (err < 0) {
e51fb1523 Cong Wang         2014-06-03  3057  				/* If device is not registered at all, free it now */
e51fb1523 Cong Wang         2014-06-03  3058  				if (dev->reg_state == NETREG_UNINITIALIZED)
e51fb1523 Cong Wang         2014-06-03  3059  					free_netdev(dev);
0e0eee246 Cong Wang         2014-02-11  3060  				goto out;
e51fb1523 Cong Wang         2014-06-03  3061  			}
0e0eee246 Cong Wang         2014-02-11  3062  		} else {
2d85cba2b Patrick McHardy   2007-07-11  3063  			err = register_netdevice(dev);
fce9b9be8 Dan Carpenter     2013-08-14  3064  			if (err < 0) {
38f7b870d Patrick McHardy   2007-06-13  3065  				free_netdev(dev);
3729d5021 Patrick McHardy   2010-02-26  3066  				goto out;
fce9b9be8 Dan Carpenter     2013-08-14  3067  			}
0e0eee246 Cong Wang         2014-02-11  3068  		}
3729d5021 Patrick McHardy   2010-02-26  3069  		err = rtnl_configure_link(dev, ifm);
436389007 David S. Miller   2015-03-10  3070  		if (err < 0)
436389007 David S. Miller   2015-03-10  3071  			goto out_unregister;
bdef279b9 Nicolas Dichtel   2015-01-20  3072  		if (link_net) {
317f4810e Nicolas Dichtel   2015-01-15  3073  			err = dev_change_net_namespace(dev, dest_net, ifname);
bdef279b9 Nicolas Dichtel   2015-01-20  3074  			if (err < 0)
436389007 David S. Miller   2015-03-10  3075  				goto out_unregister;
bdef279b9 Nicolas Dichtel   2015-01-20  3076  		}
160ca0142 Theuns Verwoerd   2017-01-31  3077  		if (tb[IFLA_MASTER]) {
33eaf2a6e David Ahern       2017-10-04  3078  			err = do_set_master(dev, nla_get_u32(tb[IFLA_MASTER]),
33eaf2a6e David Ahern       2017-10-04  3079  					    extack);
160ca0142 Theuns Verwoerd   2017-01-31  3080  			if (err)
160ca0142 Theuns Verwoerd   2017-01-31  3081  				goto out_unregister;
160ca0142 Theuns Verwoerd   2017-01-31  3082  		}
3729d5021 Patrick McHardy   2010-02-26  3083  out:
317f4810e Nicolas Dichtel   2015-01-15  3084  		if (link_net)
317f4810e Nicolas Dichtel   2015-01-15  3085  			put_net(link_net);
81adee47d Eric W. Biederman 2009-11-08  3086  		put_net(dest_net);
38f7b870d Patrick McHardy   2007-06-13  3087  		return err;
436389007 David S. Miller   2015-03-10  3088  out_unregister:
436389007 David S. Miller   2015-03-10  3089  		if (ops->newlink) {
436389007 David S. Miller   2015-03-10  3090  			LIST_HEAD(list_kill);
436389007 David S. Miller   2015-03-10  3091  
436389007 David S. Miller   2015-03-10  3092  			ops->dellink(dev, &list_kill);
436389007 David S. Miller   2015-03-10  3093  			unregister_netdevice_many(&list_kill);
436389007 David S. Miller   2015-03-10  3094  		} else {
436389007 David S. Miller   2015-03-10  3095  			unregister_netdevice(dev);
436389007 David S. Miller   2015-03-10  3096  		}
436389007 David S. Miller   2015-03-10  3097  		goto out;
38f7b870d Patrick McHardy   2007-06-13  3098  	}
38f7b870d Patrick McHardy   2007-06-13 @3099  }
38f7b870d Patrick McHardy   2007-06-13  3100  

:::::: The code at line 3099 was first introduced by commit
:::::: 38f7b870d4a6a5d3ec21557e849620cb7d032965 [RTNETLINK]: Link creation API

:::::: TO: Patrick McHardy <kaber@trash.net>
:::::: CC: David S. Miller <davem@sunset.davemloft.net>

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

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

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

* Re: [net-next:master 375/376] net/core/rtnetlink.c:3099:1: warning: the frame size of 1280 bytes is larger than 1024 bytes
  2018-06-01  5:07 [net-next:master 375/376] net/core/rtnetlink.c:3099:1: warning: the frame size of 1280 bytes is larger than 1024 bytes kbuild test robot
@ 2018-06-01 22:06 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2018-06-01 22:06 UTC (permalink / raw)
  To: kbuild test robot, Richard Weinberger, Jeff Dike, Ramkumar Ramachandra
  Cc: kbuild-all, Network Development

On Thu, May 31, 2018 at 10:07 PM, kbuild test robot <lkp@intel.com> wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
> head:   4b8e6ac41a594ea67ded6af6af5935f03221ea4c
> commit: ccf8dbcd062a930e64741c939ca784d15316aa0c [375/376] rtnetlink: Remove VLA usage
> config: um-x86_64_defconfig (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
> reproduce:
>         git checkout ccf8dbcd062a930e64741c939ca784d15316aa0c
>         # save the attached .config to linux build tree
>         make ARCH=um SUBARCH=x86_64
>
> All warnings (new ones prefixed by >>):
>
>    net/core/rtnetlink.c: In function 'rtnl_newlink':
>>> net/core/rtnetlink.c:3099:1: warning: the frame size of 1280 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>     }
>     ^

The recent removal of the VLA has exposed how large it's possible for
this stack allocation to get (i.e. it was hidden from the checker
before because it was a VLA). This warning doesn't trip on regular
x86_64 because the -Wframe-larger-than is 2048. It seems like 64-bit
um should have the same 64-bit value (instead of using the 32-bit
value):

arch/um/configs/x86_64_defconfig:CONFIG_FRAME_WARN=1024

lib/Kconfig.debug:
config FRAME_WARN
        int "Warn for stack frames larger than (needs gcc 4.4)"
        range 0 8192
        default 3072 if KASAN_EXTRA
        default 2048 if GCC_PLUGIN_LATENT_ENTROPY
        default 1280 if (!64BIT && PARISC)
        default 1024 if (!64BIT && !PARISC)
        default 2048 if 64BIT

Just dropping the defconfig there should fix it. (And I think it was
just a mistake to port that value when splitting the um defconfig in
commit e40f04d040c6 ("arch/um: make it work with defconfig and
x86_64").

-Kees

-- 
Kees Cook
Pixel Security

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

end of thread, other threads:[~2018-06-01 22:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-01  5:07 [net-next:master 375/376] net/core/rtnetlink.c:3099:1: warning: the frame size of 1280 bytes is larger than 1024 bytes kbuild test robot
2018-06-01 22:06 ` Kees Cook

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.