01 Aug, 2014

38 commits

  • Greg Kroah-Hartman
     
  • commit aff008ad813c7cf3cfe7b532e7ba2c526c136f22 upstream.

    Commits 9ec36ca (of/irq: do irq resolution in platform_get_irq)
    and ad69674 (of/irq: do irq resolution in platform_get_irq_byname)
    change the semantics of platform_get_irq and platform_get_irq_byname
    to always rely on devicetree information if devicetree is enabled
    and if a devicetree node is attached to the device. The functions
    now return an error if the devicetree data does not include interrupt
    information, even if the information is available as platform resource
    data.

    This causes mfd client drivers to fail if the interrupt number is
    passed via platform resources. Therefore, if of_irq_get fails, try
    platform_get_resource as method of last resort. This restores the
    original functionality for drivers depending on platform resources
    to get irq information.

    Cc: Russell King
    Cc: Tony Lindgren
    Cc: Grant Likely
    Cc: Grygorii Strashko
    Signed-off-by: Guenter Roeck
    Acked-by: Rob Herring
    [ Guenter Roeck: backported to 3.15 ]
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • commit 02df00eb0019e7d15a1fcddebe4d020226c1ccda upstream.

    The non-split wiphy state shouldn't be increased in size
    so move the new set_qos_map command into the split if
    statement.

    Fixes: fa9ffc745610 ("cfg80211: Add support for QoS mapping")
    Reviewed-by: Emmanuel Grumbach
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     
  • commit c118678bc79e8241f9d3434d9324c6400d72f48a upstream.

    Ingo Korb reported that "repeated mapping of the same file on tmpfs
    using remap_file_pages sometimes triggers a BUG at mm/filemap.c:202 when
    the process exits".

    He bisected the bug to d7c1755179b8 ("mm: implement ->map_pages for
    shmem/tmpfs"), although the bug was actually added by commit
    8c6e50b0290c ("mm: introduce vm_ops->map_pages()").

    The problem is caused by calling do_fault_around for a _non-linear_
    fault. In this case pgoff is shifted and might become negative during
    calculation.

    Faulting around non-linear page-fault makes no sense and breaks the
    logic in do_fault_around because pgoff is shifted.

    Signed-off-by: Konstantin Khlebnikov
    Reported-by: Ingo Korb
    Tested-by: Ingo Korb
    Cc: Hugh Dickins
    Cc: Sasha Levin
    Cc: Dave Jones
    Cc: Ning Qu
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Konstantin Khlebnikov
     
  • commit e052dbf554610e2104c5a7518c4d8374bed701bb upstream.

    The hwrng core asks for random data in the hwrng_register() call itself
    from commit d9e7972619. This doesn't play well with virtio -- the
    DRIVER_OK bit is only set by virtio core on a successful probe, and
    we're not yet out of our probe routine when this call is made. This
    causes the host to not acknowledge any requests we put in the virtqueue,
    and the insmod or kernel boot process just waits for data to arrive from
    the host, which never happens.

    CC: Kees Cook
    CC: Jason Cooper
    CC: Herbert Xu
    Reviewed-by: Jason Cooper
    Signed-off-by: Amit Shah
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Amit Shah
     
  • commit 2062afb4f804afef61cbe62a30cac9a46e58e067 upstream.

    Michel Dänzer and a couple of other people reported inexplicable random
    oopses in the scheduler, and the cause turns out to be gcc mis-compiling
    the load_balance() function when debugging is enabled. The gcc bug
    apparently goes back to gcc-4.5, but slight optimization changes means
    that it now showed up as a problem in 4.9.0 and 4.9.1.

    The instruction scheduling problem causes gcc to schedule a spill
    operation to before the stack frame has been created, which in turn can
    corrupt the spilled value if an interrupt comes in. There may be other
    effects of this bug too, but that's the code generation problem seen in
    Michel's case.

    This is fixed in current gcc HEAD, but the workaround as suggested by
    Markus Trippelsdorf is pretty simple: use -fno-var-tracking-assignments
    when compiling the kernel, which disables the gcc code that causes the
    problem. This can result in slightly worse debug information for
    variable accesses, but that is infinitely preferable to actual code
    generation problems.

    Doing this unconditionally (not just for CONFIG_DEBUG_INFO) also allows
    non-debug builds to verify that the debug build would be identical: we
    can do

    export GCC_COMPARE_DEBUG=1

    to make gcc internally verify that the result of the build is
    independent of the "-g" flag (it will make the compiler build everything
    twice, toggling the debug flag, and compare the results).

    Without the "-fno-var-tracking-assignments" option, the build would fail
    (even with 4.8.3 that didn't show the actual stack frame bug) with a gcc
    compare failure.

    See also gcc bugzilla:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61801

    Reported-by: Michel Dänzer
    Suggested-by: Markus Trippelsdorf
    Cc: Jakub Jelinek
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Linus Torvalds
     
  • commit 0253d634e0803a8376a0d88efee0bf523d8673f9 upstream.

    Commit 4a705fef9862 ("hugetlb: fix copy_hugetlb_page_range() to handle
    migration/hwpoisoned entry") changed the order of
    huge_ptep_set_wrprotect() and huge_ptep_get(), which leads to breakage
    in some workloads like hugepage-backed heap allocation via libhugetlbfs.
    This patch fixes it.

    The test program for the problem is shown below:

    $ cat heap.c
    #include
    #include
    #include

    #define HPS 0x200000

    int main() {
    int i;
    char *p = malloc(HPS);
    memset(p, '1', HPS);
    for (i = 0; i < 5; i++) {
    if (!fork()) {
    memset(p, '2', HPS);
    p = malloc(HPS);
    memset(p, '3', HPS);
    free(p);
    return 0;
    }
    }
    sleep(1);
    free(p);
    return 0;
    }

    $ export HUGETLB_MORECORE=yes ; export HUGETLB_NO_PREFAULT= ; hugectl --heap ./heap

    Fixes 4a705fef9862 ("hugetlb: fix copy_hugetlb_page_range() to handle
    migration/hwpoisoned entry"), so is applicable to -stable kernels which
    include it.

    Signed-off-by: Naoya Horiguchi
    Reported-by: Guillaume Morin
    Suggested-by: Guillaume Morin
    Acked-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Naoya Horiguchi
     
  • commit 1b2c4869d8247f9e202fa8a73777c34adc62d409 upstream.

    This is a halfway fix for hawaii acceleration. More fixes to come
    but hopefully isolated to userspace.

    Signed-off-by: Jérôme Glisse
    Signed-off-by: Dave Airlie
    Signed-off-by: Greg Kroah-Hartman

    Jerome Glisse
     
  • commit e8c214d22e76dd0ead38f97f8d2dc09aac70d651 upstream.

    We must mask out the overflow bit as well, otherwise
    the wptr will never match the rptr again and the interrupt
    handler will loop forever.

    Signed-off-by: Christian König
    Signed-off-by: Alex Deucher
    Reviewed-by: Michel Dänzer
    Signed-off-by: Greg Kroah-Hartman

    Christian König
     
  • commit 8142b215501f8b291a108a202b3a053a265b03dd upstream.

    Commit 554086d ("x86_32, entry: Do syscall exit work on badsys
    (CVE-2014-4508)") introduced a regression in the x86_32 syscall entry
    code, resulting in syscall() not returning proper errors for undefined
    syscalls on CPUs supporting the sysenter feature.

    The following code:

    > int result = syscall(666);
    > printf("result=%d errno=%d error=%s\n", result, errno, strerror(errno));

    results in:

    > result=666 errno=0 error=Success

    Obviously, the syscall return value is the called syscall number, but it
    should have been an ENOSYS error. When run under ptrace it behaves
    correctly, which makes it hard to debug in the wild:

    > result=-1 errno=38 error=Function not implemented

    The %eax register is the return value register. For debugging via ptrace
    the syscall entry code stores the complete register context on the
    stack. The badsys handlers only store the ENOSYS error code in the
    ptrace register set and do not set %eax like a regular syscall handler
    would. The old resume_userspace call chain contains code that clobbers
    %eax and it restores %eax from the ptrace registers afterwards. The same
    goes for the ptrace-enabled call chain. When ptrace is not used, the
    syscall return value is the passed-in syscall number from the untouched
    %eax register.

    Use %eax as the return value register in syscall_badsys and
    sysenter_badsys, like a real syscall handler does, and have the caller
    push the value onto the stack for ptrace access.

    Signed-off-by: Sven Wegener
    Link: http://lkml.kernel.org/r/alpine.LNX.2.11.1407221022380.31021@titan.int.lan.stealer.net
    Reviewed-and-tested-by: Andy Lutomirski
    Signed-off-by: H. Peter Anvin
    Signed-off-by: Greg Kroah-Hartman

    Sven Wegener
     
  • commit 295dc39d941dc2ae53d5c170365af4c9d5c16212 upstream.

    Currently umount on symlink blocks following umount:

    /vz is separate mount

    # ls /vz/ -al | grep test
    drwxr-xr-x. 2 root root 4096 Jul 19 01:14 testdir
    lrwxrwxrwx. 1 root root 11 Jul 19 01:16 testlink -> /vz/testdir
    # umount -l /vz/testlink
    umount: /vz/testlink: not mounted (expected)

    # lsof /vz
    # umount /vz
    umount: /vz: device is busy. (unexpected)

    In this case mountpoint_last() gets an extra refcount on path->mnt

    Signed-off-by: Vasily Averin
    Acked-by: Ian Kent
    Acked-by: Jeff Layton
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Greg Kroah-Hartman

    Vasily Averin
     
  • commit edffe1b626b39bd7121691dfdecb548431003bbb upstream.

    Do not split the PARPORT-related symbols with the new kconfig
    symbol ARCH_MIGHT_HAVE_PC_PARPORT. The split was causing incorrect
    display of these symbols -- they were not being displayed together
    as they should be.

    Fixes: d90c3eb31535 "Kconfig cleanup (PARPORT_PC dependencies)"

    Signed-off-by: Randy Dunlap
    Cc: Mark Salter
    Cc: Ingo Molnar
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • commit 043572d5444116b9d9ad8ae763cf069e7accbc30 upstream.

    Temperature limit clamps are applied after converting the temperature
    from milli-degrees C to degrees C, so either the clamp limit needs
    to be specified in degrees C, not milli-degrees C, or clamping must
    happen before converting to degrees C. Use the latter method to avoid
    overflows.

    vrm is an u8, so the written value needs to be limited to [0, 255].

    Cc: Axel Lin
    Signed-off-by: Guenter Roeck
    Reviewed-by: Jean Delvare
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     
  • commit 20dbea494543aefaace874cc3ec93a39b94b1ec4 upstream.

    The sa_restorer field in struct sigaction is obsolete and no longer in
    the parisc implementation. However, the core code assumes the field is
    present if SA_RESTORER is defined. So, the define needs to be removed.

    Signed-off-by: John David Anglin
    Signed-off-by: Helge Deller
    Signed-off-by: Greg Kroah-Hartman

    John David Anglin
     
  • commit 7a2deccf0ef12f7f6e33150d5875020c0c94fa94 upstream.

    st_gpio_irqmux_handler() reads the status register to find out
    which banks inside the controller have pending IRQs.
    For each banks having pending IRQs, it calls the corresponding handler.

    Problem is that current code restricts the number of possible banks inside the
    controller to ST_GPIO_PINS_PER_BANK. This define represents the number of pins
    inside a bank, so it shouldn't be used here.

    On STiH407, PIO_FRONT0 controller has 10 banks, so IRQs pending in the two
    last banks (PIO18 & PIO19) aren't handled.

    This patch replace ST_GPIO_PINS_PER_BANK by the number of banks inside the
    controller.

    Cc: Linus Walleij
    Acked-by: Srinivas Kandagatla
    Signed-off-by: Maxime Coquelin
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Maxime COQUELIN
     
  • commit d7afaec0b564f0609e116f562983b8e72fc3e9c9 upstream.

    Here some additional changes to set a capability flag so that clients can
    detect when it's appropriate to return -ENOSYS from open.

    This amends the following commit introduced in 3.14:

    7678ac50615d fuse: support clients that don't implement 'open'

    However we can only add the flag to 3.15 and later since there was no
    protocol version update in 3.14.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Greg Kroah-Hartman

    Andrew Gallagher
     
  • commit a800bad36619ce47ac0222004635448e6c91ff72 upstream.

    Default s_time_gran is 1, don't overwrite that if userspace didn't
    explicitly specify one.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Greg Kroah-Hartman

    Miklos Szeredi
     
  • commit aed8adb7688d5744cb484226820163af31d2499a upstream.

    Commit 079148b919d0 ("coredump: factor out the setting of PF_DUMPCORE")
    cleaned up the setting of PF_DUMPCORE by removing it from all the
    linux_binfmt->core_dump() and moving it to zap_threads().But this ended
    up clearing all the previously set flags. This causes issues during
    core generation when tsk->flags is checked again (eg. for PF_USED_MATH
    to dump floating point registers). Fix this.

    Signed-off-by: Silesh C V
    Acked-by: Oleg Nesterov
    Cc: Mandeep Singh Baines
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Silesh C V
     
  • commit 50c5d36dab930b1f1b1e3348b8608aa8b9ee7610 upstream.

    We attempt to remove noise from coordinates reported by devices in
    input_handle_abs_event(), unfortunately, unless we were dropping the
    event altogether, we were ignoring the adjusted value and were passing
    on the original value instead.

    Reviewed-by: Andrew de los Reyes
    Reviewed-by: Benson Leung
    Reviewed-by: David Herrmann
    Reviewed-by: Henrik Rydberg
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • commit e76aed9da7189eeb41b9856552ce5721181e8e8d upstream.

    https://bugzilla.redhat.com/show_bug.cgi?id=1114768

    Signed-off-by: Hans de Goede
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • commit 694617474e33b8603fc76e090ed7d09376514b1a upstream.

    The patch 3e374919b314f20e2a04f641ebc1093d758f66a4 is supposed to fix the
    problem where kmem_cache_create incorrectly reports duplicate cache name
    and fails. The problem is described in the header of that patch.

    However, the patch doesn't really fix the problem because of these
    reasons:

    * the logic to test for debugging is reversed. It was intended to perform
    the check only if slub debugging is enabled (which implies that caches
    with the same parameters are not merged). Therefore, there should be
    #if !defined(CONFIG_SLUB) || defined(CONFIG_SLUB_DEBUG_ON)
    The current code has the condition reversed and performs the test if
    debugging is disabled.

    * slub debugging may be enabled or disabled based on kernel command line,
    CONFIG_SLUB_DEBUG_ON is just the default settings. Therefore the test
    based on definition of CONFIG_SLUB_DEBUG_ON is unreliable.

    This patch fixes the problem by removing the test
    "!defined(CONFIG_SLUB_DEBUG_ON)". Therefore, duplicate names are never
    checked if the SLUB allocator is used.

    Note to stable kernel maintainers: when backporint this patch, please
    backport also the patch 3e374919b314f20e2a04f641ebc1093d758f66a4.

    Acked-by: David Rientjes
    Acked-by: Christoph Lameter
    Signed-off-by: Mikulas Patocka
    Signed-off-by: Pekka Enberg
    Signed-off-by: Greg Kroah-Hartman

    Mikulas Patocka
     
  • commit 97a9a7179aad701ab676e6f29eb90766a1acfde2 upstream.

    Commit 75b57ecf9 refactored device tree nodes to use kobjects such that they
    can be exposed via /sysfs. A secondary commit 0829f6d1f furthered this rework
    by moving the kobect initialization logic out of of_node_add into its own
    of_node_init function. The inital commit removed the existing kref_init calls
    in the pseries dlpar code with the assumption kobject initialization would
    occur in of_node_add. The second commit had the side effect of triggering a
    BUG_ON during DLPAR, migration and suspend/resume operations as a result of
    dynamically added nodes being uninitialized.

    This patch fixes this by adding of_node_init calls in place of the previously
    removed kref_init calls.

    Fixes: 0829f6d1f69e ("of: device_node kobject lifecycle fixes")
    Signed-off-by: Tyrel Datwyler
    Acked-by: Nathan Fontenot
    Acked-by: Grant Likely
    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Greg Kroah-Hartman

    Tyrel Datwyler
     
  • commit b4c5c60920e3b0c4598f43e7317559f6aec51531 upstream.

    Sasha reported lockdep warning [1] introduced by [2].

    It could be fixed by doing disk revalidation out of the init_lock. It's
    okay because disk capacity change is protected by init_lock so that
    revalidate_disk always sees up-to-date value so there is no race.

    [1] https://lkml.org/lkml/2014/7/3/735
    [2] zram: revalidate disk after capacity change

    Fixes 2e32baea46ce ("zram: revalidate disk after capacity change").

    Signed-off-by: Minchan Kim
    Reported-by: Sasha Levin
    Cc: "Alexander E. Patrakov"
    Cc: Nitin Gupta
    Cc: Jerome Marchand
    Cc: Sergey Senozhatsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Minchan Kim
     
  • commit 58d4e21e50ff3cc57910a8abc20d7e14375d2f61 upstream.

    The "uptime" trace clock added in:

    commit 8aacf017b065a805d27467843490c976835eb4a5
    tracing: Add "uptime" trace clock that uses jiffies

    has wraparound problems when the system has been up more
    than 1 hour 11 minutes and 34 seconds. It converts jiffies
    to nanoseconds using:
    (u64)jiffies_to_usecs(jiffy) * 1000ULL
    but since jiffies_to_usecs() only returns a 32-bit value, it
    truncates at 2^32 microseconds. An additional problem on 32-bit
    systems is that the argument is "unsigned long", so fixing the
    return value only helps until 2^32 jiffies (49.7 days on a HZ=1000
    system).

    Avoid these problems by using jiffies_64 as our basis, and
    not converting to nanoseconds (we do convert to clock_t because
    user facing API must not be dependent on internal kernel
    HZ values).

    Link: http://lkml.kernel.org/p/99d63c5bfe9b320a3b428d773825a37095bf6a51.1405708254.git.tony.luck@intel.com

    Fixes: 8aacf017b065 "tracing: Add "uptime" trace clock that uses jiffies"
    Signed-off-by: Tony Luck
    Signed-off-by: Steven Rostedt
    Signed-off-by: Greg Kroah-Hartman

    Tony Luck
     
  • commit 0b462c89e31f7eb6789713437eb551833ee16ff3 upstream.

    While a queue is being destroyed, all the blkgs are destroyed and its
    ->root_blkg pointer is set to NULL. If someone else starts to drain
    while the queue is in this state, the following oops happens.

    NULL pointer dereference at 0000000000000028
    IP: [] blk_throtl_drain+0x84/0x230
    PGD e4a1067 PUD b773067 PMD 0
    Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    Modules linked in: cfq_iosched(-) [last unloaded: cfq_iosched]
    CPU: 1 PID: 537 Comm: bash Not tainted 3.16.0-rc3-work+ #2
    Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    task: ffff88000e222250 ti: ffff88000efd4000 task.ti: ffff88000efd4000
    RIP: 0010:[] [] blk_throtl_drain+0x84/0x230
    RSP: 0018:ffff88000efd7bf0 EFLAGS: 00010046
    RAX: 0000000000000000 RBX: ffff880015091450 RCX: 0000000000000001
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
    RBP: ffff88000efd7c10 R08: 0000000000000000 R09: 0000000000000001
    R10: ffff88000e222250 R11: 0000000000000000 R12: ffff880015091450
    R13: ffff880015092e00 R14: ffff880015091d70 R15: ffff88001508fc28
    FS: 00007f1332650740(0000) GS:ffff88001fa80000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000028 CR3: 0000000009446000 CR4: 00000000000006e0
    Stack:
    ffffffff8144e8f6 ffff880015091450 0000000000000000 ffff880015091d80
    ffff88000efd7c28 ffffffff8144ae2f ffff880015091450 ffff88000efd7c58
    ffffffff81427641 ffff880015091450 ffffffff82401f00 ffff880015091450
    Call Trace:
    [] blkcg_drain_queue+0x1f/0x60
    [] __blk_drain_queue+0x71/0x180
    [] blk_queue_bypass_start+0x6e/0xb0
    [] blkcg_deactivate_policy+0x38/0x120
    [] blk_throtl_exit+0x34/0x50
    [] blkcg_exit_queue+0x35/0x40
    [] blk_release_queue+0x26/0xd0
    [] kobject_cleanup+0x38/0x70
    [] kobject_put+0x28/0x60
    [] blk_put_queue+0x15/0x20
    [] scsi_device_dev_release_usercontext+0x16b/0x1c0
    [] execute_in_process_context+0x89/0xa0
    [] scsi_device_dev_release+0x1c/0x20
    [] device_release+0x32/0xa0
    [] kobject_cleanup+0x38/0x70
    [] kobject_put+0x28/0x60
    [] put_device+0x17/0x20
    [] __scsi_remove_device+0xa9/0xe0
    [] scsi_remove_device+0x2b/0x40
    [] sdev_store_delete+0x27/0x30
    [] dev_attr_store+0x18/0x30
    [] sysfs_kf_write+0x3e/0x50
    [] kernfs_fop_write+0xe7/0x170
    [] vfs_write+0xaf/0x1d0
    [] SyS_write+0x4d/0xc0
    [] system_call_fastpath+0x16/0x1b

    776687bce42b ("block, blk-mq: draining can't be skipped even if
    bypass_depth was non-zero") made it easier to trigger this bug by
    making blk_queue_bypass_start() drain even when it loses the first
    bypass test to blk_cleanup_queue(); however, the bug has always been
    there even before the commit as blk_queue_bypass_start() could race
    against queue destruction, win the initial bypass test but perform the
    actual draining after blk_cleanup_queue() already destroyed all blkgs.

    Fix it by skippping calling into policy draining if all the blkgs are
    already gone.

    Signed-off-by: Tejun Heo
    Reported-by: Shirish Pargaonkar
    Reported-by: Sasha Levin
    Reported-by: Jet Chen
    Tested-by: Shirish Pargaonkar
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • commit b32bfc06aefab61acc872dec3222624e6cd867ed upstream.

    Add support of the Promise FastTrak TX8660 SATA HBA in ahci mode by
    registering the board in the ahci_pci_tbl[].

    Note: this HBA also provide a hardware RAID mode when activated in
    BIOS but specific drivers from the manufacturer are required in this
    case.

    Signed-off-by: Romain Degez
    Tested-by: Romain Degez
    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Romain Degez
     
  • commit dab6cf55f81a6e16b8147aed9a843e1691dcd318 upstream.

    The PSW mask check of the PTRACE_POKEUSR_AREA command is incorrect.
    The PSW_MASK_USER define contains the PSW_MASK_ASC bits, the ptrace
    interface accepts all combinations for the address-space-control
    bits. To protect the kernel space the PSW mask check in ptrace needs
    to reject the address-space-control bit combination for home space.

    Fixes CVE-2014-3534

    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Greg Kroah-Hartman

    Martin Schwidefsky
     
  • commit 1a112d10f03e83fb3a2fdc4c9165865dec8a3ca6 upstream.

    1871ee134b73 ("libata: support the ata host which implements a queue
    depth less than 32") directly used ata_port->scsi_host->can_queue from
    ata_qc_new() to determine the number of tags supported by the host;
    unfortunately, SAS controllers doing SATA don't initialize ->scsi_host
    leading to the following oops.

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
    IP: [] ata_qc_new_init+0x188/0x1b0
    PGD 0
    Oops: 0002 [#1] SMP
    Modules linked in: isci libsas scsi_transport_sas mgag200 drm_kms_helper ttm
    CPU: 1 PID: 518 Comm: udevd Not tainted 3.16.0-rc6+ #62
    Hardware name: Intel Corporation S2600CO/S2600CO, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013
    task: ffff880c1a00b280 ti: ffff88061a000000 task.ti: ffff88061a000000
    RIP: 0010:[] [] ata_qc_new_init+0x188/0x1b0
    RSP: 0018:ffff88061a003ae8 EFLAGS: 00010012
    RAX: 0000000000000001 RBX: ffff88000241ca80 RCX: 00000000000000fa
    RDX: 0000000000000020 RSI: 0000000000000020 RDI: ffff8806194aa298
    RBP: ffff88061a003ae8 R08: ffff8806194a8000 R09: 0000000000000000
    R10: 0000000000000000 R11: ffff88000241ca80 R12: ffff88061ad58200
    R13: ffff8806194aa298 R14: ffffffff814e67a0 R15: ffff8806194a8000
    FS: 00007f3ad7fe3840(0000) GS:ffff880627620000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000058 CR3: 000000061a118000 CR4: 00000000001407e0
    Stack:
    ffff88061a003b20 ffffffff814e96e1 ffff88000241ca80 ffff88061ad58200
    ffff8800b6bf6000 ffff880c1c988000 ffff880619903850 ffff88061a003b68
    ffffffffa0056ce1 ffff88061a003b48 0000000013d6e6f8 ffff88000241ca80
    Call Trace:
    [] ata_sas_queuecmd+0xa1/0x430
    [] sas_queuecommand+0x191/0x220 [libsas]
    [] scsi_dispatch_cmd+0x10e/0x300 [] scsi_request_fn+0x2f5/0x550
    [] __blk_run_queue+0x33/0x40
    [] queue_unplugged+0x2a/0x90
    [] blk_flush_plug_list+0x1b4/0x210
    [] blk_finish_plug+0x14/0x50
    [] __do_page_cache_readahead+0x198/0x1f0
    [] force_page_cache_readahead+0x31/0x50
    [] page_cache_sync_readahead+0x3e/0x50
    [] generic_file_read_iter+0x496/0x5a0
    [] blkdev_read_iter+0x37/0x40
    [] new_sync_read+0x7e/0xb0
    [] vfs_read+0x94/0x170
    [] SyS_read+0x46/0xb0
    [] ? SyS_lseek+0x91/0xb0
    [] system_call_fastpath+0x16/0x1b
    Code: 00 00 00 88 50 29 83 7f 08 01 19 d2 83 e2 f0 83 ea 50 88 50 34 c6 81 1d 02 00 00 40 c6 81 17 02 00 00 00 5d c3 66 0f 1f 44 00 00 14 25 58 00 00 00

    Fix it by introducing ata_host->n_tags which is initialized to
    ATA_MAX_QUEUE - 1 in ata_host_init() for SAS controllers and set to
    scsi_host_template->can_queue in ata_host_register() for !SAS ones.
    As SAS hosts are never registered, this will give them the same
    ATA_MAX_QUEUE - 1 as before. Note that we can't use
    scsi_host->can_queue directly for SAS hosts anyway as they can go
    higher than the libata maximum.

    Signed-off-by: Tejun Heo
    Reported-by: Mike Qiu
    Reported-by: Jesse Brandeburg
    Reported-by: Peter Hurley
    Reported-by: Peter Zijlstra
    Tested-by: Alexey Kardashevskiy
    Fixes: 1871ee134b73 ("libata: support the ata host which implements a queue depth less than 32")
    Cc: Kevin Hao
    Cc: Dan Williams
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     
  • commit 1871ee134b73fb4cadab75752a7152ed2813c751 upstream.

    The sata on fsl mpc8315e is broken after the commit 8a4aeec8d2d6
    ("libata/ahci: accommodate tag ordered controllers"). The reason is
    that the ata controller on this SoC only implement a queue depth of
    16. When issuing the commands in tag order, all the commands in tag
    16 ~ 31 are mapped to tag 0 unconditionally and then causes the sata
    malfunction. It makes no senses to use a 32 queue in software while
    the hardware has less queue depth. So consider the queue depth
    implemented by the hardware when requesting a command tag.

    Fixes: 8a4aeec8d2d6 ("libata/ahci: accommodate tag ordered controllers")
    Signed-off-by: Kevin Hao
    Acked-by: Dan Williams
    Signed-off-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman

    Kevin Hao
     
  • commit d45b3279a5a2252cafcd665bbf2db8c9b31ef783 upstream.

    There is no inherent reason why the last put of a tag structure must be
    the one for the Scsi_Host, as device model objects can be held for
    arbitrary periods. Merge blk_free_tags and __blk_free_tags into a single
    funtion that just release a references and get rid of the BUG() when the
    host reference wasn't the last.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Christoph Hellwig
     
  • commit 3b3a1814d1703027f9867d0f5cbbfaf6c7482474 upstream.

    This patch provides the compat BLKZEROOUT ioctl. The argument is a pointer
    to two uint64_t values, so there is no need to translate it.

    Signed-off-by: Mikulas Patocka
    Acked-by: Martin K. Petersen
    Signed-off-by: Jens Axboe
    Signed-off-by: Greg Kroah-Hartman

    Mikulas Patocka
     
  • commit be6ae382dc153da51cf066c8dd523aa955f02531 upstream.

    When sysmem reservation occurs exactly at the end of an existing block
    that block is deleted, because it is incorrectly included in the range
    of memblocks to remove. Fix that by skipping such block.

    Signed-off-by: Max Filippov
    Signed-off-by: Greg Kroah-Hartman

    Max Filippov
     
  • commit 74adf83f5d7720925499b4938f930591f947b660 upstream.

    The big ACL switched nfs to use generic_listxattr, which calls all existing
    ->list handlers. Add a custom .listxattr implementation that only lists
    the ACLs if they actually are present on the given inode.

    Signed-off-by: Christoph Hellwig
    Reported-by: Philippe Troin
    Tested-by: Philippe Troin
    Fixes: 013cdf1088d7 (nfs: use generic posix ACL infrastructure ...)
    Signed-off-by: Trond Myklebust
    Signed-off-by: Greg Kroah-Hartman

    Christoph Hellwig
     
  • commit db4175ae2095634dbecd4c847da439f9c83e1b3b upstream.

    Only supported modulation for DVB-S is QPSK. Modulation parameter
    contains invalid value for DVB-S on some cases, which leads driver
    refusing tuning attempt. Due to that, hard code modulation to QPSK
    in case of DVB-S.

    Signed-off-by: Antti Palosaari
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Antti Palosaari
     
  • commit 3445857b22eafb70a6ac258979e955b116bfd2c6 upstream.

    When the audio encoding is changed the driver calls hdpvr_set_audio
    with the current opt->audio_input value. However, that should have
    been opt->audio_input + 1. So changing the audio encoding inadvertently
    changes the input as well. This bug has always been there.

    The second bug was introduced in kernel 3.10 and that broke the
    default_audio_input module option handling: the audio encoding was
    never switched to AC3 if default_audio_input was set to 2 (SPDIF input).

    In addition, since starting with 3.10 the audio encoding is always set
    at the start the first bug now always happens when the driver is loaded.
    In the past this bug would only surface if the user would change the
    audio encoding after the driver was loaded.

    Also fixes a small trivial typo (bufffer -> buffer).

    Signed-off-by: Hans Verkuil
    Reported-by: Scott Doty
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Hans Verkuil
     
  • commit 1cbbf90d0406913ad4b44194b07f4f41bde84e54 upstream.

    Tuner ID set into EEPROM is wrong in some cases, which causes driver
    to select wrong tuner profile. That leads device non-working. Fix
    issue by overriding known bad tuner IDs with suitable default value.

    Thanks to MX-NET Telekomunikace s.r.o. for providing non-working
    DTV stick, that I could fix the bug!

    Signed-off-by: Antti Palosaari
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Antti Palosaari
     
  • commit f71920efb1066d71d74811e1dbed658173adf9bf upstream.

    Wrong value used in same cases for the aspect ratio.

    Signed-off-by: Rickard Strandqvist
    Acked-by: Lad, Prabhakar
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Rickard Strandqvist
     
  • commit 4856fbd12d69965d3ab680c686222db93872728d upstream.

    The OMAP4 camera support depends on I2C and VIDEO_V4L2, both
    of which can be loadable modules. This causes build failures
    if we want the camera driver to be built-in.

    This can be solved by turning the option into "tristate",
    which unfortunately causes another problem, because the
    driver incorrectly calls a platform-internal interface
    for omap4_ctrl_pad_readl/omap4_ctrl_pad_writel.

    Instead, this patch just forbids the invalid configurations
    and ensures that the driver can only be built if all its
    dependencies are built-in.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

28 Jul, 2014

2 commits