Skip to content
Snippets Groups Projects
  1. Mar 23, 2016
  2. Mar 22, 2016
    • Paolo Bonzini's avatar
      eventfd: document lockless access in eventfd_poll · a484c3dd
      Paolo Bonzini authored
      
      Since commit e22553e2 ("eventfd: don't take the spinlock in
      eventfd_poll", 2015-02-17), eventfd is reading ctx->count outside
      ctx->wqh.lock.
      
      However, things aren't as simple as the read barrier in eventfd_poll
      would suggest.  In fact, the read barrier, besides lacking a comment, is
      not paired in any obvious manner with another read barrier, and it is
      pointless because it is sitting between a write (deep in poll_wait) and
      the read of ctx->count.  The read barrier is acting just as a compiler
      barrier, for which we can use READ_ONCE instead.  This is what the code
      change in this patch does.
      
      The documentation change is just as important, however.  The question,
      posed by Andrea Arcangeli, is then why the thing is safe on
      architectures where spin_unlock does not imply a store-load memory
      barrier.  The answer is that it's safe because writes of ctx->count use
      the same lock as poll_wait, and hence an acquire barrier implicit in
      poll_wait provides the necessary synchronization between eventfd_poll
      and callers of wake_up_locked_poll.  This is sort of mentioned in the
      commit message with respect to eventfd_ctx_read ("eventfd_read is
      similar, it will do a single decrement with the lock held") but it
      applies to all other callers too.  It's tricky enough that it should be
      documented in the code.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Cc: Chris Mason <clm@fb.com>
      Cc: Davide Libenzi <davidel@xmailserver.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a484c3dd
    • Jann Horn's avatar
      fs/coredump: prevent fsuid=0 dumps into user-controlled directories · 378c6520
      Jann Horn authored
      
      This commit fixes the following security hole affecting systems where
      all of the following conditions are fulfilled:
      
       - The fs.suid_dumpable sysctl is set to 2.
       - The kernel.core_pattern sysctl's value starts with "/". (Systems
         where kernel.core_pattern starts with "|/" are not affected.)
       - Unprivileged user namespace creation is permitted. (This is
         true on Linux >=3.8, but some distributions disallow it by
         default using a distro patch.)
      
      Under these conditions, if a program executes under secure exec rules,
      causing it to run with the SUID_DUMP_ROOT flag, then unshares its user
      namespace, changes its root directory and crashes, the coredump will be
      written using fsuid=0 and a path derived from kernel.core_pattern - but
      this path is interpreted relative to the root directory of the process,
      allowing the attacker to control where a coredump will be written with
      root privileges.
      
      To fix the security issue, always interpret core_pattern for dumps that
      are written under SUID_DUMP_ROOT relative to the root directory of init.
      
      Signed-off-by: default avatarJann Horn <jann@thejh.net>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      378c6520
    • Maciej S. Szmigiero's avatar
      fat: add config option to set UTF-8 mount option by default · 38739380
      Maciej S. Szmigiero authored
      
      FAT has long supported its own default file name encoding config
      setting, separate from CONFIG_NLS_DEFAULT.
      
      However, if UTF-8 encoded file names are desired FAT character set
      should not be set to utf8 since this would make file names case
      sensitive even if case insensitive matching is requested.  Instead,
      "utf8" mount options should be provided to enable UTF-8 file names in
      FAT file system.
      
      Unfortunately, there was no possibility to set the default value of this
      option so on UTF-8 system "utf8" mount option had to be added manually
      to most FAT mounts.
      
      This patch adds config option to set such default value.
      
      Signed-off-by: default avatarMaciej S. Szmigiero <mail@maciej.szmigiero.name>
      Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      38739380
    • Andy Lutomirski's avatar
      ext4: in ext4_dir_llseek, check syscall bitness directly · 121cef8f
      Andy Lutomirski authored
      
      ext4 treats directory offsets differently for 32-bit and 64-bit callers.
      Check the caller type using in_compat_syscall, not is_compat_task.  This
      changes behavior on SPARC slightly.
      
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      121cef8f
    • Gang He's avatar
      ocfs2: check/fix inode block for online file check · d56a8f32
      Gang He authored
      
      Implement online check or fix inode block during reading a inode block
      to memory.
      
      Signed-off-by: default avatarGang He <ghe@suse.com>
      Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Joseph Qi <joseph.qi@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d56a8f32
    • Gang He's avatar
      ocfs2: create/remove sysfile for online file check · a849d468
      Gang He authored
      
      Create online file check sysfile when ocfs2 mount, remove the related
      sysfile when ocfs2 umount.
      
      Signed-off-by: default avatarGang He <ghe@suse.com>
      Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Joseph Qi <joseph.qi@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a849d468
    • Gang He's avatar
      ocfs2: sysfile interfaces for online file check · a860f6eb
      Gang He authored
      
      Implement online file check sysfile interfaces, e.g. how to create the
      related sysfile according to device name, how to display/handle file
      check request from the sysfile.
      
      Signed-off-by: default avatarGang He <ghe@suse.com>
      Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Joseph Qi <joseph.qi@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a860f6eb
    • Gang He's avatar
      ocfs2: export ocfs2_kset for online file check · 9dde5e4f
      Gang He authored
      
      When there are errors in the ocfs2 filesystem, they are usually
      accompanied by the inode number which caused the error.  This inode
      number would be the input to fixing the file.  One of these options
      could be considered:
      
      A file in the sys filesytem which would accept inode numbers.  This
      could be used to communication back what has to be fixed or is fixed.
      You could write:
      
        $# echo "<inode>" > /sys/fs/ocfs2/devname/filecheck/check
      
      or
      
        $# echo "<inode>" > /sys/fs/ocfs2/devname/filecheck/fix
      
      Compare with second version, I re-design filecheck sysfs interfaces,
      there are three sysfs files (check, fix and set) under filecheck
      directory (see above), sysfs will accept only one argument <inode>.
      Second, I adjust some code in ocfs2_filecheck_repair_inode_block()
      function according to upstream feedback, we cannot just add VALID_FL
      flag back as a inode block fix, then we will not fix this field
      corruption currently until having a complete solution.  Compare with
      first version, I use strncasecmp instead of double strncmp functions.
      Second, update the source file contribution vendor.
      
      This patch (of 4):
      
      Export ocfs2_kset object from ocfs2_stackglue kernel module, then online
      file check code will create the related sysfiles under ocfs2_kset
      object.  We're exporting this because it's built in ocfs2_stackglue.ko.
      
      Signed-off-by: default avatarGang He <ghe@suse.com>
      Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Joseph Qi <joseph.qi@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9dde5e4f
    • J. Bruce Fields's avatar
      nfsd: better layoutupdate bounds-checking · 4b15da44
      J. Bruce Fields authored
      
      You could add any multiple of 2^32/PNFS_SCSI_RANGE_SIZE to nr_iomaps and
      still pass this check.  You'd probably still fail the following kcalloc,
      but best to be paranoid since this is from-the-wire data.
      
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      4b15da44
  3. Mar 21, 2016
  4. Mar 20, 2016
    • Andreas Gruenbacher's avatar
      ubifs: Remove unused header · c27cb972
      Andreas Gruenbacher authored
      
      UBIFS does not support POSIX ACLs, so there is no need for including any
      POSIX ACL hesders.
      
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      c27cb972
    • Joe Perches's avatar
      ubifs: Add logging functions for ubifs_msg, ubifs_err and ubifs_warn · 3e7f2c51
      Joe Perches authored
      
      The existing logging macros are fairly large and converting the
      macros to functions make the object code smaller.
      
      Use %pV and __builtin_return_address(0) as appropriate.
      
      $ size fs/ubifs/built-in.o*
         text	   data	    bss	    dec	    hex	filename
       575831	 309688	 161312	1046831	  ff92f	fs/ubifs/built-in.o.allyesconfig.new
       622457	 312872	 161120	1096449	 10bb01	fs/ubifs/built-in.o.allyesconfig.old
       223785	    640	    644	 225069	  36f2d	fs/ubifs/built-in.o.defconfig.new
       251873	    640	    644	 253157	  3dce5	fs/ubifs/built-in.o.defconfig.old
      
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      3e7f2c51
    • Tejun Heo's avatar
      writeback, cgroup: fix use of the wrong bdi_writeback which mismatches the inode · aaf25593
      Tejun Heo authored
      
      When cgroup writeback is in use, there can be multiple wb's
      (bdi_writeback's) per bdi and an inode may switch among them
      dynamically.  In a couple places, the wrong wb was used leading to
      performing operations on the wrong list under the wrong lock
      corrupting the io lists.
      
      * writeback_single_inode() was taking @wb parameter and used it to
        remove the inode from io lists if it becomes clean after writeback.
        The callers of this function were always passing in the root wb
        regardless of the actual wb that the inode was associated with,
        which could also change while writeback is in progress.
      
        Fix it by dropping the @wb parameter and using
        inode_to_wb_and_lock_list() to determine and lock the associated wb.
      
      * After writeback_sb_inodes() writes out an inode, it re-locks @wb and
        inode to remove it from or move it to the right io list.  It assumes
        that the inode is still associated with @wb; however, the inode may
        have switched to another wb while writeback was in progress.
      
        Fix it by using inode_to_wb_and_lock_list() to determine and lock
        the associated wb after writeback is complete.  As the function
        requires the original @wb->list_lock locked for the next iteration,
        in the unlikely case where the inode has changed association, switch
        the locks.
      
      Kudos to Tahsin for pinpointing these subtle breakages.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Fixes: d10c8095 ("writeback: implement foreign cgroup inode bdi_writeback switching")
      Link: http://lkml.kernel.org/g/CAAeU0aMYeM_39Y2+PaRvyB1nqAPYZSNngJ1eBRmrxn7gKAt2Mg@mail.gmail.com
      
      
      Reported-and-diagnosed-by: default avatarTahsin Erdogan <tahsin@google.com>
      Tested-by: default avatarTahsin Erdogan <tahsin@google.com>
      Cc: stable@vger.kernel.org # v4.2+
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      aaf25593
    • Tejun Heo's avatar
      writeback, cgroup: fix premature wb_put() in locked_inode_to_wb_and_lock_list() · 614a4e37
      Tejun Heo authored
      
      locked_inode_to_wb_and_lock_list() wb_get()'s the wb associated with
      the target inode, unlocks inode, locks the wb's list_lock and verifies
      that the inode is still associated with the wb.  To prevent the wb
      going away between dropping inode lock and acquiring list_lock, the wb
      is pinned while inode lock is held.  The wb reference is put right
      after acquiring list_lock citing that the wb won't be dereferenced
      anymore.
      
      This isn't true.  If the inode is still associated with the wb, the
      inode has reference and it's safe to return the wb; however, if inode
      has been switched, the wb still needs to be unlocked which is a
      dereference and can lead to use-after-free if it it races with wb
      destruction.
      
      Fix it by putting the reference after releasing list_lock.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Fixes: 87e1d789 ("writeback: implement [locked_]inode_to_wb_and_lock_list()")
      Cc: stable@vger.kernel.org # v4.2+
      Tested-by: default avatarTahsin Erdogan <tahsin@google.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      614a4e37
  5. Mar 18, 2016
    • Rabin Vincent's avatar
      splice: handle zero nr_pages in splice_to_pipe() · d6785d91
      Rabin Vincent authored
      
      Running the following command:
      
       busybox cat /sys/kernel/debug/tracing/trace_pipe > /dev/null
      
      with any tracing enabled pretty very quickly leads to various NULL
      pointer dereferences and VM BUG_ON()s, such as these:
      
       BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
       IP: [<ffffffff8119df6c>] generic_pipe_buf_release+0xc/0x40
       Call Trace:
        [<ffffffff811c48a3>] splice_direct_to_actor+0x143/0x1e0
        [<ffffffff811c42e0>] ? generic_pipe_buf_nosteal+0x10/0x10
        [<ffffffff811c49cf>] do_splice_direct+0x8f/0xb0
        [<ffffffff81196869>] do_sendfile+0x199/0x380
        [<ffffffff81197600>] SyS_sendfile64+0x90/0xa0
        [<ffffffff8192cbee>] entry_SYSCALL_64_fastpath+0x12/0x6d
      
       page dumped because: VM_BUG_ON_PAGE(atomic_read(&page->_count) == 0)
       kernel BUG at include/linux/mm.h:367!
       invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
       RIP: [<ffffffff8119df9c>] generic_pipe_buf_release+0x3c/0x40
       Call Trace:
        [<ffffffff811c48a3>] splice_direct_to_actor+0x143/0x1e0
        [<ffffffff811c42e0>] ? generic_pipe_buf_nosteal+0x10/0x10
        [<ffffffff811c49cf>] do_splice_direct+0x8f/0xb0
        [<ffffffff81196869>] do_sendfile+0x199/0x380
        [<ffffffff81197600>] SyS_sendfile64+0x90/0xa0
        [<ffffffff8192cd1e>] tracesys_phase2+0x84/0x89
      
      (busybox's cat uses sendfile(2), unlike the coreutils version)
      
      This is because tracing_splice_read_pipe() can call splice_to_pipe()
      with spd->nr_pages == 0.  spd_pages underflows in splice_to_pipe() and
      we fill the page pointers and the other fields of the pipe_buffers with
      garbage.
      
      All other callers of splice_to_pipe() avoid calling it when nr_pages ==
      0, and we could make tracing_splice_read_pipe() do that too, but it
      seems reasonable to have splice_to_page() handle this condition
      gracefully.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarRabin Vincent <rabin@rab.in>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d6785d91
    • Christoph Hellwig's avatar
    • Christoph Hellwig's avatar
      nfsd: add SCSI layout support · f99d4fbd
      Christoph Hellwig authored
      
      This is a simple extension to the block layout driver to use SCSI
      persistent reservations for access control and fencing, as well as
      SCSI VPD pages for device identification.
      
      For this we need to pass the nfs4_client to the proc_getdeviceinfo method
      to generate the reservation key, and add a new fence_client method
      to allow for fence actions in the layout driver.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      f99d4fbd
    • Christoph Hellwig's avatar
      nfsd: move some blocklayout code · 368248ee
      Christoph Hellwig authored
      
      Trivial reorganization, no change in behavior.  Move some code around,
      pull some code out of block layoutcommit that will be useful for the
      scsi layout.
      
      [bfields@redhat.com: split off from "nfsd: add SCSI layout support"]
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      368248ee
    • Christoph Hellwig's avatar
      nfsd: add a new config option for the block layout driver · 81c39329
      Christoph Hellwig authored
      
      Split the config symbols into a generic pNFS one, which is invisible
      and gets selected by the layout drivers, and one for the block layout
      driver.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      81c39329
    • Christoph Hellwig's avatar
      nfs/blocklayout: add SCSI layout support · d9186c03
      Christoph Hellwig authored
      
      This is a trivial extension to the block layout driver to support the
      new SCSI layouts draft.  There are three changes:
      
       - device identifcation through the SCSI VPD page.  This allows us to
         directly use the udev generated persistent device names instead of
         requiring an expensive lookup by crawling every block device node
         in /dev and reading a signature for it.
       - use of SCSI persistent reservations to protect device access and
         allow for robust fencing.  On the client sides this just means
         registering and unregistering a server supplied key.
       - an optimized LAYOUTCOMMIT payload that doesn't send unessecary
         fields to the server.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      d9186c03
    • Jaegeuk Kim's avatar
      f2fs: submit node page write bios when really required · 12bb0a8f
      Jaegeuk Kim authored
      
      If many threads calls fsync with data writes, we don't need to flush every
      bios having node page writes.
      The f2fs_wait_on_page_writeback will flush its bios when the page is really
      needed.
      
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      12bb0a8f
    • Arnd Bergmann's avatar
      f2fs: add missing argument to f2fs_setxattr stub · fff4c55d
      Arnd Bergmann authored
      
      The f2fs_setxattr() prototype for CONFIG_F2FS_FS_XATTR=n has
      been wrong for a long time, since 8ae8f162 ("f2fs: support
      xattr security labels"), but there have never been any callers,
      so it did not matter.
      
      Now, the function gets called from f2fs_ioc_keyctl(), which
      causes a build failure:
      
      fs/f2fs/file.c: In function 'f2fs_ioc_keyctl':
      include/linux/stddef.h:7:14: error: passing argument 6 of 'f2fs_setxattr' makes integer from pointer without a cast [-Werror=int-conversion]
       #define NULL ((void *)0)
                    ^
      fs/f2fs/file.c:1599:27: note: in expansion of macro 'NULL'
           value, F2FS_KEY_SIZE, NULL, type);
                                 ^
      In file included from ../fs/f2fs/file.c:29:0:
      fs/f2fs/xattr.h:129:19: note: expected 'int' but argument is of type 'void *'
       static inline int f2fs_setxattr(struct inode *inode, int index,
                         ^
      fs/f2fs/file.c:1597:9: error: too many arguments to function 'f2fs_setxattr'
        return f2fs_setxattr(inode, F2FS_XATTR_INDEX_KEY,
               ^
      In file included from ../fs/f2fs/file.c:29:0:
      fs/f2fs/xattr.h:129:19: note: declared here
       static inline int f2fs_setxattr(struct inode *inode, int index,
      
      Thsi changes the prototype of the empty stub function to match
      that of the actual implementation. This will not make the key
      management work when F2FS_FS_XATTR is disabled, but it gets it
      to build at least.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      fff4c55d
    • Chao Yu's avatar
      f2fs: fix to avoid unneeded unlock_new_inode · d726732c
      Chao Yu authored
      
      During ->lookup, I_NEW state of inode was been cleared in f2fs_iget,
      so in error path, we don't need to clear it again.
      
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      d726732c
    • Chao Yu's avatar
      f2fs: clean up opened code with f2fs_update_dentry · 291bf80b
      Chao Yu authored
      
      Just clean up opened code with existing function, no logic change.
      
      Signed-off-by: default avatarChao Yu <chao@kernel.org>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      291bf80b
    • Jaegeuk Kim's avatar
      f2fs: declare static functions · 17a0ee55
      Jaegeuk Kim authored
      
      Just to avoid sparse warnings.
      
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      17a0ee55
    • Keith Mok's avatar
      f2fs: use cryptoapi crc32 functions · 43b6573b
      Keith Mok authored
      
      The crc function is done bit by bit.
      Optimize this by use cryptoapi
      crc32 function which is backed by h/w acceleration.
      
      Signed-off-by: default avatarKeith Mok <ek9852@gmail.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      43b6573b
    • Fan Li's avatar
      f2fs: modify the readahead method in ra_node_page() · 999270de
      Fan Li authored
      
      ra_node_page() is used to read ahead one node page. Comparing to regular
      read, it's faster because it doesn't wait for IO completion.
      But if it is called twice for reading the same block, and the IO request
      from the first call hasn't been completed before the second call, the second
      call will have to wait until the read is over.
      
      Here use the code in __do_page_cache_readahead() to solve this problem.
      It does nothing when someone else already puts the page in mapping. The
      status of page should be assured by whoever puts it there.
      This implement also prevents alteration of page reference count.
      
      Signed-off-by: default avatarFan li <fanofcode.li@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      999270de
    • Jaegeuk Kim's avatar
      f2fs crypto: sync ext4_lookup and ext4_file_open · 8074bb51
      Jaegeuk Kim authored
      
      This patch tries to catch up with lookup and open policies in ext4.
      
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      8074bb51
    • Jaegeuk Kim's avatar
      fs crypto: move per-file encryption from f2fs tree to fs/crypto · 0b81d077
      Jaegeuk Kim authored
      
      This patch adds the renamed functions moved from the f2fs crypto files.
      
      1. definitions for per-file encryption used by ext4 and f2fs.
      
      2. crypto.c for encrypt/decrypt functions
       a. IO preparation:
        - fscrypt_get_ctx / fscrypt_release_ctx
       b. before IOs:
        - fscrypt_encrypt_page
        - fscrypt_decrypt_page
        - fscrypt_zeroout_range
       c. after IOs:
        - fscrypt_decrypt_bio_pages
        - fscrypt_pullback_bio_page
        - fscrypt_restore_control_page
      
      3. policy.c supporting context management.
       a. For ioctls:
        - fscrypt_process_policy
        - fscrypt_get_policy
       b. For context permission
        - fscrypt_has_permitted_context
        - fscrypt_inherit_context
      
      4. keyinfo.c to handle permissions
        - fscrypt_get_encryption_info
        - fscrypt_free_encryption_info
      
      5. fname.c to support filename encryption
       a. general wrapper functions
        - fscrypt_fname_disk_to_usr
        - fscrypt_fname_usr_to_disk
        - fscrypt_setup_filename
        - fscrypt_free_filename
      
       b. specific filename handling functions
        - fscrypt_fname_alloc_buffer
        - fscrypt_fname_free_buffer
      
      6. Makefile and Kconfig
      
      Cc: Al Viro <viro@ftp.linux.org.uk>
      Signed-off-by: default avatarMichael Halcrow <mhalcrow@google.com>
      Signed-off-by: default avatarIldar Muslukhov <ildarm@google.com>
      Signed-off-by: default avatarUday Savagaonkar <savagaon@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      0b81d077
  6. Mar 17, 2016
    • Kees Cook's avatar
      lib: update single-char callers of strtobool() · 1404297e
      Kees Cook authored
      
      Some callers of strtobool() were passing a pointer to unterminated
      strings.  In preparation of adding multi-character processing to
      kstrtobool(), update the callers to not pass single-character pointers,
      and switch to using the new kstrtobool_from_user() helper where
      possible.
      
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Amitkumar Karwar <akarwar@marvell.com>
      Cc: Nishant Sarmukadam <nishants@marvell.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Steve French <sfrench@samba.org>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1404297e
    • Matthew Wilcox's avatar
      btrfs: use radix_tree_iter_retry() · c28f2420
      Matthew Wilcox authored
      
      Even though this is a 'can't happen' situation, use the new
      radix_tree_iter_retry() pattern to eliminate a goto.
      
      [akpm@linux-foundation.org: fix btrfs build]
      Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Chris Mason <clm@fb.com>
      Cc: Josef Bacik <jbacik@fb.com>
      Cc: David Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c28f2420
Loading