glibc/string
Joseph Myers 2c6cabb3a4 Correct access attribute on memfrob (bug 28475)
As noted in bug 28475, the access attribute on memfrob in <string.h>
is incorrect: the function both reads and writes the memory pointed to
by its argument, so it needs to use __read_write__, not
__write_only__.  This incorrect attribute results in a build failure
for accessing uninitialized memory for s390x-linux-gnu-O3 with
build-many-glibcs.py using GCC mainline.

Correct the attribute.  Fixing this shows up that some calls to
memfrob in elf/ tests are reading uninitialized memory; I'm not
entirely sure of the purpose of those calls, but guess they are about
ensuring that the stack space is indeed allocated at that point in the
function, and so it matters that they are calling a function whose
semantics are unknown to the compiler.  Thus, change the first memfrob
call in those tests to use explicit_bzero instead, as suggested by
Florian in
<https://sourceware.org/pipermail/libc-alpha/2021-October/132119.html>,
to avoid the use of uninitialized memory.

Tested for x86_64, and with build-many-glibcs.py (GCC mainline) for
s390x-linux-gnu-O3.
2021-10-20 13:38:50 +00:00
..
bits Don't add access size hints to fortifiable functions 2021-10-20 08:33:31 +05:30
_strerror.c
argz-addsep.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-append.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-count.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-create.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-ctsep.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-delete.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-extract.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-insert.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-next.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-replace.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz-stringify.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
argz.h
basename.c
bcopy.c
bug-envz1.c
bug-strcoll1.c
bug-strcoll2.c
bug-strncat1.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
bug-strpbrk1.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
bug-strspn1.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
bug-strtok1.c
byteswap.h
bzero.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
Depend
endian.h
envz.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
envz.h
explicit_bzero.c
ffs.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ffsll.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
inl-tester.c
Makefile dlfcn: Cleanups after -ldl is no longer required 2021-06-03 09:11:45 +02:00
memccpy.c
memchr.c
memcmp.c
memcpy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memfrob.c
memmem.c
memmove.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memory.h
mempcpy.c
memrchr.c
memset.c
noinl-tester.c
rawmemchr.c
sigabbrev_np.c
sigdescr_np.c
stpcpy.c
stpncpy.c
str-two-way.h
stratcliff.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strcasecmp_l.c
strcasecmp.c
strcasestr.c
strcat.c
strchr.c
strchrnul.c
strcmp.c
strcoll_l.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strcoll.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strcpy.c
strcspn.c
strdup.c
strerror_l.c
strerror.c
strerrordesc_np.c
strerrorname_np.c
strfry.c
string-inlines.c
string.h Correct access attribute on memfrob (bug 28475) 2021-10-20 13:38:50 +00:00
strings.h
strlen.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strncase_l.c
strncase.c
strncat.c
strncmp.c
strncpy.c
strndup.c
strnlen.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strpbrk.c
strrchr.c
strsep.c
strsignal.c
strspn.c
strstr.c
strtok_r.c
strtok.c
strverscmp.c
strxfrm_l.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
strxfrm.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
swab.c
test-bcopy.c
test-bzero.c
test-endian-file-scope.c
test-endian-sign-conversion.c
test-endian-types.c
test-explicit_bzero.c
test-ffs.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-memccpy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-memchr.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-memcmp.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-memcpy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-memmem.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-memmove.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-mempcpy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-memrchr.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-memset.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-rawmemchr.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-sig_np.c
test-stpcpy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-stpncpy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strcasecmp.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strcasestr.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strcat.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strchr.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strchrnul.c
test-strcmp.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strcpy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strcspn.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strerror-errno.c
test-string.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strlen.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strncasecmp.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strncat.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strncmp.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strncpy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strnlen.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strpbrk.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strrchr.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strspn.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
test-strstr.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
testcopy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
tester.c
tst-bswap.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
tst-cmp.c
tst-endian.c
tst-inlcall.c
tst-memmove-overflow.c
tst-strcoll-overflow.c
tst-strerror.c
tst-strfry.c
tst-strlen.c
tst-strsignal.c
tst-strtok_r.c
tst-strtok.c
tst-strxfrm2.c
tst-strxfrm.c
tst-svc2.c
tst-svc.c
tst-svc.expect
tst-svc.input
tst-xbzero-opt.c
Versions
wordcopy.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
xpg-strerror.c