All of lore.kernel.org
 help / color / mirror / Atom feed
* [saeed:net-next 14/98] net/ipv6/ip6_output.c:154 ip6_finish_output_gso_slowpath_drop() error: uninitialized symbol 'ret'.
@ 2021-01-05 12:18 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-01-05 12:18 UTC (permalink / raw)
  To: kbuild

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git net-next
head:   5d0f806c7608fe61c73b31b28411ebb94b962ebf
commit: d1521c0603f22c6702c63c9354e80cd94d6c7dc6 [14/98] net: ipv6: Validate GSO SKB before finish IPv6 processing
config: x86_64-randconfig-m001-20201229 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
net/ipv6/ip6_output.c:154 ip6_finish_output_gso_slowpath_drop() error: uninitialized symbol 'ret'.

Old smatch warnings:
net/ipv6/ip6_output.c:158 ip6_finish_output_gso_slowpath_drop() error: uninitialized symbol 'ret'.
net/ipv6/ip6_output.c:291 ip6_xmit() error: we previously assumed 'np' could be null (see line 285)

vim +/ret +154 net/ipv6/ip6_output.c

d1521c0603f22c6 Aya Levin      2020-12-16  128  static int
d1521c0603f22c6 Aya Levin      2020-12-16  129  ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,
d1521c0603f22c6 Aya Levin      2020-12-16  130  				    struct sk_buff *skb, unsigned int mtu)
d1521c0603f22c6 Aya Levin      2020-12-16  131  {
d1521c0603f22c6 Aya Levin      2020-12-16  132  	struct sk_buff *segs, *nskb;
d1521c0603f22c6 Aya Levin      2020-12-16  133  	netdev_features_t features;
d1521c0603f22c6 Aya Levin      2020-12-16  134  	int ret;
                                                        ^^^^^^^

d1521c0603f22c6 Aya Levin      2020-12-16  135  
d1521c0603f22c6 Aya Levin      2020-12-16  136  	/* Please see corresponding comment in ip_finish_output_gso
d1521c0603f22c6 Aya Levin      2020-12-16  137  	 * describing the cases where GSO segment length exceeds the
d1521c0603f22c6 Aya Levin      2020-12-16  138  	 * egress MTU.
d1521c0603f22c6 Aya Levin      2020-12-16  139  	 */
d1521c0603f22c6 Aya Levin      2020-12-16  140  	features = netif_skb_features(skb);
d1521c0603f22c6 Aya Levin      2020-12-16  141  	segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
d1521c0603f22c6 Aya Levin      2020-12-16  142  	if (IS_ERR_OR_NULL(segs)) {
d1521c0603f22c6 Aya Levin      2020-12-16  143  		kfree_skb(skb);
d1521c0603f22c6 Aya Levin      2020-12-16  144  		return -ENOMEM;
d1521c0603f22c6 Aya Levin      2020-12-16  145  	}
d1521c0603f22c6 Aya Levin      2020-12-16  146  
d1521c0603f22c6 Aya Levin      2020-12-16  147  	consume_skb(skb);
d1521c0603f22c6 Aya Levin      2020-12-16  148  
d1521c0603f22c6 Aya Levin      2020-12-16  149  	skb_list_walk_safe(segs, segs, nskb) {
d1521c0603f22c6 Aya Levin      2020-12-16  150  		int err;
d1521c0603f22c6 Aya Levin      2020-12-16  151  
d1521c0603f22c6 Aya Levin      2020-12-16  152  		skb_mark_not_on_list(segs);
d1521c0603f22c6 Aya Levin      2020-12-16  153  		err = ip6_fragment(net, sk, segs, ip6_finish_output2);
d1521c0603f22c6 Aya Levin      2020-12-16 @154  		if (err && ret == 0)
                                                                           ^^^^^^^^
"ret" is uninitialized for the first error.

d1521c0603f22c6 Aya Levin      2020-12-16  155  			ret = err;
d1521c0603f22c6 Aya Levin      2020-12-16  156  	}
d1521c0603f22c6 Aya Levin      2020-12-16  157  
d1521c0603f22c6 Aya Levin      2020-12-16  158  	return ret;
d1521c0603f22c6 Aya Levin      2020-12-16  159  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [saeed:net-next 14/98] net/ipv6/ip6_output.c:154 ip6_finish_output_gso_slowpath_drop() error: uninitialized symbol 'ret'.
@ 2020-12-29  9:55 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-12-29  9:55 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Aya Levin <ayal@nvidia.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git net-next
head:   5d0f806c7608fe61c73b31b28411ebb94b962ebf
commit: d1521c0603f22c6702c63c9354e80cd94d6c7dc6 [14/98] net: ipv6: Validate GSO SKB before finish IPv6 processing
:::::: branch date: 10 hours ago
:::::: commit date: 19 hours ago
config: x86_64-randconfig-m001-20201229 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
net/ipv6/ip6_output.c:154 ip6_finish_output_gso_slowpath_drop() error: uninitialized symbol 'ret'.

Old smatch warnings:
net/ipv6/ip6_output.c:158 ip6_finish_output_gso_slowpath_drop() error: uninitialized symbol 'ret'.
net/ipv6/ip6_output.c:291 ip6_xmit() error: we previously assumed 'np' could be null (see line 285)

vim +/ret +154 net/ipv6/ip6_output.c

^1da177e4c3f415 Linus Torvalds 2005-04-16  127  
d1521c0603f22c6 Aya Levin      2020-12-16  128  static int
d1521c0603f22c6 Aya Levin      2020-12-16  129  ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,
d1521c0603f22c6 Aya Levin      2020-12-16  130  				    struct sk_buff *skb, unsigned int mtu)
d1521c0603f22c6 Aya Levin      2020-12-16  131  {
d1521c0603f22c6 Aya Levin      2020-12-16  132  	struct sk_buff *segs, *nskb;
d1521c0603f22c6 Aya Levin      2020-12-16  133  	netdev_features_t features;
d1521c0603f22c6 Aya Levin      2020-12-16  134  	int ret;
d1521c0603f22c6 Aya Levin      2020-12-16  135  
d1521c0603f22c6 Aya Levin      2020-12-16  136  	/* Please see corresponding comment in ip_finish_output_gso
d1521c0603f22c6 Aya Levin      2020-12-16  137  	 * describing the cases where GSO segment length exceeds the
d1521c0603f22c6 Aya Levin      2020-12-16  138  	 * egress MTU.
d1521c0603f22c6 Aya Levin      2020-12-16  139  	 */
d1521c0603f22c6 Aya Levin      2020-12-16  140  	features = netif_skb_features(skb);
d1521c0603f22c6 Aya Levin      2020-12-16  141  	segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
d1521c0603f22c6 Aya Levin      2020-12-16  142  	if (IS_ERR_OR_NULL(segs)) {
d1521c0603f22c6 Aya Levin      2020-12-16  143  		kfree_skb(skb);
d1521c0603f22c6 Aya Levin      2020-12-16  144  		return -ENOMEM;
d1521c0603f22c6 Aya Levin      2020-12-16  145  	}
d1521c0603f22c6 Aya Levin      2020-12-16  146  
d1521c0603f22c6 Aya Levin      2020-12-16  147  	consume_skb(skb);
d1521c0603f22c6 Aya Levin      2020-12-16  148  
d1521c0603f22c6 Aya Levin      2020-12-16  149  	skb_list_walk_safe(segs, segs, nskb) {
d1521c0603f22c6 Aya Levin      2020-12-16  150  		int err;
d1521c0603f22c6 Aya Levin      2020-12-16  151  
d1521c0603f22c6 Aya Levin      2020-12-16  152  		skb_mark_not_on_list(segs);
d1521c0603f22c6 Aya Levin      2020-12-16  153  		err = ip6_fragment(net, sk, segs, ip6_finish_output2);
d1521c0603f22c6 Aya Levin      2020-12-16 @154  		if (err && ret == 0)
d1521c0603f22c6 Aya Levin      2020-12-16  155  			ret = err;
d1521c0603f22c6 Aya Levin      2020-12-16  156  	}
d1521c0603f22c6 Aya Levin      2020-12-16  157  
d1521c0603f22c6 Aya Levin      2020-12-16  158  	return ret;
d1521c0603f22c6 Aya Levin      2020-12-16  159  }
d1521c0603f22c6 Aya Levin      2020-12-16  160  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

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

end of thread, other threads:[~2021-01-05 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-05 12:18 [saeed:net-next 14/98] net/ipv6/ip6_output.c:154 ip6_finish_output_gso_slowpath_drop() error: uninitialized symbol 'ret' Dan Carpenter
2021-01-05 12:18 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-12-29  9:55 kernel test robot

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.