1. 25 10月, 2016 1 次提交
  2. 20 10月, 2016 6 次提交
    • A
      fs/proc: Stop trying to report thread stacks · b18cb64e
      Andy Lutomirski 提交于
      This reverts more of:
      
        b7643757 ("procfs: mark thread stack correctly in proc/<pid>/maps")
      
      ... which was partially reverted by:
      
        65376df5 ("proc: revert /proc/<pid>/maps [stack:TID] annotation")
      
      Originally, /proc/PID/task/TID/maps was the same as /proc/TID/maps.
      
      In current kernels, /proc/PID/maps (or /proc/TID/maps even for
      threads) shows "[stack]" for VMAs in the mm's stack address range.
      
      In contrast, /proc/PID/task/TID/maps uses KSTK_ESP to guess the
      target thread's stack's VMA.  This is racy, probably returns garbage
      and, on arches with CONFIG_TASK_INFO_IN_THREAD=y, is also crash-prone:
      KSTK_ESP is not safe to use on tasks that aren't known to be running
      ordinary process-context kernel code.
      
      This patch removes the difference and just shows "[stack]" for VMAs
      in the mm's stack range.  This is IMO much more sensible -- the
      actual "stack" address really is treated specially by the VM code,
      and the current thread stack isn't even well-defined for programs
      that frequently switch stacks on their own.
      Reported-by: NJann Horn <jann@thejh.net>
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Linux API <linux-api@vger.kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tycho Andersen <tycho.andersen@canonical.com>
      Link: http://lkml.kernel.org/r/3e678474ec14e0a0ec34c611016753eea2e1b8ba.1475257877.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      b18cb64e
    • A
      fs/proc: Stop reporting eip and esp in /proc/PID/stat · 0a1eb2d4
      Andy Lutomirski 提交于
      Reporting these fields on a non-current task is dangerous.  If the
      task is in any state other than normal kernel code, they may contain
      garbage or even kernel addresses on some architectures.  (x86_64
      used to do this.  I bet lots of architectures still do.)  With
      CONFIG_THREAD_INFO_IN_TASK=y, it can OOPS, too.
      
      As far as I know, there are no use programs that make any material
      use of these fields, so just get rid of them.
      Reported-by: NJann Horn <jann@thejh.net>
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Linux API <linux-api@vger.kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Cc: Tycho Andersen <tycho.andersen@canonical.com>
      Link: http://lkml.kernel.org/r/a5fed4c3f4e33ed25d4bb03567e329bc5a712bcc.1475257877.git.luto@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      0a1eb2d4
    • R
      ubifs: Abort readdir upon error · c83ed4c9
      Richard Weinberger 提交于
      If UBIFS is facing an error while walking a directory, it reports this
      error and ubifs_readdir() returns the error code. But the VFS readdir
      logic does not make the getdents system call fail in all cases. When the
      readdir cursor indicates that more entries are present, the system call
      will just return and the libc wrapper will try again since it also
      knows that more entries are present.
      This causes the libc wrapper to busy loop for ever when a directory is
      corrupted on UBIFS.
      A common approach do deal with corrupted directory entries is
      skipping them by setting the cursor to the next entry. On UBIFS this
      approach is not possible since we cannot compute the next directory
      entry cursor position without reading the current entry. So all we can
      do is setting the cursor to the "no more entries" position and make
      getdents exit.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      c83ed4c9
    • R
      ubifs: Fix xattr_names length in exit paths · 843741c5
      Richard Weinberger 提交于
      When the operation fails we also have to undo the changes
      we made to ->xattr_names. Otherwise listxattr() will report
      wrong lengths.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      843741c5
    • R
      ubifs: Rename ubifs_rename2 · 390975ac
      Richard Weinberger 提交于
      Since ->rename2 is gone, rename ubifs_rename2() to ubifs_rename().
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      390975ac
    • A
      nfs4: fix missing-braces warning · 83aa3e0f
      Arnd Bergmann 提交于
      A bugfix introduced a harmless warning for update_open_stateid:
      
      fs/nfs/nfs4proc.c:1548:2: error: missing braces around initializer [-Werror=missing-braces]
      
      Removing the zero in the initializer will do the right thing here
      and initialize the entire structure to zero.
      
      Fixes: 1393d961 ("NFSv4: Fix a race when updating an open_stateid")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      83aa3e0f
  3. 19 10月, 2016 2 次提交
  4. 18 10月, 2016 7 次提交
  5. 16 10月, 2016 1 次提交
  6. 15 10月, 2016 9 次提交
  7. 14 10月, 2016 13 次提交
  8. 13 10月, 2016 1 次提交
    • E
      fscrypto: make XTS tweak initialization endian-independent · fb445437
      Eric Biggers 提交于
      The XTS tweak (or IV) was initialized differently on little endian and
      big endian systems.  Because the ciphertext depends on the XTS tweak, it
      was not possible to use an encrypted filesystem created by a little
      endian system on a big endian system and vice versa, even if they shared
      the same PAGE_SIZE.  Fix this by always using little endian.
      
      This will break hypothetical big endian users of ext4 or f2fs
      encryption.  However, all users we are aware of are little endian, and
      it's believed that "real" big endian users are unlikely to exist yet.
      So this might as well be fixed now before it's too late.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      fb445437