Closed Bug 1687269 Opened 3 years ago Closed 2 years ago

Crash in [@ nsReadFromRawBuffer]

Categories

(Core :: DOM: File, defect)

Unspecified
All
defect

Tracking

()

RESOLVED DUPLICATE of bug 1740797

People

(Reporter: gsvelto, Unassigned)

References

Details

(Keywords: crash, csectype-bounds, sec-high, Whiteboard: [necko-triaged])

Crash Data

Crash report: https://crash-stats.mozilla.org/report/index/5bff272f-84df-4640-84ee-0f3410210118

Reason: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS

Top 10 frames of crashing thread:

0 libsystem_platform.dylib _platform_memmove$VARIANT$Haswell 
1 XUL nsReadFromRawBuffer xpcom/io/nsPipe3.cpp:1715
2 XUL nsPipeOutputStream::WriteSegments xpcom/io/nsPipe3.cpp:1684
3 XUL nsStreamCopierIB::ConsumeInputBuffer xpcom/io/nsStreamUtils.cpp:501
4 XUL nsStringInputStream::ReadSegments xpcom/io/nsStringStream.cpp:316
5 XUL nsStreamCopierIB::DoCopy xpcom/io/nsStreamUtils.cpp:519
6 XUL nsAStreamCopier::Process xpcom/io/nsStreamUtils.cpp:302
7 XUL {virtual override thunk} 
8 XUL nsThreadPool::Run xpcom/threads/nsThreadPool.cpp:301
9 XUL nsThread::ProcessNextEvent xpcom/threads/nsThread.cpp:1200

Not a new crash, this appears to be like we're reading past (or before?) a buffer. The comments in the crash reports mention this is happening at the end of a large transfer while saving a file. There's both mentions of trying to download stuff from https://mega.nz and people saving recorded videos.

This only seem to affect Linux and macOS but there might be a different signature for Windows.

Interestingly there's almost no volume before September 14 2020, this looks like some kind of regression around that time.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]

Over to XPCOM to be retriaged.
This looks like a UAF to me.

Group: core-security
Severity: S3 → --
Component: Networking → XPCOM
Priority: P2 → --
Group: core-security → dom-core-security

Why does this look like a UAF to you? Are there some reports with a poison value that you saw?

Flags: needinfo?(valentin.gosu)

(In reply to Andrew McCreight [:mccr8] from comment #3)

Why does this look like a UAF to you? Are there some reports with a poison value that you saw?

No, sorry about that. I'm not sure what made me think UAF while looking at the stack trace.

Flags: needinfo?(valentin.gosu)
OS: All → macOS

I suppose it does look rather like a buffer overflow of some sort.

This appears not to be macOS-specific. I found Windows signatures with significant volume and the same stack trace.

Crash Signature: [@ nsReadFromRawBuffer] [@ __memmove_avx_unaligned_erms | nsReadFromRawBuffer] [@ __memcpy_sse2_unaligned_erms | nsReadFromRawBuffer] [@ __memcpy_ssse3 | nsReadFromRawBuffer] [@ __memcpy_ssse3_back | nsReadFromRawBuffer] → [@ nsReadFromRawBuffer] [@ __memmove_avx_unaligned_erms | nsReadFromRawBuffer] [@ __memcpy_sse2_unaligned_erms | nsReadFromRawBuffer] [@ __memcpy_ssse3 | nsReadFromRawBuffer] [@ __memcpy_ssse3_back | nsReadFromRawBuffer] [@ memcpy_repmovs | nsReadFro…
OS: macOS → All

I've scoured the comments of the Windows crashes and this seems really related to large file downloads: there are several crashes happening on mega.nz while downloading files that appear to be between 1.5 and 4GB in size. Other reporters mention trying to download large files (3, 4 and 5GB) appear in the comments. I suppose we could try reproducing the bug that way?

FYI if you read the comments be aware that there's a pretty large amount of profanity in there. These are frustrated users who waited for hours for a download and then Firefox crashed on them.

In case it helps, mega.nz does... strange... stuff where they put data into blobs to "encrypt" them or something, see e.g. bug 1584898, bug 1700187.

OS: All → macOS
OS: macOS → Other
OS: Other → All
See Also: → 1740797

Bug 1740797 has a test case with a similar looking stack.

Moving this to the same component as bug 1740797 where the investigation is being done.

Component: XPCOM → DOM: File
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Group: dom-core-security
You need to log in before you can comment on or make changes to this bug.