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  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]
Date:   Tue, 5 Oct 2021 18:57:20 +0900
From:   Tomasz Figa <tfiga@...omium.org>
To:     Sergey Senozhatsky <senozhatsky@...omium.org>
Cc:     Hans Verkuil <hverkuil-cisco@...all.nl>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Ricardo Ribalda <ribalda@...omium.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: videobuf2: always set buffer vb2 pointer

On Tue, Sep 28, 2021 at 12:46 PM Sergey Senozhatsky
<senozhatsky@...omium.org> wrote:
>
> We need to always link allocated vb2_dc_buf back to vb2_buffer because
> we dereference vb2 in prepare() and finish() callbacks.
>
> Signed-off-by: Sergey Senozhatsky <senozhatsky@...omium.org>
> ---
>  drivers/media/common/videobuf2/videobuf2-dma-contig.c | 3 +++
>  1 file changed, 3 insertions(+)
>

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

Best regards,
Tomasz

> diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
> index b052a4e36961..38767791955d 100644
> --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
> +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
> @@ -600,6 +600,7 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev,
>
>         buf->dev = dev;
>         buf->dma_dir = vb->vb2_queue->dma_dir;
> +       buf->vb = vb;
>
>         offset = lower_32_bits(offset_in_page(vaddr));
>         vec = vb2_create_framevec(vaddr, size);
> @@ -788,6 +789,8 @@ static void *vb2_dc_attach_dmabuf(struct vb2_buffer *vb, struct device *dev,
>                 return ERR_PTR(-ENOMEM);
>
>         buf->dev = dev;
> +       buf->vb = vb;
> +
>         /* create attachment for the dmabuf with the user device */
>         dba = dma_buf_attach(dbuf, buf->dev);
>         if (IS_ERR(dba)) {
> --
> 2.33.0.685.g46640cef36-goog
>

Powered by blists - more mailing lists