[v3,0/1] uvcvideo: require spec compliance to avoid bugs

Message ID 20240913180601.1400596-1-cascardo@igalia.com (mailing list archive)
Headers
Series uvcvideo: require spec compliance to avoid bugs |

Message

Thadeu Lima de Souza Cascardo Sept. 13, 2024, 6:06 p.m. UTC
  Some syzkaller reproducers have triggered cases where the devices would not
comply with the UVC specification and warnings would result.

These cases can be simply fixed by preventing the allocation of entities
with duplicate IDs or zero IDs.

v2:
Squash the two commits into one.
Version 1.1 of the spec already mentioned the restrictions on section 3.7.2.
Renamed uvc_alloc_entity to uvc_alloc_new_entity.
Print error message.
Return PTR_ERR values.
Fix checkpatch warnings.

I used section 3.7.2 excerpt from the spec as it is not specific to Output
units/terminals and it also mentions that zero IDs are undefined.

v3:
Check for 0 ID before checking for duplicate ID as originally.
Fix checkpatch format.

Thadeu Lima de Souza Cascardo (1):
  media: uvcvideo: require entities to have a non-zero unique ID

 drivers/media/usb/uvc/uvc_driver.c | 70 ++++++++++++++++++------------
 1 file changed, 43 insertions(+), 27 deletions(-)