Closed Bug 1816936 Opened 2 years ago Closed 1 year ago

Dll Interceptor should write nop instructions to the remaining bytes of the final instruction

Categories

(Core :: mozglue, defect)

Firefox 112
Desktop
Windows
defect

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox112 --- wontfix
firefox118 --- fixed

People

(Reporter: gstoll, Assigned: gstoll)

References

Details

Attachments

(1 file)

The WindowsDllDetourPatcher overwrites the first 13 (or 10) bytes of a function with a jump to a patched function. If the 13 bytes ends in the middle of an instruction, it leaves the rest of the bytes of that instruction alone, which can cause problems if something else wants to detour that function later. We should instead overwrite the rest of the bytes in that instruction with nop. (or int 3, I suppose)

The severity field is not set for this bug.
:glandium, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mh+mozilla)
Severity: -- → S4
Flags: needinfo?(mh+mozilla)

In bug 1833793 we discovered that ESET is indeed hooking some of the functions that we do after us. I don't think that this is causing them problems right now, but to be on the safe side I'd like to fix this.

Assignee: nobody → gstoll
Status: NEW → ASSIGNED
Attachment #9346999 - Attachment description: Bug 1816936 - make DllInterceptor pad out partial instructions with nop's r=yjuglaret! → Bug 1816936 - make DllInterceptor pad out partial instructions with nop's r=mhowell
Pushed by gstoll@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/19e1b7f45acb make DllInterceptor pad out partial instructions with nop's r=mhowell
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Regressions: 1847795

Is this something we should consider backporting anywhere?

Flags: needinfo?(gstoll)

Probably not. We don't know of any problems it's causing - well-behaved things that are detouring the functions that we detour should handle this case correctly. And it is a little risky.

Flags: needinfo?(gstoll)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: