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: <9402424d-6e0c-b628-c6c2-8f87b5276a36@samsung.com>
Date:   Tue, 13 Nov 2018 11:27:03 +0100
From:   Marek Szyprowski <m.szyprowski@...sung.com>
To:     Myungho Jung <mhjungk@...il.com>, pawel@...iak.com,
        kyungmin.park@...sung.com, mchehab@...nel.org
Cc:     linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: videobuf2-core: Fix error handling when fileio
 is deallocated

Hi Myungho,

On 2018-11-12 01:49, Myungho Jung wrote:
> The mutex that is held from vb2_fop_read() can be unlocked while waiting
> for a buffer if the queue is streaming and blocking. Meanwhile, fileio
> can be released. So, it should return an error if the fileio address is
> changed.
>
> Signed-off-by: Myungho Jung <mhjungk@...il.com>
> Reported-by: syzbot+4180ff9ca6810b06c1e9@...kaller.appspotmail.com

Acked-by: Marek Szyprowski <m.szyprowski@...sung.com>

Thanks for analyzing the code and fixing this issue!

> ---
>  drivers/media/common/videobuf2/videobuf2-core.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
> index 975ff5669f72..bff94752eb27 100644
> --- a/drivers/media/common/videobuf2/videobuf2-core.c
> +++ b/drivers/media/common/videobuf2/videobuf2-core.c
> @@ -2564,6 +2564,10 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, char __user *data, size_
>  		dprintk(5, "vb2_dqbuf result: %d\n", ret);
>  		if (ret)
>  			return ret;
> +		if (fileio != q->fileio) {
> +			dprintk(3, "fileio deallocated\n");
> +			return -EFAULT;
> +		}
>  		fileio->dq_count += 1;
>  
>  		fileio->cur_index = index;

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ