1. 12 4月, 2015 2 次提交
  2. 23 2月, 2015 1 次提交
  3. 07 1月, 2015 1 次提交
    • P
      rcu: Make SRCU optional by using CONFIG_SRCU · 83fe27ea
      Pranith Kumar 提交于
      SRCU is not necessary to be compiled by default in all cases. For tinification
      efforts not compiling SRCU unless necessary is desirable.
      
      The current patch tries to make compiling SRCU optional by introducing a new
      Kconfig option CONFIG_SRCU which is selected when any of the components making
      use of SRCU are selected.
      
      If we do not select CONFIG_SRCU, srcu.o will not be compiled at all.
      
         text    data     bss     dec     hex filename
         2007       0       0    2007     7d7 kernel/rcu/srcu.o
      
      Size of arch/powerpc/boot/zImage changes from
      
         text    data     bss     dec     hex filename
       831552   64180   23944  919676   e087c arch/powerpc/boot/zImage : before
       829504   64180   23952  917636   e0084 arch/powerpc/boot/zImage : after
      
      so the savings are about ~2000 bytes.
      Signed-off-by: NPranith Kumar <bobby.prani@gmail.com>
      CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      CC: Josh Triplett <josh@joshtriplett.org>
      CC: Lai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      [ paulmck: resolve conflict due to removal of arch/ia64/kvm/Kconfig. ]
      83fe27ea
  4. 27 8月, 2014 1 次提交
  5. 12 6月, 2014 1 次提交
  6. 02 4月, 2014 1 次提交
  7. 30 4月, 2013 1 次提交
  8. 18 3月, 2013 2 次提交
  9. 23 2月, 2013 1 次提交
  10. 12 10月, 2012 1 次提交
  11. 09 10月, 2012 1 次提交
  12. 21 9月, 2012 2 次提交
  13. 15 5月, 2012 1 次提交
  14. 10 4月, 2012 1 次提交
  15. 24 3月, 2012 1 次提交
  16. 20 3月, 2012 2 次提交
  17. 15 3月, 2012 1 次提交
  18. 01 3月, 2012 1 次提交
    • T
      TOMOYO: Fix mount flags checking order. · df91e494
      Tetsuo Handa 提交于
      Userspace can pass in arbitrary combinations of MS_* flags to mount().
      
      If both MS_BIND and one of MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE are
      passed, device name which should be checked for MS_BIND was not checked because
      MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE had higher priority than MS_BIND.
      
      If both one of MS_BIND/MS_MOVE and MS_REMOUNT are passed, device name which
      should not be checked for MS_REMOUNT was checked because MS_BIND/MS_MOVE had
      higher priority than MS_REMOUNT.
      
      Fix these bugs by changing priority to MS_REMOUNT -> MS_BIND ->
      MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE -> MS_MOVE as with do_mount() does.
      
      Also, unconditionally return -EINVAL if more than one of
      MS_SHARED/MS_PRIVATE/MS_SLAVE/MS_UNBINDABLE is passed so that TOMOYO will not
      generate inaccurate audit logs, for commit 7a2e8a8f "VFS: Sanity check mount
      flags passed to change_mnt_propagation()" clarified that these flags must be
      exclusively passed.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NJames Morris <james.l.morris@oracle.com>
      df91e494
  19. 18 1月, 2012 1 次提交
  20. 07 1月, 2012 1 次提交
  21. 04 1月, 2012 7 次提交
  22. 12 12月, 2011 2 次提交
  23. 09 12月, 2011 1 次提交
  24. 07 12月, 2011 1 次提交
    • A
      fix apparmor dereferencing potentially freed dentry, sanitize __d_path() API · 02125a82
      Al Viro 提交于
      __d_path() API is asking for trouble and in case of apparmor d_namespace_path()
      getting just that.  The root cause is that when __d_path() misses the root
      it had been told to look for, it stores the location of the most remote ancestor
      in *root.  Without grabbing references.  Sure, at the moment of call it had
      been pinned down by what we have in *path.  And if we raced with umount -l, we
      could have very well stopped at vfsmount/dentry that got freed as soon as
      prepend_path() dropped vfsmount_lock.
      
      It is safe to compare these pointers with pre-existing (and known to be still
      alive) vfsmount and dentry, as long as all we are asking is "is it the same
      address?".  Dereferencing is not safe and apparmor ended up stepping into
      that.  d_namespace_path() really wants to examine the place where we stopped,
      even if it's not connected to our namespace.  As the result, it looked
      at ->d_sb->s_magic of a dentry that might've been already freed by that point.
      All other callers had been careful enough to avoid that, but it's really
      a bad interface - it invites that kind of trouble.
      
      The fix is fairly straightforward, even though it's bigger than I'd like:
      	* prepend_path() root argument becomes const.
      	* __d_path() is never called with NULL/NULL root.  It was a kludge
      to start with.  Instead, we have an explicit function - d_absolute_root().
      Same as __d_path(), except that it doesn't get root passed and stops where
      it stops.  apparmor and tomoyo are using it.
      	* __d_path() returns NULL on path outside of root.  The main
      caller is show_mountinfo() and that's precisely what we pass root for - to
      skip those outside chroot jail.  Those who don't want that can (and do)
      use d_path().
      	* __d_path() root argument becomes const.  Everyone agrees, I hope.
      	* apparmor does *NOT* try to use __d_path() or any of its variants
      when it sees that path->mnt is an internal vfsmount.  In that case it's
      definitely not mounted anywhere and dentry_path() is exactly what we want
      there.  Handling of sysctl()-triggered weirdness is moved to that place.
      	* if apparmor is asked to do pathname relative to chroot jail
      and __d_path() tells it we it's not in that jail, the sucker just calls
      d_absolute_path() instead.  That's the other remaining caller of __d_path(),
      BTW.
              * seq_path_root() does _NOT_ return -ENAMETOOLONG (it's stupid anyway -
      the normal seq_file logics will take care of growing the buffer and redoing
      the call of ->show() just fine).  However, if it gets path not reachable
      from root, it returns SEQ_SKIP.  The only caller adjusted (i.e. stopped
      ignoring the return value as it used to do).
      Reviewed-by: NJohn Johansen <john.johansen@canonical.com>
      ACKed-by: NJohn Johansen <john.johansen@canonical.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: stable@vger.kernel.org
      02125a82
  25. 29 10月, 2011 1 次提交
  26. 23 10月, 2011 1 次提交
    • T
      TOMOYO: Fix incomplete read after seek. · e0b057b4
      Tetsuo Handa 提交于
      Commit f23571e8 "TOMOYO: Copy directly to userspace buffer." introduced
      tomoyo_flush() that flushes data to be read as soon as possible.
      tomoyo_select_domain() (which is called by write()) enqueues data which meant
      to be read by next read(), but previous read()'s read buffer's size was not
      cleared. As a result, since 2.6.36, sequence like
      
         char *cp = "select global-pid=1\n";
         read(fd, buf1, sizeof(buf1));
         write(fd, cp, strlen(cp));
         read(fd, buf2, sizeof(buf2));
      
      causes enqueued data to be flushed to buf1 rather than buf2.
      Fix this bug by clearing read buffer's size upon write() request.
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      e0b057b4
  27. 19 10月, 2011 1 次提交
  28. 12 10月, 2011 2 次提交