DescriptionImplement SharedMemory::ShareReadOnlyToProcess().
This avoids potential security holes where the renderer could be exploited and
then write into space shared by other renderers or even the browser.
I've done this on Posix by opening both a read/write and read-only file descriptor to the same file. Then ShareReadOnlyToProcess dup()s the read-only descriptor instead of the read/write one. It's an error to try to ShareReadOnly from a SharedMemory that was created from a single SharedMemoryHandle.
The test checks that operations strictly through the file handle can't get
write access to the memory. On Linux there's still a hole through /dev/fd
in the filesystem, but jln@ assures me that the sandbox prevents the
filesystem-based attack. We should eventually write an explicit test for this.
Android needs http://crbug.com/320865 figured out.
BUG=302724, 320865
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236347
Patch Set 1 #Patch Set 2 : Simplify Mac test and start implementing for Windows #Patch Set 3 : Implement test on Windows #Patch Set 4 : Remove extra includes from user_script_master #Patch Set 5 : Add errno.h #
Total comments: 25
Patch Set 6 : Don't check /dev/fd on Android, which doesn't have such a path #Patch Set 7 : Fix most of Julien's comments #Patch Set 8 : Add some tests on the stat() of the returned FD to debug odd linux_asan failure #Patch Set 9 : Fix signedness on Mac #
Total comments: 2
Patch Set 10 : Test Android; don't review this patch #Patch Set 11 : Implement ShareReadOnlyToProcess instead #
Total comments: 2
Patch Set 12 : Try to fix Android and Windows #
Total comments: 1
Patch Set 13 : Open the file twice to get a read-only version #Patch Set 14 : Leave the handle writable on Android #
Total comments: 6
Patch Set 15 : Fix Mark's comments #
Messages
Total messages: 21 (0 generated)
|