glibc/sunrpc
Brad Hubbard ed6b0fe710 Use calloc to allocate xports (BZ #17542)
If xports is NULL in xprt_register we malloc it but if sock >
_rpc_dtablesize() that memory does not get initialised and may in theory
contain any value. Later we make a conditional jump in svc_getreq_common
based on the uninitialised memory and this caused a general protection
fault in rpc.statd on an older version of glibc but this code has not
changed since that version.

Following is the valgrind warning.

==26802== Conditional jump or move depends on uninitialised value(s)
==26802==    at 0x5343A25: svc_getreq_common (in /lib64/libc-2.5.so)
==26802==    by 0x534357B: svc_getreqset (in /lib64/libc-2.5.so)
==26802==    by 0x10DE1F: ??? (in /sbin/rpc.statd)
==26802==    by 0x10D0EF: main (in /sbin/rpc.statd)
==26802==  Uninitialised value was created by a heap allocation
==26802==    at 0x4C2210C: malloc (vg_replace_malloc.c:195)
==26802==    by 0x53438BE: xprt_register (in /lib64/libc-2.5.so)
==26802==    by 0x53450DF: svcudp_bufcreate (in /lib64/libc-2.5.so)
==26802==    by 0x10FE32: ??? (in /sbin/rpc.statd)
==26802==    by 0x10D13E: main (in /sbin/rpc.statd)
2015-03-18 14:51:26 +05:30
..
rpc Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
rpcsvc Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
auth_des.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
auth_none.c
auth_unix.c
authdes_prot.c
authuxprot.c
bindrsvprt.c bindresvport() uses two static variables port and startport which are not 2012-11-19 02:05:12 -05:00
clnt_gen.c
clnt_perr.c
clnt_raw.c
clnt_simp.c
clnt_tcp.c Fix typos. 2013-08-29 09:11:45 +02:00
clnt_udp.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
clnt_unix.c Fix typos. 2013-08-29 09:11:45 +02:00
create_xid.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
des_crypt.c
des_impl.c
des_soft.c
etc.rpc * sunrpc/etc.rpc (fedfs_admin): Add entry. 2012-12-05 19:45:23 -07:00
get_myaddr.c
getrpcbyname_r.c Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. 2015-02-06 10:43:19 -08:00
getrpcbyname.c Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. 2015-02-06 10:43:19 -08:00
getrpcbynumber_r.c Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. 2015-02-06 10:43:19 -08:00
getrpcbynumber.c Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. 2015-02-06 10:43:19 -08:00
getrpcent_r.c Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. 2015-02-06 10:43:19 -08:00
getrpcent.c Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. 2015-02-06 10:43:19 -08:00
getrpcport.c
key_call.c
key_prot.c
Makefile Split rpcent tests out of tst-netdb. 2015-03-04 15:55:38 -08:00
netname.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
openchild.c
pm_getmaps.c
pm_getport.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
pmap_clnt.c
pmap_prot2.c
pmap_prot.c
pmap_rmt.c
proto.h Support --with-pkgversion and --with-bugurl. 2012-11-09 22:13:45 +00:00
publickey.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
rpc_clntout.c sunrpc: fix rpc bootstrap builds 2012-07-06 00:37:42 -04:00
rpc_cmsg.c
rpc_common.c
rpc_cout.c
rpc_dtable.c
rpc_hout.c Fix some -Wformat warnings in rpcgen. 2012-07-26 14:35:05 -07:00
rpc_main.c Document rpcgen -5. Fixes bug 15825 2013-10-21 10:02:31 +02:00
rpc_parse.c
rpc_parse.h
rpc_prot.c
rpc_sample.c
rpc_scan.c
rpc_scan.h
rpc_svcout.c Fix some -Wformat warnings in rpcgen. 2012-07-26 14:35:05 -07:00
rpc_tblout.c
rpc_thread.c Fix typos. 2013-08-30 18:08:59 +02:00
rpc_util.c
rpc_util.h
rpcgen.c
rpcinfo.c Support --with-pkgversion and --with-bugurl. 2012-11-09 22:13:45 +00:00
rtime.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
svc_auth.c
svc_authux.c
svc_raw.c
svc_run.c
svc_simple.c
svc_tcp.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
svc_udp.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
svc_unix.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
svc.c Use calloc to allocate xports (BZ #17542) 2015-03-18 14:51:26 +05:30
svcauth_des.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
test-rpcent.c Split rpcent tests out of tst-netdb. 2015-03-04 15:55:38 -08:00
thrsvc.c
tst-getmyaddr.c
tst-xdrmem2.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
tst-xdrmem.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Versions Exclude rpcent functions and NSS backends for rpc, key when excluding sunrpc. 2015-02-06 10:43:19 -08:00
xcrypt.c
xdr_array.c
xdr_float.c
xdr_intXX_t.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
xdr_mem.c
xdr_rec.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
xdr_ref.c
xdr_sizeof.c
xdr_stdio.c
xdr.c Add comment about SIZE initialization in xdr.c 2014-07-10 10:33:48 +05:30