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] [day] [month] [year] [list]
Date:   Wed, 23 Oct 2019 17:26:41 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Al Viro <viro@...iv.linux.org.uk>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        y2038 Mailman List <y2038@...ts.linaro.org>,
        Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Michael S . Tsirkin" <mst@...hat.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
        Jason Gunthorpe <jgg@...lanox.com>,
        Jiri Kosina <jkosina@...e.cz>,
        Stefan Hajnoczi <stefanha@...hat.com>,
        Cornelia Huck <cohuck@...hat.com>
Subject: Re: [PATCH v6 11/43] compat_ioctl: move drivers to compat_ptr_ioctl

On Wed, Oct 23, 2019 at 5:17 AM Al Viro <viro@...iv.linux.org.uk> wrote:
>
> On Tue, Oct 22, 2019 at 12:26:09PM +0200, Arnd Bergmann wrote:
> > On Tue, Oct 22, 2019 at 6:34 AM Al Viro <viro@...iv.linux.org.uk> wrote:
> > >
> > > On Wed, Oct 09, 2019 at 09:10:11PM +0200, Arnd Bergmann wrote:
> > > > Each of these drivers has a copy of the same trivial helper function to
> > > > convert the pointer argument and then call the native ioctl handler.
> > > >
> > > > We now have a generic implementation of that, so use it.
> > >
> > > I'd rather flipped your #7 (ceph_compat_ioctl() introduction) past
> > > that one...
> >
> > The idea was to be able to backport the ceph patch as a bugfix
> > to stable kernels without having to change it or backport
> > compat_ptr_ioctl() as well.
> >
> > If you still prefer it that way, I'd move to a simpler version of this
> > patch and drop the Cc:stable.
>
> What I'm going to do is to put the introduction of compat_ptr_ioctl()
> into a never-rebased branch; having e.g. ceph patch done on top of
> it should suffice - it can go into -stable just fine. Trivially
> backported all the way back, has no prereqs and is guaranteed to
> cause no conflicts, so if any -stable fodder ends up depending upon
> it, there will be no problem whatsoever.  IMO that commit should
> precede everything else in the queue...

Ok, fair enough. I've moved that one patch to the start of my git
branch now. See below for the updated patch. I also uploaded
the modified y2038 branch for linux-next.

> Another thing is that I'd fold #8 into #6 - it clearly belongs
> in there.

Done.

      Arnd

8<------
commit 18bd6caaef4021803dd0d031dc37c2d001d18a5b (HEAD)
Author: Arnd Bergmann <arnd@...db.de>
Date:   Tue Sep 11 20:47:23 2018 +0200

    ceph: fix compat_ioctl for ceph_dir_operations

    The ceph_ioctl function is used both for files and directories, but only
    the files support doing that in 32-bit compat mode.

    On the s390 architecture, there is also a problem with invalid 31-bit
    pointers that need to be passed through compat_ptr().

    Use the new compat_ptr_ioctl() to address both issues.

    Note: When backporting this patch to stable kernels, "compat_ioctl:
    add compat_ptr_ioctl()" is needed as well.

    Reviewed-by: "Yan, Zheng" <zyan@...hat.com>
    Cc: stable@...r.kernel.org
    Signed-off-by: Arnd Bergmann <arnd@...db.de>

diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 4ca0b8ff9a72..811f45badc10 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -1808,6 +1808,7 @@ const struct file_operations ceph_dir_fops = {
        .open = ceph_open,
        .release = ceph_release,
        .unlocked_ioctl = ceph_ioctl,
+       .compat_ioctl = compat_ptr_ioctl,
        .fsync = ceph_fsync,
        .lock = ceph_lock,
        .flock = ceph_flock,
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index d277f71abe0b..6092ccea50d2 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -2162,7 +2162,7 @@ const struct file_operations ceph_file_fops = {
        .splice_read = generic_file_splice_read,
        .splice_write = iter_file_splice_write,
        .unlocked_ioctl = ceph_ioctl,
-       .compat_ioctl   = ceph_ioctl,
+       .compat_ioctl = compat_ptr_ioctl,
        .fallocate      = ceph_fallocate,
        .copy_file_range = ceph_copy_file_range,
 };

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ