mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
usb: gadget: uvc: configfs: Prevent format changes after linking header
[ Upstream commit cb2200f7af ]
While checks are in place to avoid attributes and children of a format
being manipulated after the format is linked into the streaming header,
the linked flag was never actually set, invalidating the protections.
Update the flag as appropriate in the header link calls.
Signed-off-by: Joel Pepper <joel.pepper@rwth-aachen.de>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
013cf51fac
commit
bfdb08934b
@@ -772,6 +772,7 @@ static int uvcg_streaming_header_allow_link(struct config_item *src,
|
||||
format_ptr->fmt = target_fmt;
|
||||
list_add_tail(&format_ptr->entry, &src_hdr->formats);
|
||||
++src_hdr->num_fmt;
|
||||
++target_fmt->linked;
|
||||
|
||||
out:
|
||||
mutex_unlock(&opts->lock);
|
||||
@@ -810,6 +811,8 @@ static int uvcg_streaming_header_drop_link(struct config_item *src,
|
||||
break;
|
||||
}
|
||||
|
||||
--target_fmt->linked;
|
||||
|
||||
out:
|
||||
mutex_unlock(&opts->lock);
|
||||
mutex_unlock(su_mutex);
|
||||
|
||||
Reference in New Issue
Block a user