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: <CAO_48GEPKk64uepCqZEc=6XGiv4tZnPHv=RZdwzKPuUqOxjpow@mail.gmail.com>
Date:   Tue, 7 Apr 2020 18:56:25 +0530
From:   Sumit Semwal <sumit.semwal@...aro.org>
To:     Martin Liu <liumartin@...gle.com>, Daniel Vetter <daniel@...ll.ch>
Cc:     minchan@...nel.org, surenb@...gle.com, wvw@...gle.com,
        "open list:DMA BUFFER SHARING FRAMEWORK" 
        <linux-media@...r.kernel.org>,
        DRI mailing list <dri-devel@...ts.freedesktop.org>,
        Linaro MM SIG <linaro-mm-sig@...ts.linaro.org>,
        LKML <linux-kernel@...r.kernel.org>, jenhaochen@...gle.com
Subject: Re: [PATCH] dma-buf: support 32bit DMA_BUF_SET_NAME ioctl

Hello,

Daniel, your comments here, please?

On Mon, 24 Feb 2020 at 09:09, Martin Liu <liumartin@...gle.com> wrote:
>
> On Tue, Jan 14, 2020 at 09:41:01PM +0800, Martin Liu wrote:
>
> CC more MLs for winder review.
>
> > This commit adds SET_NAME ioctl coversion to
> > support 32 bit ioctl.
> >
> > Signed-off-by: Martin Liu <liumartin@...gle.com>
> > ---
> >  drivers/dma-buf/dma-buf.c | 22 +++++++++++++++++++++-
> >  1 file changed, 21 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
> > index ce41cd9b758a..a73048b34843 100644
> > --- a/drivers/dma-buf/dma-buf.c
> > +++ b/drivers/dma-buf/dma-buf.c
> > @@ -25,6 +25,7 @@
> >  #include <linux/mm.h>
> >  #include <linux/mount.h>
> >  #include <linux/pseudo_fs.h>
> > +#include <linux/compat.h>
> >
> >  #include <uapi/linux/dma-buf.h>
> >  #include <uapi/linux/magic.h>
> > @@ -409,13 +410,32 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file)
> >       dma_resv_unlock(dmabuf->resv);
> >  }
> >
> > +#ifdef CONFIG_COMPAT
> > +static long dma_buf_ioctl_compat(struct file *file, unsigned int cmd,
> > +                              unsigned long arg)
> > +{
> > +     switch (_IOC_NR(cmd)) {
> > +     case _IOC_NR(DMA_BUF_SET_NAME):
> > +             /* Fix up pointer size*/
> > +             if (_IOC_SIZE(cmd) == sizeof(compat_uptr_t)) {
> > +                     cmd &= ~IOCSIZE_MASK;
> > +                     cmd |= sizeof(void *) << IOCSIZE_SHIFT;
> > +             }
> > +             break;
> > +     }
> > +     return dma_buf_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
> > +}
> > +#endif
> > +
> >  static const struct file_operations dma_buf_fops = {
> >       .release        = dma_buf_release,
> >       .mmap           = dma_buf_mmap_internal,
> >       .llseek         = dma_buf_llseek,
> >       .poll           = dma_buf_poll,
> >       .unlocked_ioctl = dma_buf_ioctl,
> > -     .compat_ioctl   = compat_ptr_ioctl,
> > +#ifdef CONFIG_COMPAT
> > +     .compat_ioctl   = dma_buf_ioctl_compat,
> > +#endif
> >       .show_fdinfo    = dma_buf_show_fdinfo,
> >  };
> >
> > --
> > 2.25.0.rc1.283.g88dfdc4193-goog
> >



-- 
Thanks and regards,

Sumit Semwal
Linaro Consumer Group - Kernel Team Lead
Linaro.org │ Open source software for ARM SoCs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ