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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190424123107.GA32024@deco.navytux.spb.ru>
Date:   Wed, 24 Apr 2019 12:31:14 +0000
From:   Kirill Smelkov <kirr@...edi.com>
To:     Miklos Szeredi <miklos@...redi.hu>
Cc:     Miklos Szeredi <mszeredi@...hat.com>,
        Han-Wen Nienhuys <hanwen@...gle.com>,
        Jakob Unterwurzacher <jakobunt@...il.com>,
        Kirill Tkhai <ktkhai@...tuozzo.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        fuse-devel <fuse-devel@...ts.sourceforge.net>,
        stable <stable@...r.kernel.org>
Subject: Re: [RESEND4, PATCH 1/2] fuse: retrieve: cap requested size to negotiated max_write

On Wed, Apr 24, 2019 at 02:17:27PM +0200, Miklos Szeredi wrote:
> On Wed, Apr 24, 2019 at 1:56 PM Kirill Smelkov <kirr@...edi.com> wrote:
> 
> > I assume you are meaning this:
> >
> >         --- a/fs/fuse/dev.c
> >         +++ b/fs/fuse/dev.c
> >         @@ -1745,15 +1745,15 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
> >                 unsigned int offset;
> >                 size_t total_len = 0;
> >                 unsigned int num_pages;
> >
> >                 offset = outarg->offset & ~PAGE_MASK;
> >                 file_size = i_size_read(inode);
> >
> >         -       num = outarg->size;
> >         +       num = min(outarg->size, fc->max_write);
> >                 if (outarg->offset > file_size)
> >                         num = 0;
> >                 else if (outarg->offset + num > file_size)
> >                         num = file_size - outarg->offset;               <-- THIS
> >
> >                 num_pages = (num + offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
> >                 num_pages = min(num_pages, fc->max_pages);
> >
> > and then in this case (offset + num > file_size) num overwrite
> >
> >         num = file_size - offset
> >
> > can make num only smaller, right? And then the patch is not wrong because there
> > is no other num overwriting in this function except when num is being further
> > decremented in loop that prepares pages to retrieve.
> 
> You're right, of course.

Thanks. Does it mean that the patch is ok? Do I need to rework
something?


> > > Also the patch is whitespace damaged.
> >
> > I've tried to do the following in my mutt on "RESEND4, PATCH 1/2"
> > message:
> >
> >         |(cd ~/src/linux/linux && git am -)
> >
> > and the patch applied successfully. So could you please clarify what
> > "whitespace damaged" means?
> 
> Hmm, apparently this (and only this) message is "quoted-printable"
> encoded.  git-am seems to handle it fine, but my script doesn't.
> Anyway, I'll do it manually.

I see. Probably it is not "quoted-printable" as

	Content-Type: text/plain; charset=utf-8
	Content-Transfer-Encoding: 8bit

suggests and it is maybe due to UTF-8 characters (I used "ยท" several
times in patch description). Anyway if it helps you can pull the patch
from here

	https://lab.nexedi.com/kirr/linux.git	y/fuse-retrieve-cap-max_write
	
and then cherry-pick it (git cherry-pick fd482f96537a) to where needed.

Thanks again for feedback,

Kirill

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ