26 Jan, 2012

14 commits

  • Quoth Ben Myers:
    "Please pull in the following bugfix for xfs. We forgot to drop a lock on
    error in xfs_readlink. It hasn't been through -next yet, but there is no
    -next tree tomorrow. The fix is clear so I'm sending this request today."

    * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    xfs: Fix missing xfs_iunlock() on error recovery path in xfs_readlink()

    Linus Torvalds
     
  • The data encryption was moved from ecryptfs_write_end into
    ecryptfs_writepage, this patch moves the corresponding function
    comments to be consistent with the modification.

    Signed-off-by: Li Wang
    Signed-off-by: Linus Torvalds

    Li Wang
     
  • Says Tyler:
    "Tim's logging message update will be really helpful to users when
    they're trying to locate a problematic file in the lower filesystem
    with filename encryption enabled.

    You'll recognize the fix from Li, as you commented on that.

    You should also be familiar with my setattr/truncate improvements,
    since you were the one that pointed them out to us (thanks again!).
    Andrew noted the /dev/ecryptfs write count sanitization needed to be
    improved, so I've got a fix in there for that along with some other
    less important cleanups of the /dev/ecryptfs read/write code."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
    eCryptfs: Fix oops when printing debug info in extent crypto functions
    eCryptfs: Remove unused ecryptfs_read()
    eCryptfs: Check inode changes in setattr
    eCryptfs: Make truncate path killable
    eCryptfs: Infinite loop due to overflow in ecryptfs_write()
    eCryptfs: Replace miscdev read/write magic numbers
    eCryptfs: Report errors in writes to /dev/ecryptfs
    eCryptfs: Sanitize write counts of /dev/ecryptfs
    ecryptfs: Remove unnecessary variable initialization
    ecryptfs: Improve metadata read failure logging
    MAINTAINERS: Update eCryptfs maintainer address

    Linus Torvalds
     
  • If pages passed to the eCryptfs extent-based crypto functions are not
    mapped and the module parameter ecryptfs_verbosity=1 was specified at
    loading time, a NULL pointer dereference will occur.

    Note that this wouldn't happen on a production system, as you wouldn't
    pass ecryptfs_verbosity=1 on a production system. It leaks private
    information to the system logs and is for debugging only.

    The debugging info printed in these messages is no longer very useful
    and rather than doing a kmap() in these debugging paths, it will be
    better to simply remove the debugging paths completely.

    https://launchpad.net/bugs/913651

    Signed-off-by: Tyler Hicks
    Reported-by: Daniel DeFreez
    Cc:

    Tyler Hicks
     
  • ecryptfs_read() has been ifdef'ed out for years now and it was
    apparently unused before then. It is time to get rid of it for good.

    Signed-off-by: Tyler Hicks

    Tyler Hicks
     
  • Most filesystems call inode_change_ok() very early in ->setattr(), but
    eCryptfs didn't call it at all. It allowed the lower filesystem to make
    the call in its ->setattr() function. Then, eCryptfs would copy the
    appropriate inode attributes from the lower inode to the eCryptfs inode.

    This patch changes that and actually calls inode_change_ok() on the
    eCryptfs inode, fairly early in ecryptfs_setattr(). Ideally, the call
    would happen earlier in ecryptfs_setattr(), but there are some possible
    inode initialization steps that must happen first.

    Since the call was already being made on the lower inode, the change in
    functionality should be minimal, except for the case of a file extending
    truncate call. In that case, inode_newsize_ok() was never being
    called on the eCryptfs inode. Rather than inode_newsize_ok() catching
    maximum file size errors early on, eCryptfs would encrypt zeroed pages
    and write them to the lower filesystem until the lower filesystem's
    write path caught the error in generic_write_checks(). This patch
    introduces a new function, called ecryptfs_inode_newsize_ok(), which
    checks if the new lower file size is within the appropriate limits when
    the truncate operation will be growing the lower file.

    In summary this change prevents eCryptfs truncate operations (and the
    resulting page encryptions), which would exceed the lower filesystem
    limits or FSIZE rlimits, from ever starting.

    Signed-off-by: Tyler Hicks
    Reviewed-by: Li Wang
    Cc:

    Tyler Hicks
     
  • ecryptfs_write() handles the truncation of eCryptfs inodes. It grabs a
    page, zeroes out the appropriate portions, and then encrypts the page
    before writing it to the lower filesystem. It was unkillable and due to
    the lack of sparse file support could result in tying up a large portion
    of system resources, while encrypting pages of zeros, with no way for
    the truncate operation to be stopped from userspace.

    This patch adds the ability for ecryptfs_write() to detect a pending
    fatal signal and return as gracefully as possible. The intent is to
    leave the lower file in a useable state, while still allowing a user to
    break out of the encryption loop. If a pending fatal signal is detected,
    the eCryptfs inode size is updated to reflect the modified inode size
    and then -EINTR is returned.

    Signed-off-by: Tyler Hicks
    Cc:

    Tyler Hicks
     
  • ecryptfs_write() can enter an infinite loop when truncating a file to a
    size larger than 4G. This only happens on architectures where size_t is
    represented by 32 bits.

    This was caused by a size_t overflow due to it incorrectly being used to
    store the result of a calculation which uses potentially large values of
    type loff_t.

    [tyhicks@canonical.com: rewrite subject and commit message]
    Signed-off-by: Li Wang
    Signed-off-by: Yunchuan Wen
    Reviewed-by: Cong Wang
    Cc:
    Signed-off-by: Tyler Hicks

    Li Wang
     
  • ecryptfs_miscdev_read() and ecryptfs_miscdev_write() contained many
    magic numbers for specifying packet header field sizes and offsets. This
    patch defines those values and replaces the magic values.

    Signed-off-by: Tyler Hicks

    Tyler Hicks
     
  • Errors in writes to /dev/ecryptfs were being incorrectly reported by
    returning 0 or the value of the original write count.

    This patch clears up the return code assignment in error paths.

    Signed-off-by: Tyler Hicks

    Tyler Hicks
     
  • A malicious count value specified when writing to /dev/ecryptfs may
    result in a a very large kernel memory allocation.

    This patch peeks at the specified packet payload size, adds that to the
    size of the packet headers and compares the result with the write count
    value. The resulting maximum memory allocation size is approximately 532
    bytes.

    Signed-off-by: Tyler Hicks
    Reported-by: Sasha Levin
    Cc:

    Tyler Hicks
     
  • Removes unneeded variable initialization in ecryptfs_read_metadata(). Also adds
    a small comment to help explain metadata reading logic.

    [tyhicks@canonical.com: Pulled out of for-stable patch and wrote commit msg]
    Signed-off-by: Tim Gardner
    Signed-off-by: Tyler Hicks

    Tim Gardner
     
  • Print inode on metadata read failure. The only real
    way of dealing with metadata read failures is to delete
    the underlying file system file. Having the inode
    allows one to 'find . -inum INODE`.

    [tyhicks@canonical.com: Removed some minor not-for-stable parts]
    Signed-off-by: Tim Gardner
    Reviewed-by: Kees Cook
    Cc: stable@vger.kernel.org
    Signed-off-by: Tyler Hicks

    Tim Gardner
     
  • Commit b52a360b forgot to call xfs_iunlock() when it detected corrupted
    symplink and bailed out. Fix it by jumping to 'out' instead of doing return.

    CC: stable@kernel.org
    CC: Carlos Maiolino
    Signed-off-by: Jan Kara
    Reviewed-by: Alex Elder
    Reviewed-by: Dave Chinner
    Signed-off-by: Ben Myers

    Jan Kara
     

25 Jan, 2012

1 commit


24 Jan, 2012

5 commits

  • The usual kernel-doc fixups from Randy. Some of them David acked as
    merged in his tree, this is the random left-overs.

    * kernel-doc:
    docbook: fix sched source file names in device-drivers book
    docbook: change iomap source filename in deviceiobook
    docbook: don't use serial_core.h in device-drivers book
    kernel-doc: fix kernel-doc warnings in sched
    kernel-doc: fix new warnings in cfg80211.h
    kernel-doc: fix new warning in usb.h
    kernel-doc: fix new warnings in device.h
    kernel-doc: fix new warnings in debugfs
    kernel-doc: fix new warning in regulator core
    kernel-doc: fix new warnings in pci
    kernel-doc: fix new warnings in driver-core
    kernel-doc: fix new warnings in auditsc.c
    scripts/kernel-doc: fix fatal error caused by cfg80211.h

    Linus Torvalds
     
  • Quoth Andrew:
    "Random fixes. And a simple new LED driver which I'm trying to sneak
    in while you're not looking."

    Sneaking successful.

    * akpm:
    score: fix off-by-one index into syscall table
    mm: fix rss count leakage during migration
    SHM_UNLOCK: fix Unevictable pages stranded after swap
    SHM_UNLOCK: fix long unpreemptible section
    kdump: define KEXEC_NOTE_BYTES arch specific for s390x
    mm/hugetlb.c: undo change to page mapcount in fault handler
    mm: memcg: update the correct soft limit tree during migration
    proc: clear_refs: do not clear reserved pages
    drivers/video/backlight/l4f00242t03.c: return proper error in l4f00242t03_probe if regulator_get() fails
    drivers/video/backlight/adp88x0_bl.c: fix bit testing logic
    kprobes: initialize before using a hlist
    ipc/mqueue: simplify reading msgqueue limit
    leds: add led driver for Bachmann's ot200
    mm: __count_immobile_pages(): make sure the node is online
    mm: fix NULL ptr dereference in __count_immobile_pages
    mm: fix warnings regarding enum migrate_mode

    Linus Torvalds
     
  • * git://git.samba.org/sfrench/cifs-2.6:
    CIFS: Rename *UCS* functions to *UTF16*
    [CIFS] ACL and FSCACHE support no longer EXPERIMENTAL
    [CIFS] Fix build break with multiuser patch when LANMAN disabled
    cifs: warn about impending deprecation of legacy MultiuserMount code
    cifs: fetch credentials out of keyring for non-krb5 auth multiuser mounts
    cifs: sanitize username handling
    keys: add a "logon" key type
    cifs: lower default wsize when unix extensions are not used
    cifs: better instrumentation for coalesce_t2
    cifs: integer overflow in parse_dacl()
    cifs: Fix sparse warning when calling cifs_strtoUCS
    CIFS: Add descriptions to the brlock cache functions

    Linus Torvalds
     
  • Fix new kernel-doc warnings:

    Warning(fs/debugfs/file.c:556): No description found for parameter 'nregs'
    Warning(fs/debugfs/file.c:556): Excess function parameter 'mregs' description in 'debugfs_print_regs32'

    Signed-off-by: Randy Dunlap
    Cc: Greg Kroah-Hartman
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • /proc/pid/clear_refs is used to clear the Referenced and YOUNG bits for
    pages and corresponding page table entries of the task with PID pid, which
    includes any special mappings inserted into the page tables in order to
    provide things like vDSOs and user helper functions.

    On ARM this causes a problem because the vectors page is mapped as a
    global mapping and since ec706dab ("ARM: add a vma entry for the user
    accessible vector page"), a VMA is also inserted into each task for this
    page to aid unwinding through signals and syscall restarts. Since the
    vectors page is required for handling faults, clearing the YOUNG bit (and
    subsequently writing a faulting pte) means that we lose the vectors page
    *globally* and cannot fault it back in. This results in a system deadlock
    on the next exception.

    To see this problem in action, just run:

    $ echo 1 > /proc/self/clear_refs

    on an ARM platform (as any user) and watch your system hang. I think this
    has been the case since 2.6.37

    This patch avoids clearing the aforementioned bits for reserved pages,
    therefore leaving the vectors page intact on ARM. Since reserved pages
    are not candidates for swap, this change should not have any impact on the
    usefulness of clear_refs.

    Signed-off-by: Will Deacon
    Reported-by: Moussa Ba
    Acked-by: Hugh Dickins
    Cc: David Rientjes
    Cc: Russell King
    Acked-by: Nicolas Pitre
    Cc: Matt Mackall
    Cc: [2.6.37+]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Deacon
     

20 Jan, 2012

5 commits


19 Jan, 2012

3 commits


18 Jan, 2012

12 commits

  • We'll allow a grace period of 2 releases (3.3 and 3.4) and then remove
    the legacy code in 3.5.

    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • Fix up multiuser mounts to set the secType and set the username and
    password from the key payload in the vol info for non-krb5 auth types.

    Look for a key of type "secret" with a description of
    "cifs:a:" or "cifs:d:". If that's found,
    then scrape the username and password out of the key payload and use
    that to create a new user session.

    Finally, don't have the code enforce krb5 auth on multiuser mounts,
    but do require a kernel with keys support.

    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • Currently, it's not very clear whether you're allowed to have a NULL
    vol->username or ses->user_name. Some places check for it and some don't.

    Make it clear that a NULL pointer is OK in these fields, and ensure that
    all the callers check for that.

    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • We've had some reports of servers (namely, the Solaris in-kernel CIFS
    server) that don't deal properly with writes that are "too large" even
    though they set CAP_LARGE_WRITE_ANDX. Change the default to better
    mirror what windows clients do.

    Cc: stable@vger.kernel.org
    Cc: Pavel Shilovsky
    Reported-by: Nick Davis
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • When coalesce_t2 returns an error, have it throw a cFYI message that
    explains the reason. Also rename some variables to clarify what they
    represent.

    Reported-and-Tested-by: Konstantinos Skarlatos
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit: (29 commits)
    audit: no leading space in audit_log_d_path prefix
    audit: treat s_id as an untrusted string
    audit: fix signedness bug in audit_log_execve_info()
    audit: comparison on interprocess fields
    audit: implement all object interfield comparisons
    audit: allow interfield comparison between gid and ogid
    audit: complex interfield comparison helper
    audit: allow interfield comparison in audit rules
    Kernel: Audit Support For The ARM Platform
    audit: do not call audit_getname on error
    audit: only allow tasks to set their loginuid if it is -1
    audit: remove task argument to audit_set_loginuid
    audit: allow audit matching on inode gid
    audit: allow matching on obj_uid
    audit: remove audit_finish_fork as it can't be called
    audit: reject entry,always rules
    audit: inline audit_free to simplify the look of generic code
    audit: drop audit_set_macxattr as it doesn't do anything
    audit: inline checks for not needing to collect aux records
    audit: drop some potentially inadvisable likely notations
    ...

    Use evil merge to fix up grammar mistakes in Kconfig file.

    Bad speling and horrible grammar (and copious swearing) is to be
    expected, but let's keep it to commit messages and comments, rather than
    expose it to users in config help texts or printouts.

    Linus Torvalds
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    xfs: cleanup xfs_file_aio_write
    xfs: always return with the iolock held from xfs_file_aio_write_checks
    xfs: remove the i_new_size field in struct xfs_inode
    xfs: remove the i_size field in struct xfs_inode
    xfs: replace i_pin_wait with a bit waitqueue
    xfs: replace i_flock with a sleeping bitlock
    xfs: make i_flags an unsigned long
    xfs: remove the if_ext_max field in struct xfs_ifork
    xfs: remove the unused dm_attrs structure
    xfs: cleanup xfs_iomap_eof_align_last_fsb
    xfs: remove xfs_itruncate_data

    Linus Torvalds
     
  • * 'btrfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    btrfs: take allocation of ->tree_root into open_ctree()
    btrfs: let ->s_fs_info point to fs_info, not root...
    btrfs: consolidate failure exits in btrfs_mount() a bit
    btrfs: make free_fs_info() call ->kill_sb() unconditional
    btrfs: merge free_fs_info() calls on fill_super failures
    btrfs: kill pointless reassignment of ->s_fs_info in btrfs_fill_super()
    btrfs: make open_ctree() return int
    btrfs: sanitizing ->fs_info, part 5
    btrfs: sanitizing ->fs_info, part 4
    btrfs: sanitizing ->fs_info, part 3
    btrfs: sanitizing ->fs_info, part 2
    btrfs: sanitizing ->fs_info, part 1
    btrfs: fix a deadlock in btrfs_scan_one_device()
    btrfs: fix mount/umount race
    btrfs: get ->kill_sb() of its own
    btrfs: preparation to fixing mount/umount race

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (62 commits)
    Btrfs: use larger system chunks
    Btrfs: add a delalloc mutex to inodes for delalloc reservations
    Btrfs: space leak tracepoints
    Btrfs: protect orphan block rsv with spin_lock
    Btrfs: add allocator tracepoints
    Btrfs: don't call btrfs_throttle in file write
    Btrfs: release space on error in page_mkwrite
    Btrfs: fix btrfsck error 400 when truncating a compressed
    Btrfs: do not use btrfs_end_transaction_throttle everywhere
    Btrfs: add balance progress reporting
    Btrfs: allow for resuming restriper after it was paused
    Btrfs: allow for canceling restriper
    Btrfs: allow for pausing restriper
    Btrfs: add skip_balance mount option
    Btrfs: recover balance on mount
    Btrfs: save balance parameters to disk
    Btrfs: soft profile changing mode (aka soft convert)
    Btrfs: implement online profile changing
    Btrfs: do not reduce profile in do_chunk_alloc()
    Btrfs: virtual address space subset filter
    ...

    Fix up trivial conflict in fs/btrfs/ioctl.c due to the use of the new
    mnt_drop_write_file() helper.

    Linus Torvalds
     
  • Jüri Aedla reported that the /proc//mem handling really isn't very
    robust, and it also doesn't match the permission checking of any of the
    other related files.

    This changes it to do the permission checks at open time, and instead of
    tracking the process, it tracks the VM at the time of the open. That
    simplifies the code a lot, but does mean that if you hold the file
    descriptor open over an execve(), you'll continue to read from the _old_
    VM.

    That is different from our previous behavior, but much simpler. If
    somebody actually finds a load where this matters, we'll need to revert
    this commit.

    I suspect that nobody will ever notice - because the process mapping
    addresses will also have changed as part of the execve. So you cannot
    actually usefully access the fd across a VM change simply because all
    the offsets for IO would have changed too.

    Reported-by: Jüri Aedla
    Cc: Al Viro
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Don't log a message for set_nlink(0).

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Al Viro

    Miklos Szeredi
     
  • dd slept infinitely when fsfeeze failed because of EIO.
    To fix this problem, if ->freeze_fs fails, freeze_super() wakes up
    the tasks waiting for the filesystem to become unfrozen.

    When s_frozen isn't SB_UNFROZEN in __generic_file_aio_write(),
    the function sleeps until FITHAW ioctl wakes up s_wait_unfrozen.

    However, if ->freeze_fs fails, s_frozen is set to SB_UNFROZEN and then
    freeze_super() returns an error number. In this case, FITHAW ioctl returns
    EINVAL because s_frozen is already SB_UNFROZEN. There is no way to wake up
    s_wait_unfrozen, so __generic_file_aio_write() sleeps infinitely.

    Signed-off-by: Kazuya Mio
    Signed-off-by: Al Viro

    Kazuya Mio