Closed
Bug 479667
Opened 16 years ago
Closed 15 years ago
Firefox should use SetProcessDEPPolicy to enable NX on XP SP3
Categories
(Toolkit :: Startup and Profile System, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla1.9.2a1
People
(Reporter: myriachan, Assigned: benjamin)
References
(Blocks 1 open bug)
Details
(Keywords: fixed1.9.0.14, Whiteboard: [sg:want P1])
Attachments
(1 file)
(deleted),
patch
|
jimm
:
review+
beltzner
:
approval1.9.1.2+
dveditz
:
approval1.9.0.14+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6
Firefox 3 currently sets the /NXCOMPAT linker flag to enable Data Execution Prevention for itself under Vista. However, this doesn't work under XP, because XP doesn't recognize the /NXCOMPAT header bit.
Firefox ought to call SetProcessDEPPolicy to enable Data Execution Prevention on itself if the call exists. It was added to XP 32 in Service Pack 3.
It is not possible, barring nasty hacks with spawning a child process, to enable DEP in Firefox on an "OptIn" system66 under XP 32 SP2 or XP 64 SP2. SetProcessDEPPolicy plus /NXCOMPAT covers as much ground as realistically possible. (/NXCOMPAT covers Vista RTM, which didn't have SetProcessDEPPolicy.)
Reproducible: Always
Steps to Reproduce:
1. Set XP's Data Execution Prevention to "OptIn", the default.
2. Run Firefox under XP 32 SP3.
3. Cause Firefox to execute code from a data page.
Actual Results:
The code works.
Expected Results:
An exception should occur.
http://msdn.microsoft.com/en-us/library/bb736299(VS.85).aspx
It might be wise to continue to allow ATL thunk emulation so that "IE tab" can still work with ActiveX plugins for IE that don't like NX.
Updated•15 years ago
|
Blocks: exploit-mitigation
We should get this done for 1.9.1.x; it won't help people on SP2, but as mentioned in comment #0, we should cover as much ground as possible.
Status: UNCONFIRMED → NEW
blocking1.9.1: --- → ?
Ever confirmed: true
Comment 3•15 years ago
|
||
I really mean "badly wanted for 1.9.1.2" with my nomination, but we don't have wanted-1.9.1 or wanted-1.9.1.2 or wanted-1.9.1x or blocking-any-of-those, so this is as close as I could make it.
blocking1.9.1: ? → ---
Flags: blocking1.9.1.1?
Comment 4•15 years ago
|
||
blocking 1.9.1 maybe? Well someone will sort it out I hope :)
blocking1.9.1: --- → ?
Updated•15 years ago
|
status1.9.1:
--- → needstriage
Assignee | ||
Updated•15 years ago
|
Component: Security → Startup and Profile System
Product: Firefox → Toolkit
QA Contact: firefox → startup
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → benjamin
Assignee | ||
Comment 5•15 years ago
|
||
This dynamically loads and calls SetProcessDEPPolicy if it is available.
Attachment #388698 -
Flags: review?
Assignee | ||
Updated•15 years ago
|
Attachment #388698 -
Flags: review? → review?(jmathies)
Comment 6•15 years ago
|
||
I'll concur with gal here. Getting heap DEP working on as many windows variants as possible should be very high priority.
(Also consider workaround N+1: if you can't convince the loader and heap-setup code to do it, you might still be in a condition that VirtualProtect could force it page-by-page inside jemalloc. Maybe? Worth considering?)
Comment 7•15 years ago
|
||
Comment on attachment 388698 [details] [diff] [review]
Call SetProcessDEPPolicy if available, rev. 1
[Checkin: Comment 10 & 13]
Code looks fine. A comment explaining what this is doing or a reference to this bug# might be a good idea.
Attachment #388698 -
Flags: review?(jmathies) → review+
Updated•15 years ago
|
blocking1.9.1: ? → needed
Flags: wanted1.9.0.x+
Flags: blocking1.9.1.1?
Flags: blocking1.9.0.13?
Whiteboard: [sg:want P1]
Comment 8•15 years ago
|
||
Does this actually enable the ATL thunk workaround at the original comment suggested?
Comment 9•15 years ago
|
||
(In reply to comment #8)
> Does this actually enable the ATL thunk workaround at the original comment
> suggested?
I don't think PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION is required because /NXCOMPAT also disables the ATL thunk emulation.
http://support.microsoft.com/kb/948468
Assignee | ||
Comment 10•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•15 years ago
|
Attachment #388698 -
Flags: approval1.9.1.2?
Comment 11•15 years ago
|
||
I think we should definitively take this for 3.5.2. This would have stopped/disarmed the issue published 3 days ago.
blocking1.9.1: needed → ?
Updated•15 years ago
|
Attachment #388698 -
Flags: approval1.9.1.2? → approval1.9.1.2+
Comment 12•15 years ago
|
||
Comment on attachment 388698 [details] [diff] [review]
Call SetProcessDEPPolicy if available, rev. 1
[Checkin: Comment 10 & 13]
a1912=beltzner
Updated•15 years ago
|
blocking1.9.1: ? → .2+
Flags: blocking1.9.0.13? → blocking1.9.0.13+
Assignee | ||
Comment 13•15 years ago
|
||
Updated•15 years ago
|
Keywords: fixed1.9.1
Updated•15 years ago
|
Keywords: fixed1.9.1
Comment 14•15 years ago
|
||
What is the best/simplest way for QA to verify this bug for Firefox 3.5.2? (I find the original STR to be a bit too technical -- steps to perform step 1 and a test URL for step 3 would help...)
Assignee | ||
Comment 15•15 years ago
|
||
I don't think there is a way to test this without writing a test extension or finding an exploitable JIT bug.
Comment 16•15 years ago
|
||
You could back out the fix for the heap spray attack and then use the shell code in that bug to test this.
Updated•15 years ago
|
Attachment #388698 -
Flags: approval1.9.0.14+
Comment 17•15 years ago
|
||
Comment on attachment 388698 [details] [diff] [review]
Call SetProcessDEPPolicy if available, rev. 1
[Checkin: Comment 10 & 13]
Approved for 1.9.0.14, a=dveditz for release-drivers
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 18•15 years ago
|
||
Here an example of how the bug can be reproduced (for anyone interested, even though the bug is marked 'resolved'):
1) Start Firefox.
2) And now (after Firefox is initialized, which is important if we are to test whether Firefox calls SetProcessDEPPolicy) attach the OllyDbg debugger to the Firefox process (this should automatically pause the process).
3) Insert some valid assembly code (e.g. a simple 'nop' will do) in the .data section (use View -> Memory to find the .data section).
4) Set the EIP register to the starting offset of the code inserted at step 3. (View -> CPU. Then press CTRL+G or right-click -> Go to -> Expression. There insert the offset. Then CTRL+NUMPAD* or right-click -> New origin here.)
5) Press F8 or Debug -> Step over.
6) If OllyDbg displays 'Access violation when executing ...' in the status bar, the bug is indeed fixed.
Using these steps, the bug should not be reproducable with Firefox 3.5.2.
Hope someone finds this interesting/useful.
Updated•15 years ago
|
Attachment #388698 -
Attachment description: Call SetProcessDEPPolicy if available, rev. 1 → Call SetProcessDEPPolicy if available, rev. 1
[Checkin: Comment 10 & 13]
Updated•15 years ago
|
Whiteboard: [sg:want P1] → [c-n: to cvs=1.9.0] [sg:want P1]
Target Milestone: --- → mozilla1.9.2a1
Version: unspecified → Trunk
Comment 19•15 years ago
|
||
Checking in toolkit/xre/nsAppRunner.cpp;
/cvsroot/mozilla/toolkit/xre/nsAppRunner.cpp,v <-- nsAppRunner.cpp
new revision: 1.219; previous revision: 1.218
done
Keywords: checkin-needed → fixed1.9.0.14
Updated•15 years ago
|
Whiteboard: [c-n: to cvs=1.9.0] [sg:want P1] → [sg:want P1]
You need to log in
before you can comment on or make changes to this bug.
Description
•