29 Oct, 2012

1 commit

  • Functions generic_file_splice_read and generic_file_splice_write access
    the pagecache directly. For block devices these functions must be locked
    so that block size is not changed while they are in progress.

    This patch is an additional fix for commit b87570f5d349 ("Fix a crash
    when block device is read and block size is changed at the same time")
    that locked aio_read, aio_write and mmap against block size change.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Linus Torvalds

    Mikulas Patocka
     

27 Oct, 2012

4 commits

  • Pull power management and ACPI fixes from Rafael J Wysocki:

    - Fix for a memory leak in acpi_bind_one() from Jesper Juhl.

    - Fix for an error code path memory leak in pm_genpd_attach_cpuidle()
    from Jonghwan Choi.

    - Fix for smp_processor_id() usage in preemptible code in powernow-k8
    from Andreas Herrmann.

    - Fix for a suspend-related memory leak in cpufreq stats from Xiaobing
    Tu.

    - Freezer fix for failure to clear PF_NOFREEZE along with PF_KTHREAD in
    flush_old_exec() from Oleg Nesterov.

    - acpi_processor_notify() fix from Alan Cox.

    * tag 'pm+acpi-for-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI: missing break
    freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD
    Fix memory leak in cpufreq stats.
    cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code
    PM / Domains: Fix memory leak on error path in pm_genpd_attach_cpuidle
    ACPI: Fix memory leak in acpi_bind_one()

    Linus Torvalds
     
  • Pull driver core fixes from Greg Kroah-Hartman:
    "Here are a number of firmware core fixes for 3.7, and some other minor
    fixes. And some documentation updates thrown in for good measure.

    All have been in the linux-next tree for a while.

    Signed-off-by: Greg Kroah-Hartman "

    * tag 'driver-core-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    Documentation:Chinese translation of Documentation/arm64/memory.txt
    Documentation:Chinese translation of Documentation/arm64/booting.txt
    Documentation:Chinese translation of Documentation/IRQ.txt
    firmware loader: document kernel direct loading
    sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()
    dynamic_debug: Remove unnecessary __used
    firmware loader: sync firmware cache by async_synchronize_full_domain
    firmware loader: let direct loading back on 'firmware_buf'
    firmware loader: fix one reqeust_firmware race
    firmware loader: cancel uncache work before caching firmware

    Linus Torvalds
     
  • In commit 800179c9b8a1 ("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: Nick Bowler
    Reported-by: Holger Kiehl
    Cc: Kees Cook
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: Al Viro
    Cc: Alan Cox
    Cc: Theodore Ts'o
    Cc: stable@kernel.org # v3.6
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • Pull btrfs fixes from Chris Mason:
    "This has our series of fixes for the next rc. The biggest batch is
    from Jan Schmidt, fixing up some problems in our subvolume quota code
    and fixing btrfs send/receive to work with the new extended inode
    refs."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: do not bug when we fail to commit the transaction
    Btrfs: fix memory leak when cloning root's node
    Btrfs: Use btrfs_update_inode_fallback when creating a snapshot
    Btrfs: Send: preserve ownership (uid and gid) also for symlinks.
    Btrfs: fix deadlock caused by the nested chunk allocation
    btrfs: Return EINVAL when length to trim is less than FSB
    Btrfs: fix memory leak in btrfs_quota_enable()
    Btrfs: send correct rdev and mode in btrfs-send
    Btrfs: extended inode refs support for send mechanism
    Btrfs: Fix wrong error handling code
    Fix a sign bug causing invalid memory access in the ino_paths ioctl.
    Btrfs: comment for loop in tree_mod_log_insert_move
    Btrfs: fix extent buffer reference for tree mod log roots
    Btrfs: determine level of old roots
    Btrfs: tree mod log's old roots could still be part of the tree
    Btrfs: fix a tree mod logging issue for root replacement operations
    Btrfs: don't put removals from push_node_left into tree mod log twice

    Linus Torvalds
     

26 Oct, 2012

15 commits


25 Oct, 2012

1 commit

  • The warning check for duplicate sysfs entries can cause a buffer overflow
    when printing the warning, as strcat() doesn't check buffer sizes.
    Use strlcat() instead.

    Since strlcat() doesn't return a pointer to the passed buffer, unlike
    strcat(), I had to convert the nested concatenation in sysfs_add_one() to
    an admittedly more obscure comma operator construct, to avoid emitting code
    for the concatenation if CONFIG_BUG is disabled.

    Signed-off-by: Geert Uytterhoeven
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     

24 Oct, 2012

7 commits


23 Oct, 2012

6 commits

  • Avoid the implicit free by tree_mod_log_set_root_pointer, which is wrong in
    two places. Where needed, we call tree_mod_log_free_eb explicitly now.

    Signed-off-by: Jan Schmidt

    Jan Schmidt
     
  • Independant of the check (push_items < src_items) tree_mod_log_eb_copy did
    log the removal of the old data entries from the source buffer. Therefore,
    we must not call tree_mod_log_eb_move if the check evaluates to true, as
    that would log the removal twice, finally resulting in (rewinded) buffers
    with wrong values for header_nritems.

    Signed-off-by: Jan Schmidt

    Jan Schmidt
     
  • Pull jfs fix from Dave Kleikamp:
    "Bug fix: Fix FITRIM argument handling"

    * tag 'jfs-3.7-2' of git://github.com/kleikamp/linux-shaggy:
    jfs: Fix FITRIM argument handling

    Linus Torvalds
     
  • Pull ext4 fixes from Ted Ts'o:
    "Various bug fixes for ext4. The most serious of them fixes a security
    bug (CVE-2012-4508) which leads to stale data exposure when we have
    fallocate racing against writes to files undergoing delayed
    allocation. We also have two fixes for the metadata checksum feature,
    the most serious of which can cause the superblock to have a invalid
    checksum after a power failure."

    * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    ext4: Avoid underflow in ext4_trim_fs()
    ext4: Checksum the block bitmap properly with bigalloc enabled
    ext4: fix undefined bit shift result in ext4_fill_flex_info
    ext4: fix metadata checksum calculation for the superblock
    ext4: race-condition protection for ext4_convert_unwritten_extents_endio
    ext4: serialize fallocate with ext4_convert_unwritten_extents

    Linus Torvalds
     
  • Pull NFS client bugfixes from Trond Myklebust:
    - Do not call pnfs_return_layout() from an rpciod context
    - nfs4_ds_disconnect can cause Oopses. Kill it...
    - Fix the return value for nfs_callback_start_svc
    - Fix a number of compile warnings

    * tag 'nfs-for-3.7-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    NFSv4: Fix the return value for nfs_callback_start_svc
    NFSv4.1: Declare osd_pri_2_pnfs_err(), objio_init_read/write to be static
    NFSv4: fs/nfs/nfs4getroot.c needs to include "internal.h"
    NFSv4.1: Use kcalloc() to allocate zeroed arrays instead of kzalloc()
    NFSv4.1: Do not call pnfs_return_layout() from an rpciod context
    NFSv4.1: Kill nfs4_ds_disconnect()

    Linus Torvalds
     
  • Currently if len argument in ext4_trim_fs() is smaller than one block,
    the 'end' variable underflow. Avoid that by returning EINVAL if len is
    smaller than file system block.

    Also remove useless unlikely().

    Signed-off-by: Lukas Czerner
    Signed-off-by: "Theodore Ts'o"
    Cc: stable@vger.kernel.org

    Lukas Czerner
     

22 Oct, 2012

2 commits

  • In certain cases (for example when a cdev structure is embedded into
    another object whose lifetime is controlled by a separate kobject) it is
    beneficial to tie lifetime of another object to the lifetime of
    character device so that related object is not freed until after
    char_dev object is freed.

    To achieve this let's pin kobject's parent when doing cdev_add() and
    unpin when last reference to cdev structure is being released.

    Signed-off-by: Dmitry Torokhov
    Acked-by: Al Viro
    Signed-off-by: Linus Torvalds

    Dmitry Torokhov
     
  • In mke2fs, we only checksum the whole bitmap block and it is right.
    While in the kernel, we use EXT4_BLOCKS_PER_GROUP to indicate the
    size of the checksumed bitmap which is wrong when we enable bigalloc.
    The right size should be EXT4_CLUSTERS_PER_GROUP and this patch fixes
    it.

    Also as every caller of ext4_block_bitmap_csum_set and
    ext4_block_bitmap_csum_verify pass in EXT4_BLOCKS_PER_GROUP(sb)/8,
    we'd better removes this parameter and sets it in the function itself.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"
    Reviewed-by: Lukas Czerner
    Cc: stable@vger.kernel.org

    Tao Ma
     

20 Oct, 2012

2 commits

  • /proc//numa_maps scans vma and show mempolicy under
    mmap_sem. It sometimes accesses task->mempolicy which can
    be freed without mmap_sem and numa_maps can show some
    garbage while scanning.

    This patch tries to take reference count of task->mempolicy at reading
    numa_maps before calling get_vma_policy(). By this, task->mempolicy
    will not be freed until numa_maps reaches its end.

    V2->v3
    - updated comments to be more verbose.
    - removed task_lock() in numa_maps code.
    V1->V2
    - access task->mempolicy only once and remember it. Becase kernel/exit.c
    can overwrite it.

    Signed-off-by: KAMEZAWA Hiroyuki
    Acked-by: David Rientjes
    Acked-by: KOSAKI Motohiro
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • Pull nfsd bugfixes from J Bruce Fields.

    * 'for-3.7' of git://linux-nfs.org/~bfields/linux:
    SUNRPC: Prevent kernel stack corruption on long values of flush
    NLM: nlm_lookup_file() may return NLMv4-specific error codes

    Linus Torvalds
     

19 Oct, 2012

1 commit

  • Commit 38f38657444d ("xattr: extract simple_xattr code from tmpfs") moved
    some code from tmpfs but introduced a subtle bug along the way.

    If the name passed to simple_xattr_remove() does not exist in the list of
    xattrs, then it is possible to call kfree(new_xattr) when new_xattr is
    actually initialized to itself on the stack via uninitialized_var().

    This causes a BUG() since the memory was not allocated via the slab
    allocator and was not bypassed through to the page allocator because it
    was too large.

    Initialize the local variable to NULL so the kfree() never takes place.

    Reported-by: Fengguang Wu
    Signed-off-by: David Rientjes
    Acked-by: Hugh Dickins
    Acked-by: Aristeu Rozanski
    Signed-off-by: Linus Torvalds

    David Rientjes
     

17 Oct, 2012

1 commit

  • Currently when 'range->start' is beyond the end of file system
    nothing is done and that fact is ignored, where in fact we should return
    EINVAL. The same problem is when 'range.len' is smaller than file system
    block.

    Fix this by adding check for such conditions and return EINVAL
    appropriately.

    Signed-off-by: Lukas Czerner
    Acked-by: Tino Reichardt
    Signed-off-by: Dave Kleikamp

    Lukas Czerner