Closed Bug 790929 Opened 12 years ago Closed 12 years ago

WebRTC crash [@sdp_build_attr_from_str]

Categories

(Core :: WebRTC: Signaling, defect)

x86_64
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Tracking Status
firefox16 --- unaffected
firefox17 --- unaffected
firefox18 + fixed
firefox-esr10 --- unaffected
firefox-esr17 --- unaffected

People

(Reporter: posidron, Assigned: ehugg)

References

Details

(Keywords: crash, sec-critical, testcase, Whiteboard: [asan][WebRTC][blocking-webrtc+][qa-][adv-main18-])

Attachments

(3 files, 1 obsolete file)

Attached file callstack
The console shows the following before the crash happens:

!!! Real PeerConnection constructor called OMG !!!
!!! {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} : calling initialize
!!! Queue for {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} is currently: []
!!! Queue for {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} is currently: []
!!! mozPeerConnection constructor called [object Window @ 0x1544f2980 (native @ 0x14e633d00)]
Delivering PeerConnection ICE callback 
!!! {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} : onStateChange called: 2
!!! ICE waiting...
!!! in executeNext: !!! Queue for {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} is currently: []
!!! {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} : createOffer called
!!! {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} : calling createOffer
!!! Queue for {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} is currently: []
!!! {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} : createOffer returned
!!! {94dd7f47-e489-a648-a1d0-a9317f8d4bc0} : onCreateOfferSuccess called

Click "Crash me" in the testcase to reproduce with a ASan enabled Alder build.
Attached file testcase
Component: WebRTC: Networking → WebRTC: Signaling
Keywords: testcase
Assignee: nobody → ethanhugg
Whiteboard: [asan] → [asan][WebRTC][blocking-webrtc+]
Comment on attachment 661166 [details] [diff] [review]
Error out on SDP buffer too small

If you don't error out, on the next attr the pointer is past the end, and the len (u16) is 6xxxx.
sdp_main.c is actually ok, but added comments.

FYI to cristoph - as this is code not in m-c yet, once it's fixed, should it be opened?  The main reason not to would be that this is imported code, so sec flaws (in the original code at least) would also exist in any Cisco product using it....  (Ethan, you might want to note this for internal Cisco people; CCSIP has/will get a lot of bugfixes relevant to the original source - though they might need to deal with them as reports and not patches, due to licensing issues.)
Attachment #661166 - Flags: review?(ethanhugg)
Comment on attachment 661166 [details] [diff] [review]
Error out on SDP buffer too small

Review of attachment 661166 [details] [diff] [review]:
-----------------------------------------------------------------

::: media/webrtc/signaling/src/sipcc/core/sdp/sdp_attr.c
@@ +215,1 @@
>              }

Is there a reason we wouldn't want to do this instead?  Seems we are checking the same value twice.

result = sdp_attr[attr_p->type].build_func(sdp_p, attr_p,ptr, (u16)(endbuf_p - *ptr));

/* If we ran out of buffer space, we must error out */
if (endbuf_p - *ptr <= 0)
  return (SDP_POTENTIAL_SDP_OVERFLOW);

if (result == SDP_SUCCESS) {
Attachment #661166 - Flags: review?(ethanhugg) → review+
Good point; switched and also corrected indent level to match the file
Attachment #661166 - Attachment is obsolete: true
Attachment #661194 - Flags: review?(ethanhugg)
Attachment #661194 - Flags: review?(ethanhugg) → review+
http://hg.mozilla.org/projects/alder/rev/a08a4ac425dc
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [asan][WebRTC][blocking-webrtc+] → [asan][WebRTC][blocking-webrtc+][qa-]
Flags: in-testsuite?
Whiteboard: [asan][WebRTC][blocking-webrtc+][qa-] → [asan][WebRTC][blocking-webrtc+][qa-][adv-main18-]
Group: core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: