lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAFQd5DR5z7xhXrnHc94FVY9Si9KWW2gYH+=Ov3yT1HMUpjhzg@mail.gmail.com>
Date: Tue, 20 Feb 2024 19:42:47 +0900
From: Tomasz Figa <tfiga@...omium.org>
To: Benjamin Gaignard <benjamin.gaignard@...labora.com>
Cc: mchehab@...nel.org, hverkuil-cisco@...all.nl, linux-media@...r.kernel.org, 
	linux-kernel@...r.kernel.org, kernel@...labora.com
Subject: Re: [PATCH] media: usbtv: Remove useless locks in usbtv_video_free()

On Tue, Feb 20, 2024 at 5:06 PM Benjamin Gaignard
<benjamin.gaignard@...labora.com> wrote:
>
> Remove locks calls in usbtv_video_free() because
> are useless and may led to a deadlock as reported here:
> https://syzkaller.appspot.com/x/bisect.txt?x=166dc872180000
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@...labora.com>
> Fixes: c838530d230b ("media: media videobuf2: Be more flexible on the number of queue stored buffers")
> ---
>  drivers/media/usb/usbtv/usbtv-video.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/media/usb/usbtv/usbtv-video.c b/drivers/media/usb/usbtv/usbtv-video.c
> index 62a583040cd4..96276358d116 100644
> --- a/drivers/media/usb/usbtv/usbtv-video.c
> +++ b/drivers/media/usb/usbtv/usbtv-video.c
> @@ -963,15 +963,9 @@ int usbtv_video_init(struct usbtv *usbtv)
>
>  void usbtv_video_free(struct usbtv *usbtv)
>  {
> -       mutex_lock(&usbtv->vb2q_lock);
> -       mutex_lock(&usbtv->v4l2_lock);
> -
>         usbtv_stop(usbtv);
>         vb2_video_unregister_device(&usbtv->vdev);
>         v4l2_device_disconnect(&usbtv->v4l2_dev);
>
> -       mutex_unlock(&usbtv->v4l2_lock);
> -       mutex_unlock(&usbtv->vb2q_lock);
> -
>         v4l2_device_put(&usbtv->v4l2_dev);
>  }
> --
> 2.40.1
>

>From looking at the code in related vb2 functions and how the uvc
driver handles the cleanup, these locks shouldn't be necessary indeed,
but it would be good if someone could test this.

Reviewed-by: Tomasz Figa <tfiga@...omium.org>

Best regards,
Tomasz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ