Seal shared memory on POSIX IPC
Change-Id: I5dc3807af904ad77db82d49b38b4c8e66d2d4de6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
ddc884c841
commit
de61130bd4
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue