summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2024-12-03 21:20:10 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-17 10:05:36 +0100
commit438bda062b2c40ddd7df23b932e29ffe0a448cac (patch)
tree413ff1f1cf195431993e008fb2ef5978e4466d59 /mm
parente8a650dbc7326b50354358707373e70224e17599 (diff)
downloadlinux-438bda062b2c40ddd7df23b932e29ffe0a448cac.tar.gz
linux-438bda062b2c40ddd7df23b932e29ffe0a448cac.tar.bz2
linux-438bda062b2c40ddd7df23b932e29ffe0a448cac.zip
media: uvcvideo: Remove dangling pointers
commit 221cd51efe4565501a3dbf04cc011b537dcce7fb upstream. When an async control is written, we copy a pointer to the file handle that started the operation. That pointer will be used when the device is done. Which could be anytime in the future. If the user closes that file descriptor, its structure will be freed, and there will be one dangling pointer per pending async control, that the driver will try to use. Clean all the dangling pointers during release(). To avoid adding a performance penalty in the most common case (no async operation), a counter has been introduced with some logic to make sure that it is properly handled. Cc: stable@vger.kernel.org Fixes: e5225c820c05 ("media: uvcvideo: Send a control event when a Control Change interrupt arrives") Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20241203-uvc-fix-async-v6-3-26c867231118@chromium.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions