Seal shared memory on POSIX IPC

Change-Id: I5dc3807af904ad77db82d49b38b4c8e66d2d4de6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Tobias Koenig 2015-01-03 12:52:05 +01:00
parent ddc884c841
commit de61130bd4
1 changed files with 7 additions and 0 deletions

View File

@ -173,6 +173,13 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
return false;
}
#ifdef F_ADD_SEALS
// Make sure the shared memory region will not shrink
// otherwise someone could cause SIGBUS on us.
// (see http://lwn.net/Articles/594919/)
fcntl(hand, F_ADD_SEALS, F_SEAL_SHRINK);
#endif
return true;
}