On Sun, Sep 1, 2019 at 10:28 PM Gerd Hoffmann wrote:
>
> On Fri, Aug 30, 2019 at 10:49:25AM -0700, David Riley wrote:
> > Hi Gerd,
> >
> > On Fri, Aug 30, 2019 at 4:16 AM Gerd Hoffmann wrote:
> > >
> > > Hi,
> > >
> > > > > > - kfree(vbuf->data_buf);
> > > > > > + kvfree(vbuf->data_buf)
On Fri, Aug 30, 2019 at 10:49:25AM -0700, David Riley wrote:
> Hi Gerd,
>
> On Fri, Aug 30, 2019 at 4:16 AM Gerd Hoffmann wrote:
> >
> > Hi,
> >
> > > > > - kfree(vbuf->data_buf);
> > > > > + kvfree(vbuf->data_buf);
> > > >
> > > > if (is_vmalloc_addr(vbuf->data_buf)) ...
> > > >
> > >
> > Completely different approach: use get_user_pages() and don't copy the
> > execbuffer at all.
> It would be really nice if execbuffer does not copy.
>
> The user space owns the buffer and may overwrite the contents
> immediately after the ioctl.
Oh, right. The exec ioctl doesn't block. So t
Hi Gerd,
On Fri, Aug 30, 2019 at 4:16 AM Gerd Hoffmann wrote:
>
> Hi,
>
> > > > - kfree(vbuf->data_buf);
> > > > + kvfree(vbuf->data_buf);
> > >
> > > if (is_vmalloc_addr(vbuf->data_buf)) ...
> > >
> > > needed here I gues?
> > >
> >
> > kvfree() handles vmalloc/kmalloc/kvmalloc interna
On Fri, Aug 30, 2019 at 4:16 AM Gerd Hoffmann wrote:
>
> Hi,
>
> > > > - kfree(vbuf->data_buf);
> > > > + kvfree(vbuf->data_buf);
> > >
> > > if (is_vmalloc_addr(vbuf->data_buf)) ...
> > >
> > > needed here I gues?
> > >
> >
> > kvfree() handles vmalloc/kmalloc/kvmalloc internally by doi
On Thu, Aug 29, 2019 at 2:24 PM David Riley wrote:
>
> Userspace requested command buffer allocations could be too large
> to make as a contiguous allocation. Use vmalloc if necessary to
> satisfy those allocations.
>
> Signed-off-by: David Riley
> ---
> drivers/gpu/drm/virtio/virtgpu_ioctl.c |
Hi,
> > > - kfree(vbuf->data_buf);
> > > + kvfree(vbuf->data_buf);
> >
> > if (is_vmalloc_addr(vbuf->data_buf)) ...
> >
> > needed here I gues?
> >
>
> kvfree() handles vmalloc/kmalloc/kvmalloc internally by doing that check.
Ok.
> - videobuf_vmalloc_to_sg in drivers/media/v4l2-core/v
On Thu, Aug 29, 2019 at 11:09 PM Gerd Hoffmann wrote:
> Hi,
>
> > {
> > if (vbuf->resp_size > MAX_INLINE_RESP_SIZE)
> > kfree(vbuf->resp_buf);
> > - kfree(vbuf->data_buf);
> > + kvfree(vbuf->data_buf);
>
> if (is_vmalloc_addr(vbuf->data_buf)) ...
>
> needed here I g
Hi,
> {
> if (vbuf->resp_size > MAX_INLINE_RESP_SIZE)
> kfree(vbuf->resp_buf);
> - kfree(vbuf->data_buf);
> + kvfree(vbuf->data_buf);
if (is_vmalloc_addr(vbuf->data_buf)) ...
needed here I gues?
> +/* Create sg_table from a vmalloc'd buffer. */
> +static struct sg
Userspace requested command buffer allocations could be too large
to make as a contiguous allocation. Use vmalloc if necessary to
satisfy those allocations.
Signed-off-by: David Riley
---
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 +-
drivers/gpu/drm/virtio/virtgpu_vq.c| 74 +++
10 matches
Mail list logo