1. 23 2月, 2013 5 次提交
  2. 21 12月, 2012 12 次提交
  3. 30 11月, 2012 1 次提交
  4. 27 10月, 2012 1 次提交
    • L
      VFS: don't do protected {sym,hard}links by default · 561ec64a
      Linus Torvalds 提交于
      In commit 800179c9 ("This adds symlink and hardlink restrictions to
      the Linux VFS"), the new link protections were enabled by default, in
      the hope that no actual application would care, despite it being
      technically against legacy UNIX (and documented POSIX) behavior.
      
      However, it does turn out to break some applications.  It's rare, and
      it's unfortunate, but it's unacceptable to break existing systems, so
      we'll have to default to legacy behavior.
      
      In particular, it has broken the way AFD distributes files, see
      
        http://www.dwd.de/AFD/
      
      along with some legacy scripts.
      
      Distributions can end up setting this at initrd time or in system
      scripts: if you have security problems due to link attacks during your
      early boot sequence, you have bigger problems than some kernel sysctl
      setting. Do:
      
      	echo 1 > /proc/sys/fs/protected_symlinks
      	echo 1 > /proc/sys/fs/protected_hardlinks
      
      to re-enable the link protections.
      
      Alternatively, we may at some point introduce a kernel config option
      that sets these kinds of "more secure but not traditional" behavioural
      options automatically.
      Reported-by: NNick Bowler <nbowler@elliptictech.com>
      Reported-by: NHolger Kiehl <Holger.Kiehl@dwd.de>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: stable@kernel.org # v3.6
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      561ec64a
  5. 13 10月, 2012 6 次提交
  6. 12 10月, 2012 6 次提交
    • J
      vfs: unexport getname and putname symbols · 8e377d15
      Jeff Layton 提交于
      I see no callers in module code.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      8e377d15
    • J
      audit: overhaul __audit_inode_child to accomodate retrying · 4fa6b5ec
      Jeff Layton 提交于
      In order to accomodate retrying path-based syscalls, we need to add a
      new "type" argument to audit_inode_child. This will tell us whether
      we're looking for a child entry that represents a create or a delete.
      
      If we find a parent, don't automatically assume that we need to create a
      new entry. Instead, use the information we have to try to find an
      existing entry first. Update it if one is found and create a new one if
      not.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4fa6b5ec
    • J
      audit: set the name_len in audit_inode for parent lookups · bfcec708
      Jeff Layton 提交于
      Currently, this gets set mostly by happenstance when we call into
      audit_inode_child. While that might be a little more efficient, it seems
      wrong. If the syscall ends up failing before audit_inode_child ever gets
      called, then you'll have an audit_names record that shows the full path
      but has the parent inode info attached.
      
      Fix this by passing in a parent flag when we call audit_inode that gets
      set to the value of LOOKUP_PARENT. We can then fix up the pathname for
      the audit entry correctly from the get-go.
      
      While we're at it, clean up the no-op macro for audit_inode in the
      !CONFIG_AUDITSYSCALL case.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      bfcec708
    • J
      audit: reverse arguments to audit_inode_child · c43a25ab
      Jeff Layton 提交于
      Most of the callers get called with an inode and dentry in the reverse
      order. The compiler then has to reshuffle the arg registers and/or
      stack in order to pass them on to audit_inode_child.
      
      Reverse those arguments for a micro-optimization.
      Reported-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c43a25ab
    • J
      audit: remove unnecessary NULL ptr checks from do_path_lookup · f78570dd
      Jeff Layton 提交于
      As best I can tell, whenever retval == 0, nd->path.dentry and nd->inode
      are also non-NULL. Eliminate those checks and the superfluous
      audit_context check.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f78570dd
    • A
      vfs: bogus warnings in fs/namei.c · 98f6ef64
      Arnd Bergmann 提交于
      The follow_link() function always initializes its *p argument,
      or returns an error, but when building with 'gcc -s', the compiler
      gets confused by the __always_inline attribute to the function
      and can no longer detect where the cookie was initialized.
      
      The solution is to always initialize the pointer from follow_link,
      even in the error path. When building with -O2, this has zero impact
      on generated code and adds a single instruction in the error path
      for a -Os build on ARM.
      
      Without this patch, building with gcc-4.6 through gcc-4.8 and
      CONFIG_CC_OPTIMIZE_FOR_SIZE results in:
      
      fs/namei.c: In function 'link_path_walk':
      fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized]
      fs/namei.c:1544:9: note: 'cookie' was declared here
      fs/namei.c: In function 'path_lookupat':
      fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized]
      fs/namei.c:1934:10: note: 'cookie' was declared here
      fs/namei.c: In function 'path_openat':
      fs/namei.c:649:24: warning: 'cookie' may be used uninitialized in this function [-Wuninitialized]
      fs/namei.c:2899:9: note: 'cookie' was declared here
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      98f6ef64
  7. 10 10月, 2012 1 次提交
  8. 27 9月, 2012 2 次提交
  9. 22 8月, 2012 1 次提交
  10. 17 8月, 2012 1 次提交
  11. 15 8月, 2012 2 次提交
  12. 04 8月, 2012 1 次提交
  13. 31 7月, 2012 1 次提交
    • J
      fs: Push mnt_want_write() outside of i_mutex · c30dabfe
      Jan Kara 提交于
      Currently, mnt_want_write() is sometimes called with i_mutex held and sometimes
      without it. This isn't really a problem because mnt_want_write() is a
      non-blocking operation (essentially has a trylock semantics) but when the
      function starts to handle also frozen filesystems, it will get a full lock
      semantics and thus proper lock ordering has to be established. So move
      all mnt_want_write() calls outside of i_mutex.
      
      One non-trivial case needing conversion is kern_path_create() /
      user_path_create() which didn't include mnt_want_write() but now needs to
      because it acquires i_mutex.  Because there are virtual file systems which
      don't bother with freeze / remount-ro protection we actually provide both
      versions of the function - one which calls mnt_want_write() and one which does
      not.
      
      [AV: scratch the previous, mnt_want_write() has been moved to kern_path_create()
      by now]
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c30dabfe