Bug 209941

Summary: Filter some capture device names
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: WebRTCAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, glenn, hta, jer.noble, philipj, sergio, tommyw, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Eric Carlson
Reported 2020-04-02 16:53:01 PDT
Filter some capture device names
Attachments
Patch (4.91 KB, patch)
2020-04-02 17:06 PDT, Eric Carlson
no flags
Patch for landing (4.93 KB, patch)
2020-04-03 10:31 PDT, Eric Carlson
no flags
Eric Carlson
Comment 1 2020-04-02 16:53:40 PDT
Eric Carlson
Comment 2 2020-04-02 17:06:48 PDT
youenn fablet
Comment 3 2020-04-03 01:29:41 PDT
Comment on attachment 395327 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395327&action=review > Source/WebCore/platform/mediastream/CaptureDevice.h:50 > + static NeverDestroyed<String> airPods(MAKE_STATIC_STRING_IMPL("AirPods")); This seems ok to special case AirPods name, I would restrict this to Microphone DeviceType. Maybe we should move that method to a CPP file as well. Also we do not protect other device names. We could sanitize all bluetooth microphone devices, by checking kAudioDevicePropertyTransportType in CoreAudioCaptureDevice.cpp. We would then continue special casing AirPods but would rename other BT microphones to "Bluetooth Microphone" or "Bluetooth Microphone: xxx" with the first letters of the real names.
Eric Carlson
Comment 4 2020-04-03 10:31:27 PDT
Created attachment 395393 [details] Patch for landing
Eric Carlson
Comment 5 2020-04-03 10:56:16 PDT
Comment on attachment 395327 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395327&action=review >> Source/WebCore/platform/mediastream/CaptureDevice.h:50 >> + static NeverDestroyed<String> airPods(MAKE_STATIC_STRING_IMPL("AirPods")); > > This seems ok to special case AirPods name, I would restrict this to Microphone DeviceType. > Maybe we should move that method to a CPP file as well. > > Also we do not protect other device names. > We could sanitize all bluetooth microphone devices, by checking kAudioDevicePropertyTransportType in CoreAudioCaptureDevice.cpp. > We would then continue special casing AirPods but would rename other BT microphones to "Bluetooth Microphone" or "Bluetooth Microphone: xxx" with the first letters of the real names. I agree that we should look at sanitizing other device names. I'll land this after updating to only change the name if the device is a microphone, and we can figure out a more cohesive strategy for the future.
EWS
Comment 6 2020-04-03 11:22:09 PDT
Committed r259477: <https://trac.webkit.org/changeset/259477> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395393 [details].
Note You need to log in before you can comment on or make changes to this bug.