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: <CAK8P3a3kiyytayaSs2LB=deK0OMs42Ayn4VErhjL6eM3FTGtpw@mail.gmail.com>
Date:   Sun, 18 Aug 2019 21:31:31 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Andreas Gruenbacher <agruenba@...hat.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Bob Peterson <rpeterso@...hat.com>,
        Steve Whitehouse <swhiteho@...hat.com>,
        Jan Kara <jack@...e.cz>, NeilBrown <neilb@...e.com>,
        "Darrick J. Wong" <darrick.wong@...cle.com>,
        cluster-devel <cluster-devel@...hat.com>
Subject: Re: [PATCH v5 03/18] gfs2: add compat_ioctl support

On Fri, Aug 16, 2019 at 7:32 PM Andreas Gruenbacher <agruenba@...hat.com> wrote:
>
> On Wed, Aug 14, 2019 at 10:45 PM Arnd Bergmann <arnd@...db.de> wrote:
> > +       /* These are just misnamed, they actually get/put from/to user an int */
> > +       switch(cmd) {
> > +       case FS_IOC32_GETFLAGS:
> > +               cmd = FS_IOC_GETFLAGS;
> > +               break;
> > +       case FS_IOC32_SETFLAGS:
> > +               cmd = FS_IOC_SETFLAGS;
> > +               break;
>
> I'd like the code to be more explicit here:
>
>         case FITRIM:
>         case FS_IOC_GETFSLABEL:
>               break;
>         default:
>               return -ENOIOCTLCMD;

I've looked at it again: if we do this, the function actually becomes
longer than
the native gfs2_ioctl(). Should we just make a full copy then?

static long gfs2_compat_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{
        switch(cmd) {
        case FS_IOC32_GETFLAGS:
                return gfs2_get_flags(filp, (u32 __user *)arg);
        case FS_IOC32_SETFLAGS:
                return gfs2_set_flags(filp, (u32 __user *)arg);
        case FITRIM:
                return gfs2_fitrim(filp, (void __user *)arg);
        case FS_IOC_GETFSLABEL:
                return gfs2_getlabel(filp, (char __user *)arg);
        }

        return -ENOTTY;
}

> Should we feed this through the gfs2 tree?

A later patch that removes the FITRIM handling from fs/compat_ioctl.c
depends on it, so I'd like to keep everything together.

         Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ