diff --git a/libc/bionic/__fgets_chk.cpp b/libc/bionic/__fgets_chk.cpp index 429eda515..32b608e71 100644 --- a/libc/bionic/__fgets_chk.cpp +++ b/libc/bionic/__fgets_chk.cpp @@ -49,7 +49,7 @@ extern "C" char *__fgets_chk(char *dest, int supplied_size, } if (((size_t) supplied_size) > dest_len_from_compiler) { - __fortify_chk_fail("fgets buffer overflow", 0); + __fortify_chk_fail("fgets buffer overflow prevented", 0); } return fgets(dest, supplied_size, stream); diff --git a/libc/bionic/__memcpy_chk.cpp b/libc/bionic/__memcpy_chk.cpp index a3d744c2a..b95a0d77f 100644 --- a/libc/bionic/__memcpy_chk.cpp +++ b/libc/bionic/__memcpy_chk.cpp @@ -46,7 +46,7 @@ extern "C" void *__memcpy_chk(void *dest, const void *src, size_t copy_amount, size_t dest_len) { if (__predict_false(copy_amount > dest_len)) { - __fortify_chk_fail("memcpy buffer overflow", + __fortify_chk_fail("memcpy buffer overflow prevented", BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW); } diff --git a/libc/bionic/__memmove_chk.cpp b/libc/bionic/__memmove_chk.cpp index 49a059782..5f5113990 100644 --- a/libc/bionic/__memmove_chk.cpp +++ b/libc/bionic/__memmove_chk.cpp @@ -45,7 +45,7 @@ extern "C" void *__memmove_chk (void *dest, const void *src, size_t len, size_t dest_len) { if (__predict_false(len > dest_len)) { - __fortify_chk_fail("memmove buffer overflow", + __fortify_chk_fail("memmove buffer overflow prevented", BIONIC_EVENT_MEMMOVE_BUFFER_OVERFLOW); } diff --git a/libc/bionic/__memset_chk.cpp b/libc/bionic/__memset_chk.cpp index f7a5f241e..04c772b0e 100644 --- a/libc/bionic/__memset_chk.cpp +++ b/libc/bionic/__memset_chk.cpp @@ -43,7 +43,7 @@ */ extern "C" void *__memset_chk (void *dest, int c, size_t n, size_t dest_len) { if (__predict_false(n > dest_len)) { - __fortify_chk_fail("memset buffer overflow", + __fortify_chk_fail("memset buffer overflow prevented", BIONIC_EVENT_MEMSET_BUFFER_OVERFLOW); } diff --git a/libc/bionic/__recvfrom_chk.cpp b/libc/bionic/__recvfrom_chk.cpp index 10a426331..3a9dab6fd 100644 --- a/libc/bionic/__recvfrom_chk.cpp +++ b/libc/bionic/__recvfrom_chk.cpp @@ -37,7 +37,7 @@ ssize_t __recvfrom_chk(int socket, void* buf, size_t len, size_t buflen, unsigne const struct sockaddr* src_addr, socklen_t* addrlen) { if (__predict_false(len > buflen)) { - __fortify_chk_fail("recvfrom overflow", 0); + __fortify_chk_fail("recvfrom buffer overflow prevented", 0); } return recvfrom(socket, buf, len, flags, src_addr, addrlen); diff --git a/libc/bionic/__strcat_chk.cpp b/libc/bionic/__strcat_chk.cpp index e0b3259bf..37ecfe646 100644 --- a/libc/bionic/__strcat_chk.cpp +++ b/libc/bionic/__strcat_chk.cpp @@ -55,7 +55,7 @@ extern "C" char* __strcat_chk( while ((*dest++ = *src++) != '\0') { dest_buf_size--; if (__predict_false(dest_buf_size == 0)) { - __fortify_chk_fail("strcat buffer overflow", + __fortify_chk_fail("strcat buffer overflow prevented", BIONIC_EVENT_STRCAT_BUFFER_OVERFLOW); } } diff --git a/libc/bionic/__strchr_chk.cpp b/libc/bionic/__strchr_chk.cpp index 72559bc69..87d889310 100644 --- a/libc/bionic/__strchr_chk.cpp +++ b/libc/bionic/__strchr_chk.cpp @@ -33,7 +33,7 @@ extern "C" char* __strchr_chk(const char* p, int ch, size_t s_len) { for (;; ++p, s_len--) { if (__predict_false(s_len == 0)) { - __fortify_chk_fail("read beyond buffer", 0); + __fortify_chk_fail("strchr buffer overrun prevented", 0); } if (*p == static_cast(ch)) { return const_cast(p); diff --git a/libc/bionic/__strcpy_chk.cpp b/libc/bionic/__strcpy_chk.cpp index 5aa0e93e6..e92e539fe 100644 --- a/libc/bionic/__strcpy_chk.cpp +++ b/libc/bionic/__strcpy_chk.cpp @@ -45,7 +45,7 @@ extern "C" char *__strcpy_chk (char *dest, const char *src, size_t dest_len) { // TODO: optimize so we don't scan src twice. size_t src_len = strlen(src) + 1; if (__predict_false(src_len > dest_len)) { - __fortify_chk_fail("strcpy buffer overflow", + __fortify_chk_fail("strcpy buffer overflow prevented", BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW); } diff --git a/libc/bionic/__strlcat_chk.cpp b/libc/bionic/__strlcat_chk.cpp index 25c67adca..5f970932b 100644 --- a/libc/bionic/__strlcat_chk.cpp +++ b/libc/bionic/__strlcat_chk.cpp @@ -46,7 +46,7 @@ extern "C" size_t __strlcat_chk(char *dest, const char *src, size_t supplied_size, size_t dest_len_from_compiler) { if (__predict_false(supplied_size > dest_len_from_compiler)) { - __fortify_chk_fail("strlcat buffer overflow", 0); + __fortify_chk_fail("strlcat buffer overflow prevented", 0); } return strlcat(dest, src, supplied_size); diff --git a/libc/bionic/__strlcpy_chk.cpp b/libc/bionic/__strlcpy_chk.cpp index f6b11fc57..a6877eb58 100644 --- a/libc/bionic/__strlcpy_chk.cpp +++ b/libc/bionic/__strlcpy_chk.cpp @@ -46,7 +46,7 @@ extern "C" size_t __strlcpy_chk(char *dest, const char *src, size_t supplied_size, size_t dest_len_from_compiler) { if (__predict_false(supplied_size > dest_len_from_compiler)) { - __fortify_chk_fail("strlcpy buffer overflow", 0); + __fortify_chk_fail("strlcpy buffer overflow prevented", 0); } return strlcpy(dest, src, supplied_size); diff --git a/libc/bionic/__strlen_chk.cpp b/libc/bionic/__strlen_chk.cpp index 151a497a6..87be0e678 100644 --- a/libc/bionic/__strlen_chk.cpp +++ b/libc/bionic/__strlen_chk.cpp @@ -57,7 +57,7 @@ extern "C" size_t __strlen_chk(const char *s, size_t s_len) { size_t ret = strlen(s); if (__predict_false(ret >= s_len)) { - __fortify_chk_fail("strlen read overflow", 0); + __fortify_chk_fail("strlen buffer overrun prevented", 0); } return ret; diff --git a/libc/bionic/__strncat_chk.cpp b/libc/bionic/__strncat_chk.cpp index f54d838cd..4f4b3271e 100644 --- a/libc/bionic/__strncat_chk.cpp +++ b/libc/bionic/__strncat_chk.cpp @@ -59,7 +59,7 @@ extern "C" char *__strncat_chk( len--; dest_buf_size--; if (__predict_false(dest_buf_size == 0)) { - __fortify_chk_fail("strncat buffer overflow", + __fortify_chk_fail("strncat buffer overflow prevented", BIONIC_EVENT_STRNCAT_BUFFER_OVERFLOW); } diff --git a/libc/bionic/__strncpy_chk.cpp b/libc/bionic/__strncpy_chk.cpp index 6b1a3c77f..d362b3410 100644 --- a/libc/bionic/__strncpy_chk.cpp +++ b/libc/bionic/__strncpy_chk.cpp @@ -45,7 +45,7 @@ extern "C" char* __strncpy_chk(char* __restrict dest, const char* __restrict src size_t len, size_t dest_len) { if (__predict_false(len > dest_len)) { - __fortify_chk_fail("strncpy dest buffer overflow", + __fortify_chk_fail("strncpy dest buffer overflow prevented", BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW); } @@ -64,7 +64,7 @@ extern "C" char* __strncpy_chk2(char* __restrict dst, const char* __restrict src size_t n, size_t dest_len, size_t src_len) { if (__predict_false(n > dest_len)) { - __fortify_chk_fail("strncpy dest buffer overflow", + __fortify_chk_fail("strncpy dest buffer overflow prevented", BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW); } if (n != 0) { @@ -83,7 +83,7 @@ extern "C" char* __strncpy_chk2(char* __restrict dst, const char* __restrict src size_t s_copy_len = static_cast(s - src); if (__predict_false(s_copy_len > src_len)) { - __fortify_chk_fail("strncpy read beyond end of src buffer", 0); + __fortify_chk_fail("strncpy buffer overrun prevented", 0); } } diff --git a/libc/bionic/__strrchr_chk.cpp b/libc/bionic/__strrchr_chk.cpp index 14100f791..2bdf36a70 100644 --- a/libc/bionic/__strrchr_chk.cpp +++ b/libc/bionic/__strrchr_chk.cpp @@ -37,7 +37,7 @@ extern "C" char* __strrchr_chk(const char *p, int ch, size_t s_len) for (save = NULL;; ++p, s_len--) { if (s_len == 0) - __fortify_chk_fail("strrchr read beyond buffer", 0); + __fortify_chk_fail("strrchr read overrun prevented", 0); if (*p == (char) ch) save = (char *)p; if (!*p) diff --git a/libc/bionic/__vsnprintf_chk.cpp b/libc/bionic/__vsnprintf_chk.cpp index 2d3a81ecb..731f9c5cb 100644 --- a/libc/bionic/__vsnprintf_chk.cpp +++ b/libc/bionic/__vsnprintf_chk.cpp @@ -51,7 +51,7 @@ extern "C" int __vsnprintf_chk( va_list va) { if (__predict_false(supplied_size > dest_len_from_compiler)) { - __fortify_chk_fail("vsnprintf buffer overflow", 0); + __fortify_chk_fail("vsnprintf buffer overflow prevented", 0); } return vsnprintf(dest, supplied_size, format, va); diff --git a/libc/bionic/__vsprintf_chk.cpp b/libc/bionic/__vsprintf_chk.cpp index 12b0ca6ab..560f12e4f 100644 --- a/libc/bionic/__vsprintf_chk.cpp +++ b/libc/bionic/__vsprintf_chk.cpp @@ -52,7 +52,7 @@ extern "C" int __vsprintf_chk( int ret = vsnprintf(dest, dest_len_from_compiler, format, va); if ((size_t) ret >= dest_len_from_compiler) { - __fortify_chk_fail("vsprintf buffer overflow", 0); + __fortify_chk_fail("vsprintf buffer overflow prevented", 0); } return ret;