1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Restrict shm_open and shm_unlink to SHMDIR. Fixes bugs 14752 and 15763.

This commit is contained in:
Ondřej Bílka
2013-10-31 13:58:01 +01:00
parent 8a43e768d9
commit 5d30d85329
4 changed files with 31 additions and 14 deletions

View File

@ -134,6 +134,14 @@ do_test (void)
int status2;
struct stat64 st;
fd = shm_open ("/../escaped", O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600);
if (fd != -1)
{
perror ("read file outside of SHMDIR directory");
return 1;
}
/* Create the shared memory object. */
fd = shm_open ("/shm-test", O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600);
if (fd == -1)