Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: ui/surface/transport_dib_linux.cc

Issue 10854242: Make shared memory segments writable only by their rightful owners. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/surface/transport_dib_linux.cc
===================================================================
--- ui/surface/transport_dib_linux.cc (revision 155390)
+++ ui/surface/transport_dib_linux.cc (working copy)
@@ -39,14 +39,13 @@
// static
TransportDIB* TransportDIB::Create(size_t size, uint32 sequence_num) {
- // We use a mode of 0666 since the X server won't attach to memory which is
- // 0600 since it can't know if it (as a root process) is being asked to map
- // someone else's private shared memory region.
- const int shmkey = shmget(IPC_PRIVATE, size, 0666);
+ const int shmkey = shmget(IPC_PRIVATE, size, 0600);
if (shmkey == -1) {
DLOG(ERROR) << "Failed to create SysV shared memory region"
<< " errno:" << errno;
return NULL;
+ } else {
+ VLOG(1) << "Created SysV shared memory region " << shmkey;
}
void* address = shmat(shmkey, NULL /* desired address */, 0 /* flags */);
« content/browser/renderer_host/backing_store_gtk.cc ('K') | « ui/base/x/x11_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698