mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
Fix FORTIFY_SOURCE false positive
When -D_FORTIFY_SOURCE=2 was given during compilation, sprintf and similar functions will check if their first argument is in read-only memory and exit with *** %n in writable segment detected *** otherwise. To check if the memory is read-only, glibc reads frpm the file "/proc/self/maps". If opening this file fails due to too many open files (EMFILE), glibc will now ignore this error. Fixes [BZ #30932] Signed-off-by: Volker Weißmann <volker.weissmann@gmx.de> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
parent
751850cf5a
commit
7bb8045ec0
1 changed files with 3 additions and 1 deletions
|
@ -42,7 +42,9 @@ __readonly_area (const char *ptr, size_t size)
|
|||
to the /proc filesystem if it is set[ug]id. There has
|
||||
been no willingness to change this in the kernel so
|
||||
far. */
|
||||
|| errno == EACCES)
|
||||
|| errno == EACCES
|
||||
/* Process has reached the maximum number of open files. */
|
||||
|| errno == EMFILE)
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue