glibc/include
Stefan Liebler 4b2e40a925 Handle out-of-memory case in svc_tcp.c/svc_unix.c:rendezvous_request.
If glibc is build with -O3 on at least 390 (-m31) or x86 (-m32),
gcc 11 dumps this warning:
svc_tcp.c: In function 'rendezvous_request':
svc_tcp.c:274:3: error: 'memcpy' offset [0, 15] is out of the bounds [0, 0] [-Werror=array-bounds]
  274 |   memcpy (&xprt->xp_raddr, &addr, sizeof (addr));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

In out-of-memory case, if one of the mallocs in makefd_xprt function
returns NULL, a message is dumped, makefd_xprt returns NULL
and the subsequent memcpy would copy to NULL.

Instead of a segfaulting, we delay a bit (see also __svc_accept_failed
and Bug 14889 (CVE-2011-4609) - svc_run() produces high cpu usage when
accept() fails with EMFILE (CVE-2011-4609).

The same applies to svc_unix.c.
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2020-12-10 11:11:20 +01:00
..
arpa CVE-2016-10739: getaddrinfo: Fully parse IPv4 address strings [BZ #20018] 2019-01-21 21:26:03 +01:00
bits time: Add 64-bit time_t support for ftime 2020-10-27 09:54:50 -03:00
gnu Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
net
netinet nss_files: Consolidate line parse declarations in <nss_files.h> 2020-07-21 07:33:20 +02:00
programs Use 2020 as copyright year. 2020-04-27 10:34:52 -04:00
protocols
rpc Handle out-of-memory case in svc_tcp.c/svc_unix.c:rendezvous_request. 2020-12-10 11:11:20 +01:00
rpcsvc Remove --enable-obsolete-nsl configure flag 2020-07-08 17:25:57 +02:00
sys hurd: Move {,f,l}xstat{,at} and xmknod{at} to compat symbols 2020-11-11 23:56:56 +00:00
aio.h y2038: Convert aio_suspend to support 64 bit time 2020-11-30 14:08:44 +01:00
aliases.h Remove --enable-obsolete-nsl configure flag 2020-07-08 17:25:57 +02:00
alloc_buffer.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
alloca.h
allocate_once.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ar.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
argp-fmtstream.h
argp.h ldbl-opt: Add argp_error and argp_failure (bug 23983) 2019-03-01 15:21:32 -03:00
argz.h
array_length.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
assert.h
atomic.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
byteswap.h
complex.h
cpio.h
crypt.h
ctype.h
des.h
dirent.h hurd: keep only required PLTs in ld.so 2020-11-11 02:36:22 +01:00
dlfcn.h Remove --enable-obsolete-nsl configure flag 2020-07-08 17:25:57 +02:00
dso_handle.h
elf.h elf: Refuse to dlopen PIE objects [BZ #24323] 2019-06-18 16:42:10 +02:00
endian.h
envz.h
err.h ldbl-128ibm-compat: PLT redirects for using ldbl redirects internally 2020-03-25 14:34:23 -05:00
errno.h Remove tls.h inclusion from internal errno.h 2020-11-13 12:59:19 -03:00
error.h ldbl-opt: Add error and error_at_line (bug 23984) 2019-03-01 15:26:36 -03:00
execinfo.h
fcntl.h
features.h Prepare for glibc 2.32 release. 2020-08-04 22:17:00 -04:00
fenv.h
file_change_detection.h Move implementation of <file_change_detection.h> into a C file 2020-02-18 13:44:48 +01:00
float.h Make totalorder and totalordermag functions take pointer arguments. 2019-08-15 15:18:34 +00:00
fmtmsg.h
fnmatch.h
fpu_control.h
fstab.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
fts.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
ftw.h
gconv.h
getopt_int.h
getopt.h
glob.h
gmp.h
gnu-versions.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
grp-merge.h
grp.h nss_files: Consolidate line parse declarations in <nss_files.h> 2020-07-21 07:33:20 +02:00
gshadow.h nss_files: Consolidate line parse declarations in <nss_files.h> 2020-07-21 07:33:20 +02:00
iconv.h
ifaddrs.h
ifreq.h
ifunc-impl-list.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
inline-hashtab.h ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486] 2020-02-15 11:01:23 +01:00
intprops.h Sync intprops.h from Gnulib 2020-08-04 22:58:58 -07:00
inttypes.h Make strtoimax, strtoumax, wcstoimax, wcstoumax into aliases 2020-12-08 18:15:27 +00:00
langinfo.h
lastlog.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
libc-diag.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc-internal.h hurd: keep only required PLTs in ld.so 2020-11-11 02:36:22 +01:00
libc-pointer-arith.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc-symbols.h symbols: Add defines for libanl's libanl_hidden_{def|proto} 2020-12-04 10:04:38 +01:00
libgen.h
libintl.h Document the internal _ and N_ macros 2020-05-06 17:35:40 +02:00
limits.h Add C2x BOOL_MAX and BOOL_WIDTH to limits.h. 2020-08-19 22:46:41 +00:00
link.h elf: Make __rtld_env_path_list and __rtld_search_dirs global variables 2020-10-08 17:12:28 +02:00
list_t.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
list.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
locale.h
loop_unroll.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
malloc.h ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486] 2020-02-15 11:01:23 +01:00
math-narrow-eval.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math.h float128: use builtin_signbitf128 always 2020-05-04 13:18:45 -05:00
mcheck.h
memory.h
mntent.h
monetary.h Rename __LONG_DOUBLE_USES_FLOAT128 to __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 2020-04-30 08:52:08 -05:00
mqueue.h y2038: linux: Provide __mq_timedreceive_time64 implementation 2020-04-06 23:05:11 +02:00
netdb.h y2038: Convert gai_suspend to support 64 bit time 2020-12-04 10:04:38 +01:00
netgroup.h
nl_types.h
nss_files.h nss: Add __nss_fgetent_r 2020-07-21 07:33:50 +02:00
nss.h
nsswitch.h
obstack.h
plural-exp.h
poll.h
printf.h Rename __LONG_DOUBLE_USES_FLOAT128 to __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 2020-04-30 08:52:08 -05:00
pthread.h
pty.h
pwd.h nss_files: Consolidate line parse declarations in <nss_files.h> 2020-07-21 07:33:20 +02:00
random-bits.h y2038: Replace __clock_gettime with __clock_gettime64 2020-05-20 16:45:16 +02:00
re_comp.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
regex.h
regexp.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
resolv.h
rounding-mode.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
rtld-malloc.h elf: Implement __rtld_malloc_is_complete 2020-10-08 11:00:42 +02:00
sched.h Add hidden prototypes for __sched_getparam, __sched_getscheduler 2020-02-20 08:57:01 +01:00
scratch_buffer.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
search.h misc: Add twalk_r function 2019-05-02 11:42:51 +02:00
set-hooks.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
setjmp.h hurd: keep only required PLTs in ld.so 2020-11-11 02:36:22 +01:00
sgtty.h
shadow.h nss_files: Consolidate line parse declarations in <nss_files.h> 2020-07-21 07:33:20 +02:00
shlib-compat.h Remove --enable-obsolete-rpc configure flag 2020-07-13 19:36:35 +02:00
signal.h hurd: keep only required PLTs in ld.so 2020-11-11 02:36:22 +01:00
spawn.h posix: Use posix_spawn for wordexp 2019-10-09 17:48:41 -03:00
stab.h
stackinfo.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stap-probe.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stdc-predef.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stdint.h Move inttypes.h and stdint.h to stdlib. 2019-03-13 09:42:09 -04:00
stdio_ext.h
stdio.h libio: Remove __libc_readline_unlocked 2020-07-21 07:34:50 +02:00
stdlib.h hurd: keep only required PLTs in ld.so 2020-11-11 02:36:22 +01:00
string.h hurd: keep only required PLTs in ld.so 2020-11-11 02:36:22 +01:00
strings.h
struct___timeb64.h time: Add 64-bit time_t support for ftime 2020-10-27 09:54:50 -03:00
struct___timespec64.h y2038: include: Move struct __timespec64 definition to a separate file 2020-04-06 23:05:11 +02:00
struct___timeval64.h y2038: include: Move struct __timeval64 definition to a separate file 2020-05-05 19:36:25 +02:00
stubs-prologue.h
syscall.h
sysexits.h
syslog.h
tar.h
termios.h
tgmath.h
time.h y2038: linux: Provide __time64 implementation 2020-10-19 16:01:37 +02:00
ttyent.h
uchar.h
ucontext.h
ulimit.h
unistd.h hurd: keep only required PLTs in ld.so 2020-11-11 02:36:22 +01:00
utime.h
utmp.h
values.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
verify.h posix: Sync regex with gnulib 2019-11-06 09:20:52 -03:00
wait.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
wchar.h Rename __LONG_DOUBLE_USES_FLOAT128 to __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 2020-04-30 08:52:08 -05:00
wctype.h
wordexp.h