mbox series

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

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

Message

Thadeu Lima de Souza Cascardo Sept. 12, 2024, 6:51 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.

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

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