Closed Bug 806829 Opened 12 years ago Closed 12 years ago

WebRTC possible data race with ccsnap_device_pre_init vs. strlib_malloc

Categories

(Core :: WebRTC: Signaling, defect, P2)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: posidron, Assigned: ehugg)

References

Details

(Whiteboard: [tsan] [WebRTC] [blocking-webrtc-][qa-])

Attachments

(2 files)

Attached file callstack
media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.c:329 if ((g_deviceInfo.name) && (strlen(g_deviceInfo.name) > 0)) { strlib_free(g_deviceInfo.name); } media/webrtc/signaling/src/sipcc/core/src-common/string_lib.c:68 sstrncpy(temp->data, str, length + 1); temp->data[length] = '\0'; return STRUCT_TO_STR(temp); Marked as s-s because memory functions are involved, please downgrade if necessary. Tested with m-c changeset: 111684:e19e170d2f6d
Whiteboard: [tsan] → [tsan] [WebRTC] [blocking-webrtc+]
Does this stack make any sense? Why is webrtc signalling code (pretty standalone, imported from external right?) accessing memory allocated as part of a nsTArray deep inside a nsFrame? For that matter why does nsPresArena::State::Free call nsTArray::AppendElement?
In retrospect this is very likely a false positive since there are also no locks involved and the run mode was pure-happens-before.
Christophe want to open this bug up?
Yes, we can do that.
Group: core-security
Seems very unlikely to be real
Assignee: nobody → ethanhugg
Priority: -- → P2
Whiteboard: [tsan] [WebRTC] [blocking-webrtc+] → [tsan] [WebRTC] [blocking-webrtc-]
Comment on attachment 692446 [details] [diff] [review] Signaling - remove g_deviceInfo.name I had a suspicion that g_deviceInfo.name was never set, so in order to prove it I made a patch that removes it all together. We could either push this patch to simplify the code, or use it as proof that this race won't happen since it's never set.
Attachment #692446 - Flags: feedback?(rjesup)
Attachment #692446 - Flags: feedback?(rjesup) → review?(rjesup)
Attachment #692446 - Flags: review?(rjesup) → review+
Comment on attachment 692446 [details] [diff] [review] Signaling - remove g_deviceInfo.name Review of attachment 692446 [details] [diff] [review]: ----------------------------------------------------------------- ::: media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device_info.c @@ +30,5 @@ > * gets the device name > * @returns - a pointer to the device name > */ > cc_string_t CCAPI_DeviceInfo_getDeviceName (cc_deviceinfo_ref_t handle) > { At least debug here since we're not giving it a real devicename
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Whiteboard: [tsan] [WebRTC] [blocking-webrtc-] → [tsan] [WebRTC] [blocking-webrtc-][qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: