mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-27 23:20:10 +01:00
shm: Always try to set F_SEAL_SHRINK for created SHM files
Sealing is working not only for files created by memfd_create(), but also on tmpfs files.
This commit is contained in:
parent
f6753c117e
commit
83b086a16e
1 changed files with 3 additions and 1 deletions
|
|
@ -1207,7 +1207,6 @@ shm_tmpfile(void)
|
|||
#ifdef HAVE_MEMFD_CREATE
|
||||
fd = memfd_create("xorg", MFD_CLOEXEC|MFD_ALLOW_SEALING);
|
||||
if (fd != -1) {
|
||||
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK);
|
||||
DebugF ("Using memfd_create\n");
|
||||
return fd;
|
||||
}
|
||||
|
|
@ -1274,6 +1273,9 @@ ProcShmCreateSegment(ClientPtr client)
|
|||
close(fd);
|
||||
return BadAlloc;
|
||||
}
|
||||
#if defined(F_ADD_SEALS) && defined(F_SEAL_SHRINK)
|
||||
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK);
|
||||
#endif
|
||||
shmdesc = malloc(sizeof(ShmDescRec));
|
||||
if (!shmdesc) {
|
||||
close(fd);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue