Project

General

Profile

Bug #12173

ip: variable may be used uninitialized in this function

Added by Toomas Soome 3 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build issues with gcc 9. This is second larger collection of the same issue:

    ../../common/inet/ilb/ilb_conn.c: In function 'ilb_conn_remove_common':
    ../../common/inet/ilb/ilb_conn.c:161:15: error: 'prev_next' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      161 |    *prev_next = *next;
          |    ~~~~~~~~~~~^~~~~~~
    ../../common/inet/ilb/ilb_conn.c:158:15: error: 'next_prev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      158 |    *next_prev = NULL;
    ../../common/inet/ilb/ilb_conn.c: In function 'update_conn_tcp':
    ../../common/inet/ilb/ilb_conn.c:730:27: error: 'ack' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      730 |   connp->conn_s2c_tcp_ack = ack;
          |   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
    ../../common/inet/ilb/ilb_conn.c: In function 'ilb_check_icmp_conn':
    ../../common/inet/ilb/ilb_conn.c:1002:3: error: 'icmph6' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1002 |   ilb_nat_icmpv6(mp, out_iph, icmph6, in_iph6, sport, dport,
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1003 |       &rule_cache.info, full_nat);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ilb/ilb_conn.c:999:3: error: 'icmph4' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      999 |   ilb_nat_icmpv4(mp, out_iph, icmph4, in_iph4, sport, dport,
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1000 |       &rule_cache.info, adj_ip_sum, full_nat);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ilb/ilb_conn.c:1002:3: error: 'in_iph6' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1002 |   ilb_nat_icmpv6(mp, out_iph, icmph6, in_iph6, sport, dport,
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1003 |       &rule_cache.info, full_nat);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ilb/ilb_conn.c:999:3: error: 'in_iph4' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      999 |   ilb_nat_icmpv4(mp, out_iph, icmph4, in_iph4, sport, dport,
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1000 |       &rule_cache.info, adj_ip_sum, full_nat);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/inet/udp/udp_stats.c: In function 'udp_snmp_get':
    ../../common/inet/udp/udp_stats.c:109:3: error: 'mp6_attr_ctl' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      109 |   freemsg(mp6_attr_ctl);
          |   ^~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/udp/udp_stats.c:107:3: error: 'mp_info_ctl' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      107 |   freemsg(mp_info_ctl);
          |   ^~~~~~~~~~~~~~~~~~~~

    ../../common/inet/sctp/sctp_cookie.c: In function 'sctp_send_cookie_echo':
    ../../common/inet/sctp/sctp_impl.h:264:19: error: 'sdc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      264 |    (sdc)->sdh_ssn = mhdr->smh_ssn;   \
          |                   ^
    ../../common/inet/sctp/sctp_cookie.c:939:20: note: 'sdc' was declared here
      939 |  sctp_data_hdr_t  *sdc;
          |                    ^~~
    ../../common/inet/sctp/sctp_cookie.c:1197:10: error: 'seglen' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1197 |   seglen -= sizeof (*sdc);
          |          ^~

    ../../common/inet/sctp/sctp_opt_data.c: In function 'sctp_set_opt':
    ../../common/inet/sctp/sctp_opt_data.c:1255:28: error: 'onoff' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1255 |    sctp->sctp_prsctp_aware = onoff;
          |    ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

    ../../common/inet/sctp/sctp_asconf.c: In function 'sctp_input_asconf_ack':
    ../../common/inet/sctp/sctp_asconf.c:812:24: error: 'ainfo' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      812 |   ainfo->sctp_cl_dlist = NULL;
    ../../common/inet/sctp/sctp_asconf.c:724:13: error: 'dptr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      724 |        dptr += sizeof (addr);
          |        ~~~~~^~~~~~~~~~~~~~~~
    ../../common/inet/sctp/sctp_asconf.c:719:13: error: 'aptr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      719 |        aptr += sizeof (addr);
          |        ~~~~~^~~~~~~~~~~~~~~~
    ../../common/inet/sctp/sctp_asconf.c:813:4: error: 'dlist' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      813 |   (*cl_sctp_assoc_change)(sctp->sctp_connp->conn_family, alist,
          |   ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      814 |       ainfo->sctp_cl_asize, acount, dlist, ainfo->sctp_cl_dsize,
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      815 |       dcount, SCTP_CL_LADDR, (cl_sctp_handle_t)sctp);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/sctp/sctp_asconf.c:813:4: error: 'alist' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ../../common/inet/sctp/sctp_asconf.c: In function 'sctp_add_ip':
    ../../common/inet/sctp/sctp_asconf.c:1511:19: error: 'sin6' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1511 |    ad6->sad6_addr = sin6->sin6_addr;
          |    ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

    ../../common/inet/ilb/ilb.c: In function 'ilb_check':
    ../../common/inet/ilb/ilb.c:1871:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1871 |  return (ret);
          |         ^

    ../../common/inet/sctp/sctp_common.c: In function 'sctp_unlink_faddr':
    ../../common/inet/sctp/sctp_common.c:839:16: error: 'fpp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      839 |   fpp->sf_next = fp->sf_next;
          |   ~~~~~~~~~~~~~^~~~~~~~~~~~~

    ../../common/inet/ip/tnet.c: In function 'tsol_ip_forward':
    ../../common/inet/ip/tnet.c:1627:22: error: 'gw_rhtp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1627 |       gw_rhtp->tpc_tp.host_type != UNLABELED))
          |       ~~~~~~~~~~~~~~~^~~~~~~~~~
    ../../common/inet/ip/tnet.c:1638:7: error: 'ip6h' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1638 |       tsol_remove_secopt_v6(ip6h, MBLKL(mp));
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/tnet.c:1637:30: error: 'ipha' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1637 |   adjust = (af == AF_INET) ? tsol_remove_secopt(ipha, MBLKL(mp)) :
          |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In file included from ../../common/inet/ip.h:39,
                     from ../../common/inet/sctp/sctp_output.c:39:
    ../../common/inet/sctp/sctp_output.c: In function 'sctp_output':
    ../../common/inet/mib2.h:141:27: error: 'lfp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      141 | #define BUMP_LOCAL(x)  (x)++
          |                           ^~
    ../../common/inet/sctp/sctp_output.c:1003:17: note: 'lfp' was declared here
     1003 |  sctp_faddr_t  *lfp;
          |                 ^~~

    ../../common/inet/sctp/sctp_input.c: In function 'sctp_data_frag':
    ../../common/inet/sctp/sctp_input.c:1213:45: error: 'reassq_curr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1213 |    reassq_curr->b_next->b_prev = reassq_curr->b_prev;
          |                                  ~~~~~~~~~~~^~~~~~~~

    ../../common/inet/udp/udp.c: In function 'udp_do_bind':
    ../../common/inet/udp/udp.c:5228:19: error: 'sin6' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5228 |   sin6->sin6_port = connp->conn_lport;
    ../../common/inet/udp/udp.c:5226:17: error: 'sin' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5226 |   sin->sin_port = connp->conn_lport;
    ../../common/inet/udp/udp.c: In function 'udp_do_connect':
    ../../common/inet/udp/udp.c:5690:24: error: 'flowinfo' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5690 |   connp->conn_flowinfo = flowinfo;
          |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    ../../common/inet/udp/udp.c:5667:6: error: 'v4dst' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5667 |   if (v4dst == INADDR_ANY) {
          |      ^
    ../../common/inet/udp/udp.c:5671:26: error: 'sin' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5671 |     sin->sin_addr.s_addr = v4dst;
          |     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    ../../common/inet/udp/udp.c:5673:21: error: 'sin6' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     5673 |     sin6->sin6_addr = v6dst;
          |     ~~~~~~~~~~~~~~~~^~~~~~~

    ../../common/inet/tcp/tcp_input.c: In function 'tcp_input_data':
    ../../common/inet/tcp/tcp_input.c:4979:25: error: 'mss' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4979 |    tcp->tcp_cwnd -= mss << (tcp->tcp_dupack_cnt - 1);
          |                     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/inet/tcp/tcp_output.c: In function 'tcp_send':
    ../../common/inet/tcp/tcp_output.c:1893:8: error: 'lso_usable' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1893 |    len = lso_usable;
          |    ~~~~^~~~~~~~~~~~

    ../../common/inet/ip/ip_ftable.c: In function 'ire_round_robin':
    ../../common/inet/ip/ip_ftable.c:938:13: error: 'maybe_badcnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      938 |   } else if (ire->ire_badcnt < maybe_badcnt) {
          |             ^

    In file included from ../../common/sys/byteorder.h:48,
                     from ../../common/netinet/in.h:71,
                     from ../../common/sys/zone.h:35,
                     from ../../common/sys/exacct_impl.h:35,
                     from ../../common/sys/task.h:46,
                     from ../../common/sys/ddi_implfuncs.h:40,
                     from ../../common/sys/sunddi.h:45,
                     from ../../common/inet/ip/igmp.c:44:
    ../../common/inet/ip/igmp.c: In function 'igmp_joingroup':
    ../../intel/asm/byteorder.h:80:2: error: 'timer' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       80 |  __asm__("bswap %0" : "+r" (value));
          |  ^~~~~~~
    ../../common/inet/ip/igmp.c:771:9: note: 'timer' was declared here
      771 |  uint_t timer;
          |         ^~~~~
    In file included from ../../common/sys/byteorder.h:48,
                     from ../../common/netinet/in.h:71,
                     from ../../common/sys/zone.h:35,
                     from ../../common/sys/exacct_impl.h:35,
                     from ../../common/sys/task.h:46,
                     from ../../common/sys/ddi_implfuncs.h:40,
                     from ../../common/sys/sunddi.h:45,
                     from ../../common/inet/ip/igmp.c:44:
    ../../common/inet/ip/igmp.c: In function 'mld_joingroup':
    ../../intel/asm/byteorder.h:80:2: error: 'timer' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       80 |  __asm__("bswap %0" : "+r" (value));
          |  ^~~~~~~
    ../../common/inet/ip/igmp.c:853:9: note: 'timer' was declared here
      853 |  uint_t timer;
          |         ^~~~~

    ../../common/inet/tcp/tcp_bind.c: In function 'tcp_bind_select_lport':
    ../../common/inet/tcp/tcp_bind.c:490:11: error: 'zone' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      490 |    (void) tsol_mlp_anon(zone, mlptype, connp->conn_proto,
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      491 |        requested_port, B_FALSE);
          |        ~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/inet/tcp/tcp_tpi.c: In function 'tcp_conprim_opt_process':
    ../../common/inet/tcp/tcp_tpi.c:166:10: error: 'opt_lenp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      166 |  error = tpi_optcom_buf(tcp->tcp_connp->conn_wq, mp, opt_lenp,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      167 |      opt_offset, cr, &tcp_opt_obj,
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      168 |      NULL, &is_absreq_failure);
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/inet/tcp/tcp_tpi.c: In function 'tcp_conprim_opt_process':
    ../../common/inet/tcp/tcp_tpi.c:163:10: error: 'opt_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      163 |  error = tpi_optcom_buf(tcp->tcp_connp->conn_wq, mp, opt_lenp,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      164 |      opt_offset, cr, &tcp_opt_obj,
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      165 |      NULL, &is_absreq_failure);
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/inet/tcp/tcp_misc.c: In function 'tcp_ioctl_abort_bucket':
    ../../common/inet/tcp/tcp_misc.c:318:18: error: 'last' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      318 |     last->b_next = mp;
          |     ~~~~~~~~~~~~~^~~~

    ../../common/inet/ip/ip6_output.c: In function 'ire_send_wire_v6':
    ../../common/inet/ip/ip6_output.c:1101:8: error: 'ident' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1101 |   mp = ip_fraghdr_add_v6(mp, ident, ixa);
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/inet/ip/icmp.c: In function 'rawip_do_connect':
    ../../common/inet/ip/icmp.c:850:24: error: 'flowinfo' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      850 |   connp->conn_flowinfo = flowinfo;
          |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    ../../common/inet/ip/icmp.c:830:6: error: 'v4dst' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      830 |   if (v4dst == INADDR_ANY) {
          |      ^
    ../../common/inet/ip/icmp.c:823:20: error: 'dstport' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      823 |  connp->conn_fport = dstport;
          |  ~~~~~~~~~~~~~~~~~~^~~~~~~~~
    ../../common/inet/ip/icmp.c:847:20: error: 'sin6' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      847 |    sin6->sin6_addr = v6dst;
          |    ~~~~~~~~~~~~~~~~^~~~~~~
    ../../common/inet/ip/icmp.c:834:25: error: 'sin' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      834 |    sin->sin_addr.s_addr = v4dst;
          |    ~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    ../../common/inet/ip/icmp.c: In function 'icmp_output_ancillary':
    ../../common/inet/ip/icmp.c:3514:10: error: 'dstport' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3514 |  error = ip_attr_connect(connp, ixa, &v6src, &v6dst, &v6nexthop, dstport,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     3515 |      &v6src, NULL, IPDF_ALLOW_MCBC | IPDF_VERIFY_DST);
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/inet/tcp/tcp_fusion.c: In function 'tcp_fuse':
    ../../common/inet/tcp/tcp_fusion.c:231:15: error: 'mp' may be used uninitialized
     in this function [-Werror=maybe-uninitialized]
      231 |    mp->b_wptr += sizeof (*stropt);
          |    ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

    ../../common/inet/ip/ip6_ire.c: In function 'ire_match_args_v6':
    ../../common/inet/ip/ip6_ire.c:855:40: error: 'gw_addr_v6._S6_un._S6_u32[3]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      855 |      !(ire->ire_flags & RTF_INDIRECT)) &&
    In file included from ../../common/sys/socket.h:63,
                     from ../../common/inet/ip/ip6_ire.c:37:
    ../../common/netinet/in.h:839:62: error: 'gw_addr_v6._S6_un._S6_u32[2]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      839 |  (((addr1)->_S6_un._S6_u32[3] == (addr2)->_S6_un._S6_u32[3]) && \
          |                                                              ^~
    ../../common/inet/ip/ip6_ire.c:690:13: note: 'gw_addr_v6._S6_un._S6_u32[2]' was declared here
      690 |  in6_addr_t gw_addr_v6;
          |             ^~~~~~~~~~
    In file included from ../../common/sys/socket.h:63,
                     from ../../common/inet/ip/ip6_ire.c:37:
    ../../common/netinet/in.h:840:61: error: 'gw_addr_v6._S6_un._S6_u32[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      840 |  ((addr1)->_S6_un._S6_u32[2] == (addr2)->_S6_un._S6_u32[2]) && \
          |                                                             ^~
    ../../common/inet/ip/ip6_ire.c:690:13: note: 'gw_addr_v6._S6_un._S6_u32[1]' was declared here
      690 |  in6_addr_t gw_addr_v6;
          |             ^~~~~~~~~~
    In file included from ../../common/sys/socket.h:63,
                     from ../../common/inet/ip/ip6_ire.c:37:
    ../../common/netinet/in.h:841:61: error: 'gw_addr_v6._S6_un._S6_u32[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      841 |  ((addr1)->_S6_un._S6_u32[1] == (addr2)->_S6_un._S6_u32[1]) && \
          |                                                             ^~
    ../../common/inet/ip/ip6_ire.c:690:13: note: 'gw_addr_v6._S6_un._S6_u32[0]' was declared here
      690 |  in6_addr_t gw_addr_v6;
          |             ^~~~~~~~~~

    ../../common/inet/ip/ip_output.c: In function 'ire_send_local_v4':
    ../../common/inet/ip/ip_output.c:1111:11: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1111 |    return (error);
          |           ^

    ../../common/inet/ip/conn_opt.c: In function 'conn_opt_set_ip':
    ../../common/inet/ip/conn_opt.c:1454:24: error: 'ifindex' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1454 |   connp->conn_bound_if = ifindex;  /* getsockopt */
          |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
    ../../common/inet/ip/conn_opt.c: In function 'conn_opt_set_ipv6':
    ../../common/inet/ip/conn_opt.c:1744:24: error: 'ifindex' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1744 |   connp->conn_bound_if = ifindex;  /* getsockopt */
          |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

    ../../common/inet/ip/ip_rts.c: In function 'ip_rts_rtmsg':
    ../../common/inet/ip/ip_rts.c:193:14: error: 'af' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      193 |  sa_family_t af;
          |              ^~
    ../../common/inet/ip/ip_rts.c:231:13: error: 'mp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      231 |  mp->b_wptr = (uchar_t *)&mp->b_rptr[rtm->rtm_msglen];
          |  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ip_rts.c: In function 'ip_rts_request_common':
    ../../common/inet/ip/ip_rts.c:704:11: error: 'net_mask' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      704 |     ire = ire_lookup_v4(dst_addr, net_mask,
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      705 |         gw_addr, ill, zoneid, tsl, match_flags,
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      706 |         ipst, &ifire, &v4setsrc, &gwattr);
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ip_rts.c:817:14: error: 'src_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      817 |       type = ip_type_v4(src_addr,
          |              ^~~~~~~~~~~~~~~~~~~~
      818 |           ipst);
          |           ~~~~~
    ../../common/inet/ip/ip_rts.c:778:28: error: 'gw_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      778 |      ire->ire_gateway_addr = gw_addr;
          |      ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
    ../../common/inet/ip/ip_rts.c:704:11: error: 'dst_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      704 |     ire = ire_lookup_v4(dst_addr, net_mask,
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      705 |         gw_addr, ill, zoneid, tsl, match_flags,
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      706 |         ipst, &ifire, &v4setsrc, &gwattr);
          |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ip_rts.c: In function 'rts_rtmget':
    ../../common/inet/ip/ip_rts.c:1362:21: error: 'rtm_flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1362 |  new_rtm->rtm_flags = rtm_flags;
          |  ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
    ../../common/inet/ip/ip_rts.c:1321:3: error: 'ifaddr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1321 |   rts_fill_msg(RTM_GET, rtm_addrs, ire->ire_addr,
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1322 |       ire->ire_mask, ire->ire_gateway_addr, v4setsrc,
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1323 |       brdaddr, 0, ifaddr, ill, new_mp, gc);
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ip_rts.c:1321:3: error: 'brdaddr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ../../common/inet/ip/ip_rts.c: In function 'rts_setmetrics':
    ../../common/inet/ip/ip_rts.c:1471:27: error: 'gw_addr_v6._S6_un._S6_u32[3]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1471 |        &ire->ire_addr_v6) ||
    In file included from ../../common/sys/zone.h:35,
                     from ../../common/inet/ip/ip_rts.c:52:
    ../../common/netinet/in.h:839:62: error: 'gw_addr_v6._S6_un._S6_u32[2]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      839 |  (((addr1)->_S6_un._S6_u32[3] == (addr2)->_S6_un._S6_u32[3]) && \
          |                                                              ^~
    ../../common/inet/ip/ip_rts.c:1409:13: note: 'gw_addr_v6._S6_un._S6_u32[2]' was declared here
     1409 |  in6_addr_t gw_addr_v6;
          |             ^~~~~~~~~~
    In file included from ../../common/sys/zone.h:35,
                     from ../../common/inet/ip/ip_rts.c:52:
    ../../common/netinet/in.h:840:61: error: 'gw_addr_v6._S6_un._S6_u32[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      840 |  ((addr1)->_S6_un._S6_u32[2] == (addr2)->_S6_un._S6_u32[2]) && \
          |                                                             ^~
    ../../common/inet/ip/ip_rts.c:1409:13: note: 'gw_addr_v6._S6_un._S6_u32[1]' was declared here
     1409 |  in6_addr_t gw_addr_v6;
          |             ^~~~~~~~~~
    ../../common/inet/ip/ip_rts.c:1472:8: error: 'gw_addr_v6._S6_un._S6_u32[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1472 |        !IN6_ARE_ADDR_EQUAL(&ifrt->ifrt_v6gateway_addr,
    ../../common/inet/ip/ip_rts.c:1490:32: error: 'rtt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1490 |    ifrt->ifrt_metrics.iulp_rtt = rtt;
          |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

    ../../common/inet/ip/spd.c: In function 'ipsec_act_find':
    ../../common/inet/ip/spd.c:3243:14: error: 'ap' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3243 |  ap->ipa_refs++;  /* caller's reference */
          |  ~~~~~~~~~~~~^~
    ../../common/inet/ip/spd.c: In function 'ipsec_fragcache_add':
    ../../common/inet/ip/spd.c:6462:27: error: 'fraghdr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     6462 |    fep->itpfe_id = fraghdr->ip6f_ident;
          |                    ~~~~~~~^~~~~~~~~~~~
    ../../common/inet/ip/spd.c:6463:21: error: 'v6_proto' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     6463 |    fep->itpfe_proto = v6_proto;
          |    ~~~~~~~~~~~~~~~~~^~~~~~~~~~

    ../../common/inet/ip/ip_output.c: In function 'ire_send_local_v4':
    ../../common/inet/ip/ip_output.c:1169:11: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1169 |    return (error);
          |           ^

    ../../common/inet/ip/ipmp.c: In function 'ipmp_phyint_join_grp':
    ../../common/inet/ip/ipmp.c:1936:24: error: 'ill' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1936 |   grp->gr_mactype = ill->ill_mactype;
          |                     ~~~^~~~~~~~~~~~~

    ../../common/inet/ip/ip6.c: In function 'ip_process_options_v6':
    ../../common/inet/ip/ip6.c:2861:9: error: 'optused' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2861 |  uint_t optused;
          |         ^~~~~~~

    ../../common/inet/ip/ip_ndp.c: In function 'nce_update':
    ../../common/inet/ip/ip_ndp.c:2962:6: error: 'tid' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2962 |   if (tid != 0)
          |      ^
    ../../common/inet/ip/ip_ndp.c: In function 'nce_resolve_src':
    ../../common/inet/ip/ip_ndp.c:4477:11: error: 'src4' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4477 |    ipif = ipif_lookup_addr_nondup(src4, ill, ALL_ZONES,
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     4478 |        ill->ill_ipst);
          |        ~~~~~~~~~~~~~~
    ../../common/inet/ip/ip_ndp.c: In function 'nce_add_common':
    ../../common/inet/ip/ip_ndp.c:4865:6: error: 'state' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4865 |   if (state == ND_INITIAL)
          |      ^

    ../../common/inet/ip/ipclassifier.c: In function 'ipcl_conn_create':
    ../../common/inet/ip/ipclassifier.c:619:15: error: 'conn_cache' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      619 |  if ((connp = kmem_cache_alloc(conn_cache, sleep)) == NULL)
          |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../common/inet/ip/ip.c: In function 'ipoptp_next':
    ../../common/inet/ip/ip.c:2432:6: error: 'pointer' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2432 |   if (pointer < IPOPT_MINOFF_SR)
          |      ^
    ../../common/inet/ip/ip.c: In function 'ip_opt_set_multicast_group':
    ../../common/inet/ip/ip.c:6405:11: error: 'optfn' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     6405 |   error = optfn(connp, checkonly, &v6group, ifaddr, ifindex,
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     6406 |       fmode, &ipv6_all_zeros);
          |       ~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ip.c:6405:11: error: 'fmode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ../../common/inet/ip/ip.c: In function 'ip_opt_set_multicast_sources':
    ../../common/inet/ip/ip.c:6534:11: error: 'optfn' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     6534 |   error = optfn(connp, checkonly, &v6group, ifaddr, ifindex,
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     6535 |       fmode, &v6src);
          |       ~~~~~~~~~~~~~~
    ../../common/inet/ip/ip.c:6534:11: error: 'fmode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ../../common/inet/ip/ip.c: In function 'ip_forward_options':
    ../../common/inet/ip/ip.c:9108:30: error: 'off' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     9108 |    if (opt[IPOPT_OFFSET] - 1 + off > optlen) {
          |        ~~~~~~~~~~~~~~~~~~~~~~^~~~~
    ../../common/inet/ip/ip.c: In function 'ip_input_local_options':
    ../../common/inet/ip/ip.c:9334:30: error: 'off' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     9334 |    if (opt[IPOPT_OFFSET] - 1 + off > optlen) {
          |        ~~~~~~~~~~~~~~~~~~~~~~^~~~~
    ../../common/inet/ip/ip.c: In function 'ip_input_options':
    ../../common/inet/ip/ip.c:9549:17: error: 'opt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     9549 |  code = (char *)&opt[IPOPT_OFFSET] - (char *)ipha;
          |                 ^~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ip.c: In function 'ip_output_local_options':
    ../../common/inet/ip/ip.c:12028:30: error: 'off' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    12028 |    if (opt[IPOPT_OFFSET] - 1 + off > optlen) {
          |        ~~~~~~~~~~~~~~~~~~~~~~^~~~~
    ../../common/inet/ip/ip.c: In function 'ip_process_ioctl':
    ../../common/inet/ip/ip.c:12637:10: error: 'extract_funcp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    12637 |   err = (*extract_funcp)(q, mp, ipip, &ci);
          |         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/inet/ip/ip.c: In function 'ip_wput_nondata':
    ../../common/inet/ip/ip.c:12956:18: error: 'iocp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    12956 |  iocp->ioc_count = 0;
          |  ~~~~~~~~~~~~~~~~^~~
    ../../common/inet/ip/ip.c: In function 'ip_output_options':
    ../../common/inet/ip/ip.c:13087:17: error: 'opt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    13087 |  code = (char *)&opt[IPOPT_OFFSET] - (char *)ipha;
          |                 ^~~~~~~~~~~~~~~~~~

    ../../common/inet/ip/ip_if.c: In function 'ill_capability_id_ack':
    ../../common/inet/ip/ip_if.c:1483:3: error: 'inners' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1483 |   cmn_err(CE_WARN, "ill_capability_id_ack: malformed " 
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1484 |       "encapsulated capab type %d too long for mblk",
          |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1485 |       inners->dl_cap);
          |       ~~~~~~~~~~~~~~~
    ../../common/inet/ip/ip_if.c: In function 'ill_get_next_ifindex':
    ../../common/inet/ip/ip_if.c:3963:7: error: 'phyi_initial' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3963 |   if (!((index != 0) && (phyi == phyi_initial))) {
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

Testing done: build/install/boot.

History

#1

Updated by Electric Monk about 1 month ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit ab82c29b6e890d0f1241f9cd0cefda3430f46bd5

commit  ab82c29b6e890d0f1241f9cd0cefda3430f46bd5
Author: Toomas Soome <tsoome@me.com>
Date:   2020-03-06T20:24:46.000Z

    12173 ip: variable may be used uninitialized in this function
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Also available in: Atom PDF