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]
Date:   Thu, 12 Dec 2019 18:24:02 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     Jens Axboe <axboe@...nel.dk>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        y2038 Mailman List <y2038@...ts.linaro.org>,
        Tejun Heo <tj@...nel.org>, Jan Kara <jack@...e.cz>,
        Chaitanya Kulkarni <chaitanya.kulkarni@....com>,
        Dmitry Fomichev <dmitry.fomichev@....com>,
        Ajay Joshi <ajay.joshi@....com>,
        linux-block <linux-block@...r.kernel.org>
Subject: Re: [PATCH 21/24] compat_ioctl: block: move blkdev_compat_ioctl()
 into ioctl.c

On Thu, Dec 12, 2019 at 5:30 PM Christoph Hellwig <hch@...radead.org> wrote:
>
> > +#ifdef CONFIG_COMPAT
> > +static int compat_put_ushort(unsigned long arg, unsigned short val)
> > +{
> > +     return put_user(val, (unsigned short __user *)compat_ptr(arg));
> > +}
> > +
> > +static int compat_put_int(unsigned long arg, int val)
> > +{
> > +     return put_user(val, (compat_int_t __user *)compat_ptr(arg));
> > +}
> > +
> > +static int compat_put_uint(unsigned long arg, unsigned int val)
> > +{
> > +     return put_user(val, (compat_uint_t __user *)compat_ptr(arg));
> > +}
> > +
> > +static int compat_put_long(unsigned long arg, long val)
> > +{
> > +     return put_user(val, (compat_long_t __user *)compat_ptr(arg));
> > +}
> > +
> > +static int compat_put_ulong(unsigned long arg, compat_ulong_t val)
> > +{
> > +     return put_user(val, (compat_ulong_t __user *)compat_ptr(arg));
> > +}
> > +
> > +static int compat_put_u64(unsigned long arg, u64 val)
> > +{
> > +     return put_user(val, (compat_u64 __user *)compat_ptr(arg));
> > +}
> > +#endif
>
> Can we lift these helpers to compat.h instead?

Nothing else uses them, and it's usually more readable to just
use put_user directly.

Note that the next patch removes most of them anyway, but
we could have another cleanup that removes the
put_int()/put_long()/etc from block/ioctl.c altogether.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ