From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH V2 net-next 5/5] icmp: add response to RFC 8335 PROBE messages
Date: Thu, 04 Feb 2021 10:15:13 +0300 [thread overview]
Message-ID: <20210204071513.GC2696@kadam> (raw)
In-Reply-To: <7af3da33a7aa540f7878cfcbf5076dcf61d201ef.1612393368.git.andreas.a.roeseler@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 8372 bytes --]
Hi Andreas,
url: https://github.com/0day-ci/linux/commits/Andreas-Roeseler/add-support-for-RFC-8335-PROBE/20210204-072756
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 6626a0266566c5aea16178c5e6cd7fc4db3f2f56
config: i386-randconfig-m021-20210202 (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>
smatch warnings:
net/ipv4/icmp.c:1032 icmp_echo() error: uninitialized symbol 'dev'.
vim +/dev +1032 net/ipv4/icmp.c
e3e3217029a35c Rick Jones 2014-11-17 984 static bool icmp_echo(struct sk_buff *skb)
^1da177e4c3f41 Linus Torvalds 2005-04-16 985 {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 986 struct icmp_bxm icmp_param;
b34a95ee6e0557 Pavel Emelyanov 2008-03-26 987 struct net *net;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 988 struct net_device *dev;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 989 struct icmp_extobj_hdr *extobj_hdr;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 990 struct icmp_ext_ctype3_hdr *ctype3_hdr;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 991 __u8 status;
b34a95ee6e0557 Pavel Emelyanov 2008-03-26 992
adf30907d63893 Eric Dumazet 2009-06-02 993 net = dev_net(skb_dst(skb)->dev);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 994 /* should there be an ICMP stat for ignored echos? */
872bc41b1e24e1 Andreas Roeseler 2021-02-03 995 if (net->ipv4.sysctl_icmp_echo_ignore_all)
872bc41b1e24e1 Andreas Roeseler 2021-02-03 996 return true;
^1da177e4c3f41 Linus Torvalds 2005-04-16 997
88c7664f13bd1a Arnaldo Carvalho de Melo 2007-03-13 998 icmp_param.data.icmph = *icmp_hdr(skb);
^1da177e4c3f41 Linus Torvalds 2005-04-16 999 icmp_param.skb = skb;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1000 icmp_param.offset = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1001 icmp_param.data_len = skb->len;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1002 icmp_param.head_len = sizeof(struct icmphdr);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1003
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1004 if (icmp_param.data.icmph.type == ICMP_ECHO) {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1005 icmp_param.data.icmph.type = ICMP_ECHOREPLY;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1006 goto send_reply;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1007 }
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1008 if (!net->ipv4.sysctl_icmp_echo_enable_probe)
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1009 return true;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1010 /* We currently do not support probing off the proxy node */
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1011 if (!(ntohs(icmp_param.data.icmph.un.echo.sequence) & 1))
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1012 return true;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1013
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1014 icmp_param.data.icmph.type = ICMP_EXT_ECHOREPLY;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1015 icmp_param.data.icmph.un.echo.sequence &= htons(0xFF00);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1016 extobj_hdr = (struct icmp_extobj_hdr *)(skb->data + sizeof(struct icmp_ext_hdr));
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1017 ctype3_hdr = (struct icmp_ext_ctype3_hdr *)(extobj_hdr + 1);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1018 status = 0;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1019 switch (extobj_hdr->class_type) {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1020 case CTYPE_NAME:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1021 dev = dev_get_by_name(net, (char *)(extobj_hdr + 1));
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1022 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1023 case CTYPE_INDEX:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1024 dev = dev_get_by_index(net, ntohl(*((uint32_t *)(extobj_hdr + 1))));
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1025 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1026 case CTYPE_ADDR:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1027 switch (ntohs(ctype3_hdr->afi)) {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1028 case AFI_IP:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1029 dev = ip_dev_find(net, *(__be32 *)(ctype3_hdr + 1));
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1030 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1031 case AFI_IP6:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 @1032 dev = ipv6_dev_find(net, (struct in6_addr *)(ctype3_hdr + 1), dev);
^^^
Possibly uninitialized.
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1033 if(dev) dev_hold(dev);
^^^^^^^^^^^^^^^^^^^^^
You'll probably want to run checkpatch over this patch before sending it
upstream.
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1034 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1035 default:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1036 icmp_param.data.icmph.code = ICMP_EXT_MAL_QUERY;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1037 goto send_reply;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1038 }
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1039 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1040 default:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1041 icmp_param.data.icmph.code = ICMP_EXT_MAL_QUERY;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1042 goto send_reply;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1043 }
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1044 if(!dev) {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1045 icmp_param.data.icmph.code = ICMP_EXT_NO_IF;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1046 goto send_reply;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1047 }
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1048 /* RFC 8335: 3 the last 8 bits of the Extended Echo Reply Message
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1049 * are laid out as follows:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1050 * +-+-+-+-+-+-+-+-+
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1051 * |State|Res|A|4|6|
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1052 * +-+-+-+-+-+-+-+-+
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1053 */
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1054 if (dev->flags & IFF_UP)
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1055 status |= EXT_ECHOREPLY_ACTIVE;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1056 if (dev->ip_ptr->ifa_list)
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1057 status |= EXT_ECHOREPLY_IPV4;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1058 if (!list_empty(&dev->ip6_ptr->addr_list))
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1059 status |= EXT_ECHOREPLY_IPV6;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1060 dev_put(dev);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1061 icmp_param.data.icmph.un.echo.sequence |= htons(status);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1062
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1063 send_reply:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1064 icmp_reply(&icmp_param, skb);
e3e3217029a35c Rick Jones 2014-11-17 1065 return true;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1066 }
---
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: 38567 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH V2 net-next 5/5] icmp: add response to RFC 8335 PROBE messages
Date: Thu, 04 Feb 2021 10:15:13 +0300 [thread overview]
Message-ID: <20210204071513.GC2696@kadam> (raw)
In-Reply-To: <7af3da33a7aa540f7878cfcbf5076dcf61d201ef.1612393368.git.andreas.a.roeseler@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 8372 bytes --]
Hi Andreas,
url: https://github.com/0day-ci/linux/commits/Andreas-Roeseler/add-support-for-RFC-8335-PROBE/20210204-072756
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 6626a0266566c5aea16178c5e6cd7fc4db3f2f56
config: i386-randconfig-m021-20210202 (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>
smatch warnings:
net/ipv4/icmp.c:1032 icmp_echo() error: uninitialized symbol 'dev'.
vim +/dev +1032 net/ipv4/icmp.c
e3e3217029a35c Rick Jones 2014-11-17 984 static bool icmp_echo(struct sk_buff *skb)
^1da177e4c3f41 Linus Torvalds 2005-04-16 985 {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 986 struct icmp_bxm icmp_param;
b34a95ee6e0557 Pavel Emelyanov 2008-03-26 987 struct net *net;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 988 struct net_device *dev;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 989 struct icmp_extobj_hdr *extobj_hdr;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 990 struct icmp_ext_ctype3_hdr *ctype3_hdr;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 991 __u8 status;
b34a95ee6e0557 Pavel Emelyanov 2008-03-26 992
adf30907d63893 Eric Dumazet 2009-06-02 993 net = dev_net(skb_dst(skb)->dev);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 994 /* should there be an ICMP stat for ignored echos? */
872bc41b1e24e1 Andreas Roeseler 2021-02-03 995 if (net->ipv4.sysctl_icmp_echo_ignore_all)
872bc41b1e24e1 Andreas Roeseler 2021-02-03 996 return true;
^1da177e4c3f41 Linus Torvalds 2005-04-16 997
88c7664f13bd1a Arnaldo Carvalho de Melo 2007-03-13 998 icmp_param.data.icmph = *icmp_hdr(skb);
^1da177e4c3f41 Linus Torvalds 2005-04-16 999 icmp_param.skb = skb;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1000 icmp_param.offset = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1001 icmp_param.data_len = skb->len;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1002 icmp_param.head_len = sizeof(struct icmphdr);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1003
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1004 if (icmp_param.data.icmph.type == ICMP_ECHO) {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1005 icmp_param.data.icmph.type = ICMP_ECHOREPLY;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1006 goto send_reply;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1007 }
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1008 if (!net->ipv4.sysctl_icmp_echo_enable_probe)
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1009 return true;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1010 /* We currently do not support probing off the proxy node */
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1011 if (!(ntohs(icmp_param.data.icmph.un.echo.sequence) & 1))
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1012 return true;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1013
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1014 icmp_param.data.icmph.type = ICMP_EXT_ECHOREPLY;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1015 icmp_param.data.icmph.un.echo.sequence &= htons(0xFF00);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1016 extobj_hdr = (struct icmp_extobj_hdr *)(skb->data + sizeof(struct icmp_ext_hdr));
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1017 ctype3_hdr = (struct icmp_ext_ctype3_hdr *)(extobj_hdr + 1);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1018 status = 0;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1019 switch (extobj_hdr->class_type) {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1020 case CTYPE_NAME:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1021 dev = dev_get_by_name(net, (char *)(extobj_hdr + 1));
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1022 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1023 case CTYPE_INDEX:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1024 dev = dev_get_by_index(net, ntohl(*((uint32_t *)(extobj_hdr + 1))));
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1025 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1026 case CTYPE_ADDR:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1027 switch (ntohs(ctype3_hdr->afi)) {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1028 case AFI_IP:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1029 dev = ip_dev_find(net, *(__be32 *)(ctype3_hdr + 1));
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1030 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1031 case AFI_IP6:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 @1032 dev = ipv6_dev_find(net, (struct in6_addr *)(ctype3_hdr + 1), dev);
^^^
Possibly uninitialized.
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1033 if(dev) dev_hold(dev);
^^^^^^^^^^^^^^^^^^^^^
You'll probably want to run checkpatch over this patch before sending it
upstream.
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1034 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1035 default:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1036 icmp_param.data.icmph.code = ICMP_EXT_MAL_QUERY;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1037 goto send_reply;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1038 }
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1039 break;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1040 default:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1041 icmp_param.data.icmph.code = ICMP_EXT_MAL_QUERY;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1042 goto send_reply;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1043 }
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1044 if(!dev) {
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1045 icmp_param.data.icmph.code = ICMP_EXT_NO_IF;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1046 goto send_reply;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1047 }
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1048 /* RFC 8335: 3 the last 8 bits of the Extended Echo Reply Message
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1049 * are laid out as follows:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1050 * +-+-+-+-+-+-+-+-+
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1051 * |State|Res|A|4|6|
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1052 * +-+-+-+-+-+-+-+-+
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1053 */
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1054 if (dev->flags & IFF_UP)
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1055 status |= EXT_ECHOREPLY_ACTIVE;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1056 if (dev->ip_ptr->ifa_list)
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1057 status |= EXT_ECHOREPLY_IPV4;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1058 if (!list_empty(&dev->ip6_ptr->addr_list))
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1059 status |= EXT_ECHOREPLY_IPV6;
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1060 dev_put(dev);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1061 icmp_param.data.icmph.un.echo.sequence |= htons(status);
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1062
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1063 send_reply:
872bc41b1e24e1 Andreas Roeseler 2021-02-03 1064 icmp_reply(&icmp_param, skb);
e3e3217029a35c Rick Jones 2014-11-17 1065 return true;
^1da177e4c3f41 Linus Torvalds 2005-04-16 1066 }
---
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: 38567 bytes --]
next prev parent reply other threads:[~2021-02-04 7:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 23:24 [PATCH V2 net-next 0/5] add support for RFC 8335 PROBE Andreas Roeseler
2021-02-03 23:24 ` [PATCH V2 net-next 1/5] icmp: " Andreas Roeseler
2021-02-04 19:42 ` Willem de Bruijn
2021-02-03 23:24 ` [PATCH V2 net-next 2/5] ICMPV6: " Andreas Roeseler
2021-02-03 23:24 ` [PATCH V2 net-next 3/5] net: add sysctl for enabling RFC 8335 PROBE messages Andreas Roeseler
2021-02-04 19:52 ` Willem de Bruijn
2021-02-03 23:24 ` [PATCH V2 net-next 4/5] net: add support for sending " Andreas Roeseler
2021-02-03 23:24 ` [PATCH V2 net-next 5/5] icmp: add response to " Andreas Roeseler
2021-02-04 1:18 ` kernel test robot
2021-02-04 1:19 ` kernel test robot
2021-02-04 7:15 ` Dan Carpenter [this message]
2021-02-04 7:15 ` Dan Carpenter
2021-02-04 19:52 ` Willem de Bruijn
2021-02-05 5:01 ` Andreas Roeseler
2021-02-04 20:16 ` Jakub Kicinski
-- strict thread matches above, loose matches on Subject: below --
2021-02-04 2:10 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210204071513.GC2696@kadam \
--to=dan.carpenter@oracle.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.