Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1682724

Re: [git pull] vfs.git pile 11

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject Re: [git pull] vfs.git pile 11
Date 2017-07-06 23:30 +0200
Message-ID <u0mvw-2IA-15@gated-at.bofh.it> (permalink)
References <u0b73-2ls-17@gated-at.bofh.it> <u0kWK-1y4-27@gated-at.bofh.it> <u0lpM-22E-3@gated-at.bofh.it> <u0lzr-25U-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jul 06, 2017 at 09:29:27PM +0100, Al Viro wrote:
> On Thu, Jul 06, 2017 at 09:18:26PM +0100, Al Viro wrote:
> > On Thu, Jul 06, 2017 at 12:45:36PM -0700, Kees Cook wrote:
> > > 
> > > +   if (unlikely(!check_copy_size(addr, bytes, false)))
> > > +       return false;
> > > +   else
> > > +       return _copy_from_iter_full(addr, bytes, i);
> > > 
> > > Can these be rewritten to avoid the double-negative?
> > 
> > Matter of taste - I've no strong preferences here.
> > 
> > > +   might_fault();
> > > 
> > > Should this be might_sleep()? Just from reading the patch it looked
> > > like you were adding might_sleep()s in the other cases.
> > 
> > D'oh - shouldn't have written that pull request message before the
> > first cup of coffee...  might_sleep() it is, of course.
> 
> Hrm...  Said that, might_sleep() doesn't check one thing might_fault()
> does - the
> #if defined(CONFIG_DEBUG_ATOMIC_SLEEP)
>         if (current->mm)
>                 might_lock_read(&current->mm->mmap_sem);
> #endif
> thing.  Let me think a bit...

FWIW,
	* with iovec-backed, any of those primitives under pagefault_disable()
is seriously wrong.  To the point where we probably want to complain when
called that way.  That, of course, needs to be checked at the outermost level -
the primitives might do pagefault_disable() internally; that's fine.  Outside
caller doing that under pagefault_disable() isn't.
	* uaccess_kernel() (== set_fs(KERNEL_DS)) has nothing to do with it.
If anything, we should not do copyin/copyout on iovec-backed ones with that
present.
	* telling lockdep that we might end up grabbing ->mm->mmap_sem, OTOH,
is the right thing to do.  In addition to might_sleep().

Linus, could you hold that one back until tomorrow?  I want to tweak the
last commit in there a bit, but I want to give it a local beating first...

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[git pull] vfs.git pile 11 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 11:20 +0200
  Re: [git pull] vfs.git pile 11 Kees Cook <keescook@chromium.org> - 2017-07-06 21:50 +0200
    Re: [git pull] vfs.git pile 11 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 22:20 +0200
      Re: [git pull] vfs.git pile 11 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 22:30 +0200
        Re: [git pull] vfs.git pile 11 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 23:30 +0200
          Re: [git pull] vfs.git pile 11 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-07 07:10 +0200

csiph-web