Closed
Bug 556971
Opened 16 years ago
Closed 16 years ago
"ifdef MOZ_USE_IMAGE_EXPOSE" Image memory given to plugins is executable by all groups/users
Categories
(Core Graveyard :: Plug-ins, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: cjones, Assigned: dougt)
References
Details
(Whiteboard: [sg:critical])
Attachments
(3 files)
|
1.67 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
|
607 bytes,
patch
|
dougt
:
review-
|
Details | Diff | Splinter Review |
|
10.00 KB,
application/x-tar
|
Details |
See
http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsObjectFrame.cpp#5167
This opens fennec to a variety of attacks. Sorry if this has already been filed, but I wasn't CC'd.
| Assignee | ||
Comment 1•16 years ago
|
||
we should try to see if 0600 works or 0666. important part is to drop the x bit.
Comment 2•16 years ago
|
||
I think we should use 0666, the same for gfxSharedImageSurface.cpp:154.
Comment 3•16 years ago
|
||
Also I would like to kill that stuff with patch from bug 553943
Updated•16 years ago
|
Assignee: nobody → dougt
| Reporter | ||
Comment 4•16 years ago
|
||
(In reply to comment #2)
> I think we should use 0666, the same for gfxSharedImageSurface.cpp:154.
Why not 0600? (If that works.)
Comment 5•16 years ago
|
||
It's been a while since I've worked with shared memory, but doesn't creating a segment that's world readable/writable (0666) mean that any other user on a multiuser system would be able to monitor/change the plugin contents (bitmap)? That seems... bad.
Comment 6•16 years ago
|
||
DougT, can we get an ETA?
| Assignee | ||
Comment 7•16 years ago
|
||
i tested the nsObjectFrame change on device. it worked fine.
Attachment #438858 -
Flags: review?(jmuizelaar)
| Assignee | ||
Updated•16 years ago
|
tracking-fennec: --- → ?
Updated•16 years ago
|
Attachment #438858 -
Flags: review?(jmuizelaar) → review+
| Assignee | ||
Comment 8•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 9•16 years ago
|
||
That's not the right patch *and* the patch that Jeff reviewed doesn't have a test. We should make sure that we don't regress this security characteristic, IMO.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 10•16 years ago
|
||
Thank you Mike, I will back this out and push the correct patch.
I might be a good idea to have some auditing tool that could look at memory allocations and see if they have the execute bit set. Only a few allocations should allow this (the jit stuff is one that comes to mind). Do you know of any tools that can do this? Maybe some valgrind extension?
| Assignee | ||
Comment 11•16 years ago
|
||
push (for real this time):
http://hg.mozilla.org/mozilla-central/rev/e7d1573cdb3e
Comment 12•16 years ago
|
||
This is breaking gfxSharedImageSurface working properly...
XError: X_ShmAttach: BadAccess (attempt to access private resource denied); 3 requests ago; id=0x40000c
Re-running with MOZ_X_SYNC=1 in the environment may give a more helpful backtrace.
xulrunner-bin: ../../src/xcb_io.c:176: process_responses: Assertion `!(req && current_request && !(((long) (req->sequence) - (long) (current_request)) <= 0))' failed.
permissions must be 0666, otherwise it does not work.
Comment 13•16 years ago
|
||
Attachment #439524 -
Flags: review?(dougt)
| Assignee | ||
Comment 14•16 years ago
|
||
Oleg -- on what platform? Opening up read+writes for _EVERYONE_ on the system in order to use an section of memory seams like a bug in the kernel.
| Assignee | ||
Comment 15•16 years ago
|
||
ohmm. oh, maybe X somehow can't access it without the group+world right? Does this only effect your platform, or can we also see it on a standard ubuntu box?
Fwiw, i tested the plugin path on the n900 using the 1.2 rom and didn't see any problem.
Comment 16•16 years ago
|
||
> the patch that Jeff reviewed doesn't have a
> test. We should make sure that we don't regress this security characteristic,
> IMO.
It's inconceivable to me that you have to permit anyone to tamper with the segment in order to make XSHM work. So either we misunderstand how the permissions work, or we misunderstand how to make XSHM work with appropriate permissions. (Or the XSHM impl that Oleg is testing is just broken, I guess, but that seems least likely.)
(FIXED -- the bug is resolved as filed, one bug per patch/problem.)
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Comment 17•16 years ago
|
||
Wait: cjones, we construct this with IPC_PRIVATE, which means that we should be OK here anyway by my recently-refreshed understanding of how IPC permissions and access work. What is the attack you have in mind?
Comment 18•16 years ago
|
||
I'm using desktop QT build... redirecting output on Xephyr DISPLAY=:2 which is running in separate window
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 19•16 years ago
|
||
Oleg: this bug is FIXED. The patch is in the tree. Unless we back it out and recreate the security issue alleged in comment 0, it should not be REOPENED.
We should get information about the actual behaviour of the shm segments in these various cases, and write some tests, rather than just permuting, IMO.
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 20•16 years ago
|
||
Oleg filed 559837.
| Reporter | ||
Comment 21•16 years ago
|
||
Sorry for the tempest in a teapot. The shmget man page on my linux system says
Presently, the execute permissions are not used by the system.
So this particular bug could be RESOLVED INVALID since AFAIK we only use sysv shmem on linux.
We might want to continue the 0600 vs. 0666 discussion in Oleg's bug. For the record, if I set things up correctly, these programs test if nobody/nogroup can attach to a 0666 segment. Locally I see
$ ./shmget_test
unpriv: succeeded
unpriv: done scribbling
So I really hope we can avoid using 0600.
| Reporter | ||
Comment 22•16 years ago
|
||
(Also FTR 0600 fails.)
| Reporter | ||
Comment 23•16 years ago
|
||
(In reply to comment #21)
> $ ./shmget_test
> unpriv: succeeded
> unpriv: done scribbling
>
Last note: this invocation was wrong, needs to be |sudo ./shmget_test| because it seteuid/setguid's. The test will always succeed if run as a normal user.
Comment 24•16 years ago
|
||
(In reply to comment #17)
> Wait: cjones, we construct this with IPC_PRIVATE, which means that we should be
> OK here anyway by my recently-refreshed understanding of how IPC permissions
> and access work.
...howso? AFAIK, IPC_PRIVATE is just a magic value to say "give me an unused key".
| Assignee | ||
Comment 25•16 years ago
|
||
Comment on attachment 439524 [details] [diff] [review]
Fix to 0666
I am not convinced that this is the right thing to do.
Maybe we should try 0600 first, then downgrade security to 0666 if we have to...
but I really want to understand why 0600 doesn't work for your X server. I couldn't find one today that failed in the same way yours does.
Attachment #439524 -
Flags: review?(dougt) → review-
Updated•12 years ago
|
tracking-fennec: ? → ---
Updated•11 years ago
|
Group: core-security → core-security-release
Updated•11 years ago
|
Group: core-security-release
Updated•4 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•