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.x #10

Merged
merged 279 commits into from
Mar 29, 2017
Merged

4.4.x #10

merged 279 commits into from
Mar 29, 2017
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Feb 18, 2017

  1. ipv6: tcp: add a missing tcp_v6_restore_cb()

    [ Upstream commit ebf6c9c ]
    
    Dmitry reported use-after-free in ip6_datagram_recv_specific_ctl()
    
    A similar bug was fixed in commit 8ce4862 ("ipv6: tcp: restore
    IP6CB for pktoptions skbs"), but I missed another spot.
    
    tcp_v6_syn_recv_sock() can indeed set np->pktoptions from ireq->pktopts
    
    Fixes: 971f10e ("tcp: better TCP_SKB_CB layout to reduce cache line misses")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    96ada0a View commit details
    Browse the repository at this point in the history
  2. tcp: avoid infinite loop in tcp_splice_read()

    [ Upstream commit ccf7abb ]
    
    Splicing from TCP socket is vulnerable when a packet with URG flag is
    received and stored into receive queue.
    
    __tcp_splice_read() returns 0, and sk_wait_data() immediately
    returns since there is the problematic skb in queue.
    
    This is a nice way to burn cpu (aka infinite loop) and trigger
    soft lockups.
    
    Again, this gem was found by syzkaller tool.
    
    Fixes: 9c55e01 ("[TCP]: Splice receive support.")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Dmitry Vyukov  <[email protected]>
    Cc: Willy Tarreau <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    82e9f6b View commit details
    Browse the repository at this point in the history
  3. tun: read vnet_hdr_sz once

    [ Upstream commit e1edab8 ]
    
    When IFF_VNET_HDR is enabled, a virtio_net header must precede data.
    Data length is verified to be greater than or equal to expected header
    length tun->vnet_hdr_sz before copying.
    
    Read this value once and cache locally, as it can be updated between
    the test and use (TOCTOU).
    
    Signed-off-by: Willem de Bruijn <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    CC: Eric Dumazet <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wdebruij authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    625bd9e View commit details
    Browse the repository at this point in the history
  4. macvtap: read vnet_hdr_size once

    [ Upstream commit 837585a ]
    
    When IFF_VNET_HDR is enabled, a virtio_net header must precede data.
    Data length is verified to be greater than or equal to expected header
    length tun->vnet_hdr_sz before copying.
    
    Macvtap functions read the value once, but unless READ_ONCE is used,
    the compiler may ignore this and read multiple times. Enforce a single
    read and locally cached value to avoid updates between test and use.
    
    Signed-off-by: Willem de Bruijn <[email protected]>
    Suggested-by: Eric Dumazet <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wdebruij authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    0db2509 View commit details
    Browse the repository at this point in the history
  5. mlx4: Invoke softirqs after napi_reschedule

    [ Upstream commit bd4ce94 ]
    
    mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run
    in a deterministic time frame and the following message may be logged:
    NOHZ: local_softirq_pending 08
    
    The problem is the same as what was described in commit ec13ee8
    ("virtio_net: invoke softirqs after __napi_schedule") and this patch
    applies the same fix to mlx4.
    
    Fixes: 07841f9 ("net/mlx4_en: Schedule napi when RX buffers allocation fails")
    Cc: Eric Dumazet <[email protected]>
    Signed-off-by: Benjamin Poirier <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Reviewed-by: Tariq Toukan <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    gobenji authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    f46f344 View commit details
    Browse the repository at this point in the history
  6. sctp: avoid BUG_ON on sctp_wait_for_sndbuf

    [ Upstream commit 2dcab59 ]
    
    Alexander Popov reported that an application may trigger a BUG_ON in
    sctp_wait_for_sndbuf if the socket tx buffer is full, a thread is
    waiting on it to queue more data and meanwhile another thread peels off
    the association being used by the first thread.
    
    This patch replaces the BUG_ON call with a proper error handling. It
    will return -EPIPE to the original sendmsg call, similarly to what would
    have been done if the association wasn't found in the first place.
    
    Acked-by: Alexander Popov <[email protected]>
    Signed-off-by: Marcelo Ricardo Leitner <[email protected]>
    Reviewed-by: Xin Long <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    marceloleitner authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    a4226c7 View commit details
    Browse the repository at this point in the history
  7. sit: fix a double free on error path

    [ Upstream commit d7426c6 ]
    
    Dmitry reported a double free in sit_init_net():
    
      kernel BUG at mm/percpu.c:689!
      invalid opcode: 0000 [Freescale#1] SMP KASAN
      Dumping ftrace buffer:
         (ftrace buffer empty)
      Modules linked in:
      CPU: 0 PID: 15692 Comm: syz-executor1 Not tainted 4.10.0-rc6-next-20170206 Freescale#1
      Hardware name: Google Google Compute Engine/Google Compute Engine,
      BIOS Google 01/01/2011
      task: ffff8801c9cc27c0 task.stack: ffff88017d1d8000
      RIP: 0010:pcpu_free_area+0x68b/0x810 mm/percpu.c:689
      RSP: 0018:ffff88017d1df488 EFLAGS: 00010046
      RAX: 0000000000010000 RBX: 00000000000007c0 RCX: ffffc90002829000
      RDX: 0000000000010000 RSI: ffffffff81940efb RDI: ffff8801db841d94
      RBP: ffff88017d1df590 R08: dffffc0000000000 R09: 1ffffffff0bb3bdd
      R10: dffffc0000000000 R11: 00000000000135dd R12: ffff8801db841d80
      R13: 0000000000038e40 R14: 00000000000007c0 R15: 00000000000007c0
      FS:  00007f6ea608f700(0000) GS:ffff8801dbe00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000000002000aff8 CR3: 00000001c8d44000 CR4: 00000000001426f0
      DR0: 0000000020000000 DR1: 0000000020000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
      Call Trace:
       free_percpu+0x212/0x520 mm/percpu.c:1264
       ipip6_dev_free+0x43/0x60 net/ipv6/sit.c:1335
       sit_init_net+0x3cb/0xa10 net/ipv6/sit.c:1831
       ops_init+0x10a/0x530 net/core/net_namespace.c:115
       setup_net+0x2ed/0x690 net/core/net_namespace.c:291
       copy_net_ns+0x26c/0x530 net/core/net_namespace.c:396
       create_new_namespaces+0x409/0x860 kernel/nsproxy.c:106
       unshare_nsproxy_namespaces+0xae/0x1e0 kernel/nsproxy.c:205
       SYSC_unshare kernel/fork.c:2281 [inline]
       SyS_unshare+0x64e/0xfc0 kernel/fork.c:2231
       entry_SYSCALL_64_fastpath+0x1f/0xc2
    
    This is because when tunnel->dst_cache init fails, we free dev->tstats
    once in ipip6_tunnel_init() and twice in sit_init_net(). This looks
    redundant but its ndo_uinit() does not seem enough to clean up everything
    here. So avoid this by setting dev->tstats to NULL after the first free,
    at least for -net.
    
    Reported-by: Dmitry Vyukov <[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 Feb 18, 2017
    Configuration menu
    Copy the full SHA
    6f99825 View commit details
    Browse the repository at this point in the history
  8. net: introduce device min_header_len

    [ Upstream commit 217e6fa ]
    
    The stack must not pass packets to device drivers that are shorter
    than the minimum link layer header length.
    
    Previously, packet sockets would drop packets smaller than or equal
    to dev->hard_header_len, but this has false positives. Zero length
    payload is used over Ethernet. Other link layer protocols support
    variable length headers. Support for validation of these protocols
    removed the min length check for all protocols.
    
    Introduce an explicit dev->min_header_len parameter and drop all
    packets below this value. Initially, set it to non-zero only for
    Ethernet and loopback. Other protocols can follow in a patch to
    net-next.
    
    Fixes: 9ed988c ("packet: validate variable length ll headers")
    Reported-by: Sowmini Varadhan <[email protected]>
    Signed-off-by: Willem de Bruijn <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Acked-by: Sowmini Varadhan <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wdebruij authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    58691e5 View commit details
    Browse the repository at this point in the history
  9. packet: round up linear to header len

    [ Upstream commit 57031eb ]
    
    Link layer protocols may unconditionally pull headers, as Ethernet
    does in eth_type_trans. Ensure that the entire link layer header
    always lies in the skb linear segment. tpacket_snd has such a check.
    Extend this to packet_snd.
    
    Variable length link layer headers complicate the computation
    somewhat. Here skb->len may be smaller than dev->hard_header_len.
    
    Round up the linear length to be at least as long as the smallest of
    the two.
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: Willem de Bruijn <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wdebruij authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    9117c89 View commit details
    Browse the repository at this point in the history
  10. ping: fix a null pointer dereference

    [ Upstream commit 73d2c66 ]
    
    Andrey reported a kernel crash:
    
      general protection fault: 0000 [Freescale#1] SMP KASAN
      Dumping ftrace buffer:
         (ftrace buffer empty)
      Modules linked in:
      CPU: 2 PID: 3880 Comm: syz-executor1 Not tainted 4.10.0-rc6+ Freescale#124
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
      task: ffff880060048040 task.stack: ffff880069be8000
      RIP: 0010:ping_v4_push_pending_frames net/ipv4/ping.c:647 [inline]
      RIP: 0010:ping_v4_sendmsg+0x1acd/0x23f0 net/ipv4/ping.c:837
      RSP: 0018:ffff880069bef8b8 EFLAGS: 00010206
      RAX: dffffc0000000000 RBX: ffff880069befb90 RCX: 0000000000000000
      RDX: 0000000000000018 RSI: ffff880069befa30 RDI: 00000000000000c2
      RBP: ffff880069befbb8 R08: 0000000000000008 R09: 0000000000000000
      R10: 0000000000000002 R11: 0000000000000000 R12: ffff880069befab0
      R13: ffff88006c624a80 R14: ffff880069befa70 R15: 0000000000000000
      FS:  00007f6f7c716700(0000) GS:ffff88006de00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000004a6f28 CR3: 000000003a134000 CR4: 00000000000006e0
      Call Trace:
       inet_sendmsg+0x164/0x5b0 net/ipv4/af_inet.c:744
       sock_sendmsg_nosec net/socket.c:635 [inline]
       sock_sendmsg+0xca/0x110 net/socket.c:645
       SYSC_sendto+0x660/0x810 net/socket.c:1687
       SyS_sendto+0x40/0x50 net/socket.c:1655
       entry_SYSCALL_64_fastpath+0x1f/0xc2
    
    This is because we miss a check for NULL pointer for skb_peek() when
    the queue is empty. Other places already have the same check.
    
    Fixes: c319b4d ("net: ipv4: add IPPROTO_ICMP socket kind")
    Reported-by: Andrey Konovalov <[email protected]>
    Tested-by: Andrey Konovalov <[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 Feb 18, 2017
    Configuration menu
    Copy the full SHA
    afb4feb View commit details
    Browse the repository at this point in the history
  11. l2tp: do not use udp_ioctl()

    [ Upstream commit 72fb96e ]
    
    udp_ioctl(), as its name suggests, is used by UDP protocols,
    but is also used by L2TP :(
    
    L2TP should use its own handler, because it really does not
    look the same.
    
    SIOCINQ for instance should not assume UDP checksum or headers.
    
    Thanks to Andrey and syzkaller team for providing the report
    and a nice reproducer.
    
    While crashes only happen on recent kernels (after commit
    7c13f97 ("udp: do fwd memory scheduling on dequeue")), this
    probably needs to be backported to older kernels.
    
    Fixes: 7c13f97 ("udp: do fwd memory scheduling on dequeue")
    Fixes: 8558467 ("udp: Fix udp_poll() and ioctl()")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Andrey Konovalov <[email protected]>
    Acked-by: Paolo Abeni <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    b9dee56 View commit details
    Browse the repository at this point in the history
  12. Linux 4.4.50

    gregkh committed Feb 18, 2017
    Configuration menu
    Copy the full SHA
    c50b74d View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2017

  1. vfs: fix uninitialized flags in splice_to_pipe()

    commit 5a81e6a upstream.
    
    Flags (PIPE_BUF_FLAG_PACKET, PIPE_BUF_FLAG_GIFT) could remain on the
    unused part of the pipe ring buffer.  Previously splice_to_pipe() left
    the flags value alone, which could result in incorrect behavior.
    
    Uninitialized flags appears to have been there from the introduction of
    the splice syscall.
    
    Signed-off-by: Miklos Szeredi <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Miklos Szeredi authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    f940011 View commit details
    Browse the repository at this point in the history
  2. siano: make it work again with CONFIG_VMAP_STACK

    commit f9c85ee upstream.
    
    Reported as a Kaffeine bug:
    	https://bugs.kde.org/show_bug.cgi?id=375811
    
    The USB control messages require DMA to work. We cannot pass
    a stack-allocated buffer, as it is not warranted that the
    stack would be into a DMA enabled area.
    
    On Kernel 4.9, the default is to not accept DMA on stack anymore
    on x86 architecture. On other architectures, this has been a
    requirement since Kernel 2.2. So, after this patch, this driver
    should likely work fine on all archs.
    
    Tested with USB ID 2040:5510: Hauppauge Windham
    
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mchehab authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    385a592 View commit details
    Browse the repository at this point in the history
  3. fuse: fix use after free issue in fuse_dev_do_read()

    commit 6ba4d27 upstream.
    
    There is a potential race between fuse_dev_do_write()
    and request_wait_answer() contexts as shown below:
    
    TASK 1:
    __fuse_request_send():
      |--spin_lock(&fiq->waitq.lock);
      |--queue_request();
      |--spin_unlock(&fiq->waitq.lock);
      |--request_wait_answer():
           |--if (test_bit(FR_SENT, &req->flags))
           <gets pre-empted after it is validated true>
                                       TASK 2:
                                       fuse_dev_do_write():
                                         |--clears bit FR_SENT,
                                         |--request_end():
                                            |--sets bit FR_FINISHED
                                            |--spin_lock(&fiq->waitq.lock);
                                            |--list_del_init(&req->intr_entry);
                                            |--spin_unlock(&fiq->waitq.lock);
                                            |--fuse_put_request();
           |--queue_interrupt();
           <request gets queued to interrupts list>
                |--wake_up_locked(&fiq->waitq);
           |--wait_event_freezable();
           <as FR_FINISHED is set, it returns and then
           the caller frees this request>
    
    Now, the next fuse_dev_do_read(), see interrupts list is not empty
    and then calls fuse_read_interrupt() which tries to access the request
    which is already free'd and gets the below crash:
    
    [11432.401266] Unable to handle kernel paging request at virtual address
    6b6b6b6b6b6b6b6b
    ...
    [11432.418518] Kernel BUG at ffffff80083720e0
    [11432.456168] PC is at __list_del_entry+0x6c/0xc4
    [11432.463573] LR is at fuse_dev_do_read+0x1ac/0x474
    ...
    [11432.679999] [<ffffff80083720e0>] __list_del_entry+0x6c/0xc4
    [11432.687794] [<ffffff80082c65e0>] fuse_dev_do_read+0x1ac/0x474
    [11432.693180] [<ffffff80082c6b14>] fuse_dev_read+0x6c/0x78
    [11432.699082] [<ffffff80081d5638>] __vfs_read+0xc0/0xe8
    [11432.704459] [<ffffff80081d5efc>] vfs_read+0x90/0x108
    [11432.709406] [<ffffff80081d67f0>] SyS_read+0x58/0x94
    
    As FR_FINISHED bit is set before deleting the intr_entry with input
    queue lock in request completion path, do the testing of this flag and
    queueing atomically with the same lock in queue_interrupt().
    
    Signed-off-by: Sahitya Tummala <[email protected]>
    Signed-off-by: Miklos Szeredi <[email protected]>
    Fixes: fd22d62 ("fuse: no fc->lock for iqueue parts")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Sahitya Tummala authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    d7b146c View commit details
    Browse the repository at this point in the history
  4. scsi: don't BUG_ON() empty DMA transfers

    commit fd3fc0b upstream.
    
    Don't crash the machine just because of an empty transfer. Use WARN_ON()
    combined with returning an error.
    
    Found by Dmitry Vyukov and syzkaller.
    
    [ Changed to "WARN_ON_ONCE()". Al has a patch that should fix the root
      cause, but a BUG_ON() is not acceptable in any case, and a WARN_ON()
      might still be a cause of excessive log spamming.
    
      NOTE! If this warning ever triggers, we may end up leaking resources,
      since this doesn't bother to try to clean the command up. So this
      WARN_ON_ONCE() triggering does imply real problems. But BUG_ON() is
      much worse.
    
      People really need to stop using BUG_ON() for "this shouldn't ever
      happen". It makes pretty much any bug worse.     - Linus ]
    
    Signed-off-by: Johannes Thumshirn <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Cc: James Bottomley <[email protected]>
    Cc: Al Viro <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Johannes Thumshirn authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    8107096 View commit details
    Browse the repository at this point in the history
  5. Fix missing sanity check in /dev/sg

    commit 137d01d upstream.
    
    What happens is that a write to /dev/sg is given a request with non-zero
    ->iovec_count combined with zero ->dxfer_len.  Or with ->dxferp pointing
    to an array full of empty iovecs.
    
    Having write permission to /dev/sg shouldn't be equivalent to the
    ability to trigger BUG_ON() while holding spinlocks...
    
    Found by Dmitry Vyukov and syzkaller.
    
    [ The BUG_ON() got changed to a WARN_ON_ONCE(), but this fixes the
      underlying issue.  - Linus ]
    
    Signed-off-by: Al Viro <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Al Viro authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    65de8bf View commit details
    Browse the repository at this point in the history
  6. Input: elan_i2c - add ELAN0605 to the ACPI table

    commit 722c5ac upstream.
    
    ELAN0605 has been confirmed to be a variant of ELAN0600, which is
    blacklisted in the hid-core to be managed by elan_i2c. This device can be
    found in Lenovo ideapad 310s (80U4000).
    
    Signed-off-by: Hiroka IHARA <[email protected]>
    Signed-off-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ihr486 authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    c6cbae4 View commit details
    Browse the repository at this point in the history
  7. drm/radeon: Use mode h/vdisplay fields to hide out of bounds HW cursor

    commit d74c67d upstream.
    
    The crtc_h/vdisplay fields may not match the CRTC viewport dimensions
    with special modes such as interlaced ones.
    
    Fixes the HW cursor disappearing in the bottom half of the screen with
    interlaced modes.
    
    Fixes: 6b16cf7 ("drm/radeon: Hide the HW cursor while it's out of bounds")
    Reported-by: Ashutosh Kumar <[email protected]>
    Tested-by: Sonny Jiang <[email protected]>
    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 Feb 23, 2017
    Configuration menu
    Copy the full SHA
    b321283 View commit details
    Browse the repository at this point in the history
  8. drm/dp/mst: fix kernel oops when turning off secondary monitor

    commit bb08c04 upstream.
    
    100% reproducible issue found on SKL SkullCanyon NUC with two external
    DP daisy-chained monitors in DP/MST mode. When turning off or changing
    the input of the second monitor the machine stops with a kernel
    oops. This issue happened with 4.8.8 as well as drm/drm-intel-nightly.
    
    This issue is traced to an inconsistent control flow in
    drm_dp_update_payload_part1(): the 'port' pointer is set to NULL at the
    same time as 'req_payload.num_slots' is set to zero, but the pointer is
    dereferenced even when req_payload.num_slot is zero.
    
    The problematic dereference was introduced in commit dfda0df
    ("drm/mst: rework payload table allocation to conform better") and may
    impact all versions since v3.18
    
    The fix suggested by Chris Wilson removes the kernel oops and was found to
    work well after 10mn of monkey-testing with the second monitor power and
    input buttons
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98990
    Fixes: dfda0df ("drm/mst: rework payload table allocation to conform better.")
    Cc: Dave Airlie <[email protected]>
    Cc: Chris Wilson <[email protected]>
    Cc: Nathan D Ciobanu <[email protected]>
    Cc: Dhinakaran Pandiyan <[email protected]>
    Cc: Sean Paul <[email protected]>
    Tested-by: Nathan D Ciobanu <[email protected]>
    Reviewed-by: Dhinakaran Pandiyan <[email protected]>
    Signed-off-by: Pierre-Louis Bossart <[email protected]>
    Signed-off-by: Jani Nikula <[email protected]>
    Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    plbossart authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    906bb56 View commit details
    Browse the repository at this point in the history
  9. futex: Move futex_init() to core_initcall

    commit 25f71d1 upstream.
    
    The UEVENT user mode helper is enabled before the initcalls are executed
    and is available when the root filesystem has been mounted.
    
    The user mode helper is triggered by device init calls and the executable
    might use the futex syscall.
    
    futex_init() is marked __initcall which maps to device_initcall, but there
    is no guarantee that futex_init() is invoked _before_ the first device init
    call which triggers the UEVENT user mode helper.
    
    If the user mode helper uses the futex syscall before futex_init() then the
    syscall crashes with a NULL pointer dereference because the futex subsystem
    has not been initialized yet.
    
    Move futex_init() to core_initcall so futexes are initialized before the
    root filesystem is mounted and the usermode helper becomes available.
    
    [ tglx: Rewrote changelog ]
    
    Signed-off-by: Yang Yang <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: Peter Zijlstra <[email protected]>
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Thomas Gleixner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    yangyang20220519 authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    e6394c7 View commit details
    Browse the repository at this point in the history
  10. ARM: 8658/1: uaccess: fix zeroing of 64-bit get_user()

    commit 9e34404 upstream.
    
    The 64-bit get_user() wasn't clearing the high word due to a typo in the
    error handler. The exception handler entry was already correct, though.
    Noticed during recent usercopy test additions in lib/test_user_copy.c.
    
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: Russell King <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kees authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    6787d3e View commit details
    Browse the repository at this point in the history
  11. printk: use rcuidle console tracepoint

    commit fc98c3c upstream.
    
    Use rcuidle console tracepoint because, apparently, it may be issued
    from an idle CPU:
    
      hw-breakpoint: Failed to enable monitor mode on CPU 0.
      hw-breakpoint: CPU 0 failed to disable vector catch
    
      ===============================
      [ ERR: suspicious RCU usage.  ]
      4.10.0-rc8-next-20170215+ Freescale#119 Not tainted
      -------------------------------
      ./include/trace/events/printk.h:32 suspicious rcu_dereference_check() usage!
    
      other info that might help us debug this:
    
      RCU used illegally from idle CPU!
      rcu_scheduler_active = 2, debug_locks = 0
      RCU used illegally from extended quiescent state!
      2 locks held by swapper/0/0:
       #0:  (cpu_pm_notifier_lock){......}, at: [<c0237e2c>] cpu_pm_exit+0x10/0x54
       Freescale#1:  (console_lock){+.+.+.}, at: [<c01ab350>] vprintk_emit+0x264/0x474
    
      stack backtrace:
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.10.0-rc8-next-20170215+ Freescale#119
      Hardware name: Generic OMAP4 (Flattened Device Tree)
        console_unlock
        vprintk_emit
        vprintk_default
        printk
        reset_ctrl_regs
        dbg_cpu_pm_notify
        notifier_call_chain
        cpu_pm_exit
        omap_enter_idle_coupled
        cpuidle_enter_state
        cpuidle_enter_state_coupled
        do_idle
        cpu_startup_entry
        start_kernel
    
    This RCU warning, however, is suppressed by lockdep_off() in printk().
    lockdep_off() increments the ->lockdep_recursion counter and thus
    disables RCU_LOCKDEP_WARN() and debug_lockdep_rcu_enabled(), which want
    lockdep to be enabled "current->lockdep_recursion == 0".
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Sergey Senozhatsky <[email protected]>
    Reported-by: Tony Lindgren <[email protected]>
    Tested-by: Tony Lindgren <[email protected]>
    Acked-by: Paul E. McKenney <[email protected]>
    Acked-by: Steven Rostedt (VMware) <[email protected]>
    Cc: Petr Mladek <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Cc: Tony Lindgren <[email protected]>
    Cc: Russell King <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sergey-senozhatsky authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    efa0619 View commit details
    Browse the repository at this point in the history
  12. NTB: ntb_transport: fix debugfs_remove_recursive

    commit dd62245 upstream.
    
    The call to debugfs_remove_recursive(qp->debugfs_dir) of the sub-level
    directory must not be later than
    debugfs_remove_recursive(nt_debugfs_dir) of the top-level directory.
    Otherwise, the sub-level directory will not exist, and it would be
    invalid (panic) to attempt to remove it.  This removes the top-level
    directory last, after sub-level directories have been cleaned up.
    
    Signed-off-by: Allen Hubbe <[email protected]>
    Fixes: e26a584 ("NTB: Split ntb_hw_intel and ntb_transport drivers")
    Signed-off-by: Jon Mason <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Allen Hubbe authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    c6c6851 View commit details
    Browse the repository at this point in the history
  13. ntb_transport: Pick an unused queue

    commit 8fcd095 upstream.
    
    Fix typo causing ntb_transport_create_queue to select the first
    queue every time, instead of using the next free queue.
    
    Signed-off-by: Thomas VanSelus <[email protected]>
    Signed-off-by: Aaron Sierra <[email protected]>
    Acked-by: Allen Hubbe <[email protected]>
    Fixes: fce8a7b ("PCI-Express Non-Transparent Bridge Support")
    Signed-off-by: Jon Mason <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Thomas VanSelus authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    aee7d04 View commit details
    Browse the repository at this point in the history
  14. bcache: Make gc wakeup sane, remove set_task_state()

    commit be628be upstream.
    
    Signed-off-by: Kent Overstreet <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    koverstreet authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    6f26f0b View commit details
    Browse the repository at this point in the history
  15. mmc: core: fix multi-bit bus width without high-speed mode

    commit 3d4ef32 upstream.
    
    Commit 577fb13 ("mmc: rework selection of bus speed mode")
    refactored bus width selection code to mmc_select_bus_width().
    
    However, it also altered the behavior to not call the selection code in
    non-high-speed modes anymore.
    
    This causes 1-bit mode to always be used when the high-speed mode is not
    enabled, even though 4-bit and 8-bit bus are valid bus widths in the
    backwards-compatibility (legacy) mode as well (see e.g. 5.3.2 Bus Speed
    Modes in JEDEC 84-B50). This results in a significant regression in
    transfer speeds.
    
    Fix the code to allow 4-bit and 8-bit widths even without high-speed
    mode, as before.
    
    Tested with a Zynq-7000 PicoZed 7020 board.
    
    Fixes: 577fb13 ("mmc: rework selection of bus speed mode")
    Signed-off-by: Anssi Hannula <[email protected]>
    Signed-off-by: Ulf Hansson <[email protected]>
    [[email protected]: backported for the different err variable
     check on v4.4 and tested]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    anssih authored and gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    5a86b11 View commit details
    Browse the repository at this point in the history
  16. Linux 4.4.51

    gregkh committed Feb 23, 2017
    Configuration menu
    Copy the full SHA
    f1924ac View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2017

  1. rtlwifi: rtl_usb: Fix missing entry in USB driver's private data

    commit 60f59ce upstream.
    
    These drivers need to be able to reference "struct ieee80211_hw" from
    the driver's private data, and vice versa. The USB driver failed to
    store the address of ieee80211_hw in the private data. Although this
    bug has been present for a long time, it was not exposed until
    commit ba9f93f ("rtlwifi: Fix enter/exit power_save").
    
    Fixes: ba9f93f ("rtlwifi: Fix enter/exit power_save")
    Signed-off-by: Larry Finger <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Cc: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    lwfinger authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    a82ac39 View commit details
    Browse the repository at this point in the history
  2. rtc: interface: ignore expired timers when enqueuing new timers

    commit 2b2f5ff upstream.
    
    This patch fixes a RTC wakealarm issue, namely, the event fires during
    hibernate and is not cleared from the list, causing hwclock to block.
    
    The current enqueuing does not trigger an alarm if any expired timers
    already exist on the timerqueue. This can occur when a RTC wake alarm
    is used to wake a machine out of hibernate and the resumed state has
    old expired timers that have not been removed from the timer queue.
    This fix skips over any expired timers and triggers an alarm if there
    are no pending timers on the timerqueue. Note that the skipped expired
    timer will get reaped later on, so there is no need to clean it up
    immediately.
    
    The issue can be reproduced by putting a machine into hibernate and
    waking it with the RTC wakealarm.  Running the example RTC test program
    from tools/testing/selftests/timers/rtctest.c after the hibernate will
    block indefinitely.  With the fix, it no longer blocks after the
    hibernate resume.
    
    BugLink: http://bugs.launchpad.net/bugs/1333569
    
    Signed-off-by: Colin Ian King <[email protected]>
    Signed-off-by: Alexandre Belloni <[email protected]>
    Cc: Sumit Semwal <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Colin Ian King authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    f0414c1 View commit details
    Browse the repository at this point in the history
  3. blk-mq: really fix plug list flushing for nomerge queues

    commit 87c279e upstream.
    
    Commit 0809e3a ("block: fix plug list flushing for nomerge queues")
    updated blk_mq_make_request() to set request_count even when
    blk_queue_nomerges() returns true. However, blk_mq_make_request() only
    does limited plugging and doesn't use request_count;
    blk_sq_make_request() is the one that should have been fixed. Do that
    and get rid of the unnecessary work in the mq version.
    
    Fixes: 0809e3a ("block: fix plug list flushing for nomerge queues")
    Signed-off-by: Omar Sandoval <[email protected]>
    Reviewed-by: Ming Lei <[email protected]>
    Reviewed-by: Jeff Moyer <[email protected]>
    Signed-off-by: Jens Axboe <[email protected]>
    Cc: Sumit Semwal <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    osandov authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    e8330cb View commit details
    Browse the repository at this point in the history
  4. net/llc: avoid BUG_ON() in skb_orphan()

    [ Upstream commit 8b74d43 ]
    
    It seems nobody used LLC since linux-3.12.
    
    Fortunately fuzzers like syzkaller still know how to run this code,
    otherwise it would be no fun.
    
    Setting skb->sk without skb->destructor leads to all kinds of
    bugs, we now prefer to be very strict about it.
    
    Ideally here we would use skb_set_owner() but this helper does not exist yet,
    only CAN seems to have a private helper for that.
    
    Fixes: 376c731 ("net: add a temporary sanity check in skb_orphan()")
    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 Feb 26, 2017
    Configuration menu
    Copy the full SHA
    2b3eb43 View commit details
    Browse the repository at this point in the history
  5. packet: fix races in fanout_add()

    [ Upstream commit d199fab ]
    
    Multiple threads can call fanout_add() at the same time.
    
    We need to grab fanout_mutex earlier to avoid races that could
    lead to one thread freeing po->rollover that was set by another thread.
    
    Do the same in fanout_release(), for peace of mind, and to help us
    finding lockdep issues earlier.
    
    Fixes: dc99f60 ("packet: Add fanout support.")
    Fixes: 0648ab7 ("packet: rollover prepare: per-socket state")
    Signed-off-by: Eric Dumazet <[email protected]>
    Cc: 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 Feb 26, 2017
    Configuration menu
    Copy the full SHA
    abd672d View commit details
    Browse the repository at this point in the history
  6. packet: Do not call fanout_release from atomic contexts

    [ Upstream commit 2bd624b ]
    
    Commit 6664498 ("packet: call fanout_release, while UNREGISTERING a
    netdev"), unfortunately, introduced the following issues.
    
    1. calling mutex_lock(&fanout_mutex) (fanout_release()) from inside
    rcu_read-side critical section. rcu_read_lock disables preemption, most often,
    which prohibits calling sleeping functions.
    
    [  ] include/linux/rcupdate.h:560 Illegal context switch in RCU read-side critical section!
    [  ]
    [  ] rcu_scheduler_active = 1, debug_locks = 0
    [  ] 4 locks held by ovs-vswitchd/1969:
    [  ]  #0:  (cb_lock){++++++}, at: [<ffffffff8158a6c9>] genl_rcv+0x19/0x40
    [  ]  Freescale#1:  (ovs_mutex){+.+.+.}, at: [<ffffffffa04878ca>] ovs_vport_cmd_del+0x4a/0x100 [openvswitch]
    [  ]  Freescale#2:  (rtnl_mutex){+.+.+.}, at: [<ffffffff81564157>] rtnl_lock+0x17/0x20
    [  ]  Freescale#3:  (rcu_read_lock){......}, at: [<ffffffff81614165>] packet_notifier+0x5/0x3f0
    [  ]
    [  ] Call Trace:
    [  ]  [<ffffffff813770c1>] dump_stack+0x85/0xc4
    [  ]  [<ffffffff810c9077>] lockdep_rcu_suspicious+0x107/0x110
    [  ]  [<ffffffff810a2da7>] ___might_sleep+0x57/0x210
    [  ]  [<ffffffff810a2fd0>] __might_sleep+0x70/0x90
    [  ]  [<ffffffff8162e80c>] mutex_lock_nested+0x3c/0x3a0
    [  ]  [<ffffffff810de93f>] ? vprintk_default+0x1f/0x30
    [  ]  [<ffffffff81186e88>] ? printk+0x4d/0x4f
    [  ]  [<ffffffff816106dd>] fanout_release+0x1d/0xe0
    [  ]  [<ffffffff81614459>] packet_notifier+0x2f9/0x3f0
    
    2. calling mutex_lock(&fanout_mutex) inside spin_lock(&po->bind_lock).
    "sleeping function called from invalid context"
    
    [  ] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
    [  ] in_atomic(): 1, irqs_disabled(): 0, pid: 1969, name: ovs-vswitchd
    [  ] INFO: lockdep is turned off.
    [  ] Call Trace:
    [  ]  [<ffffffff813770c1>] dump_stack+0x85/0xc4
    [  ]  [<ffffffff810a2f52>] ___might_sleep+0x202/0x210
    [  ]  [<ffffffff810a2fd0>] __might_sleep+0x70/0x90
    [  ]  [<ffffffff8162e80c>] mutex_lock_nested+0x3c/0x3a0
    [  ]  [<ffffffff816106dd>] fanout_release+0x1d/0xe0
    [  ]  [<ffffffff81614459>] packet_notifier+0x2f9/0x3f0
    
    3. calling dev_remove_pack(&fanout->prot_hook), from inside
    spin_lock(&po->bind_lock) or rcu_read-side critical-section. dev_remove_pack()
    -> synchronize_net(), which might sleep.
    
    [  ] BUG: scheduling while atomic: ovs-vswitchd/1969/0x00000002
    [  ] INFO: lockdep is turned off.
    [  ] Call Trace:
    [  ]  [<ffffffff813770c1>] dump_stack+0x85/0xc4
    [  ]  [<ffffffff81186274>] __schedule_bug+0x64/0x73
    [  ]  [<ffffffff8162b8cb>] __schedule+0x6b/0xd10
    [  ]  [<ffffffff8162c5db>] schedule+0x6b/0x80
    [  ]  [<ffffffff81630b1d>] schedule_timeout+0x38d/0x410
    [  ]  [<ffffffff810ea3fd>] synchronize_sched_expedited+0x53d/0x810
    [  ]  [<ffffffff810ea6de>] synchronize_rcu_expedited+0xe/0x10
    [  ]  [<ffffffff8154eab5>] synchronize_net+0x35/0x50
    [  ]  [<ffffffff8154eae3>] dev_remove_pack+0x13/0x20
    [  ]  [<ffffffff8161077e>] fanout_release+0xbe/0xe0
    [  ]  [<ffffffff81614459>] packet_notifier+0x2f9/0x3f0
    
    4. fanout_release() races with calls from different CPU.
    
    To fix the above problems, remove the call to fanout_release() under
    rcu_read_lock(). Instead, call __dev_remove_pack(&fanout->prot_hook) and
    netdev_run_todo will be happy that &dev->ptype_specific list is empty. In order
    to achieve this, I moved dev_{add,remove}_pack() out of fanout_{add,release} to
    __fanout_{link,unlink}. So, call to {,__}unregister_prot_hook() will make sure
    fanout->prot_hook is removed as well.
    
    Fixes: 6664498 ("packet: call fanout_release, while UNREGISTERING a netdev")
    Reported-by: Eric Dumazet <[email protected]>
    Signed-off-by: Anoob Soman <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    anoobs authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    fe41cfb View commit details
    Browse the repository at this point in the history
  7. dccp: fix freeing skb too early for IPV6_RECVPKTINFO

    [ Upstream commit 5edabca ]
    
    In the current DCCP implementation an skb for a DCCP_PKT_REQUEST packet
    is forcibly freed via __kfree_skb in dccp_rcv_state_process if
    dccp_v6_conn_request successfully returns.
    
    However, if IPV6_RECVPKTINFO is set on a socket, the address of the skb
    is saved to ireq->pktopts and the ref count for skb is incremented in
    dccp_v6_conn_request, so skb is still in use. Nevertheless, it gets freed
    in dccp_rcv_state_process.
    
    Fix by calling consume_skb instead of doing goto discard and therefore
    calling __kfree_skb.
    
    Similar fixes for TCP:
    
    fb7e239 [TCP]: skb is unexpectedly freed.
    0aea76d tcp: SYN packets are now
    simply consumed
    
    Signed-off-by: Andrey Konovalov <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    xairy authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    a95df07 View commit details
    Browse the repository at this point in the history
  8. irda: Fix lockdep annotations in hashbin_delete().

    [ Upstream commit 4c03b86 ]
    
    A nested lock depth was added to the hasbin_delete() code but it
    doesn't actually work some well and results in tons of lockdep splats.
    
    Fix the code instead to properly drop the lock around the operation
    and just keep peeking the head of the hashbin queue.
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Tested-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    davem330 authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    353dd72 View commit details
    Browse the repository at this point in the history
  9. ip: fix IP_CHECKSUM handling

    [ Upstream commit ca4ef45 ]
    
    The skbs processed by ip_cmsg_recv() are not guaranteed to
    be linear e.g. when sending UDP packets over loopback with
    MSGMORE.
    Using csum_partial() on [potentially] the whole skb len
    is dangerous; instead be on the safe side and use skb_checksum().
    
    Thanks to syzkaller team to detect the issue and provide the
    reproducer.
    
    v1 -> v2:
     - move the variable declaration in a tighter scope
    
    Fixes: ad6f939 ("ip: Add offset parameter to ip_cmsg_recv")
    Reported-by: Andrey Konovalov <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Paolo Abeni authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    ce9ecb8 View commit details
    Browse the repository at this point in the history
  10. net: socket: fix recvmmsg not returning error from sock_error

    [ Upstream commit e623a9e ]
    
    Commit 34b88a6 ("net: Fix use after free in the recvmmsg exit path"),
    changed the exit path of recvmmsg to always return the datagrams
    variable and modified the error paths to set the variable to the error
    code returned by recvmsg if necessary.
    
    However in the case sock_error returned an error, the error code was
    then ignored, and recvmmsg returned 0.
    
    Change the error path of recvmmsg to correctly return the error code
    of sock_error.
    
    The bug was triggered by using recvmmsg on a CAN interface which was
    not up. Linux 4.6 and later return 0 in this case while earlier
    releases returned -ENETDOWN.
    
    Fixes: 34b88a6 ("net: Fix use after free in the recvmmsg exit path")
    Signed-off-by: Maxime Jayat <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Maxime Jayat authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    49ed630 View commit details
    Browse the repository at this point in the history
  11. tty: serial: msm: Fix module autoload

    commit abe81f3 upstream.
    
    If the driver is built as a module, autoload won't work because the module
    alias information is not filled. So user-space can't match the registered
    device with the corresponding module.
    
    Export the module alias information using the MODULE_DEVICE_TABLE() macro.
    
    Before this patch:
    
    $ modinfo drivers/tty/serial/msm_serial.ko | grep alias
    $
    
    After this patch:
    
    $ modinfo drivers/tty/serial/msm_serial.ko | grep alias
    alias:          of:N*T*Cqcom,msm-uartdmC*
    alias:          of:N*T*Cqcom,msm-uartdm
    alias:          of:N*T*Cqcom,msm-uartC*
    alias:          of:N*T*Cqcom,msm-uart
    
    Signed-off-by: Javier Martinez Canillas <[email protected]>
    Acked-by: Bjorn Andersson <[email protected]>
    Cc: stable <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Javier Martinez Canillas authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    04fae8a View commit details
    Browse the repository at this point in the history
  12. USB: serial: mos7840: fix another NULL-deref at open

    commit 5182c2c upstream.
    
    Fix another NULL-pointer dereference at open should a malicious device
    lack an interrupt-in endpoint.
    
    Note that the driver has a broken check for an interrupt-in endpoint
    which means that an interrupt URB has never even been submitted.
    
    Fixes: 3f54297 ("USB: Moschip 7840 USB-Serial Driver")
    Reviewed-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    1ae570a View commit details
    Browse the repository at this point in the history
  13. USB: serial: cp210x: add new IDs for GE Bx50v3 boards

    commit 9a59365 upstream.
    
    Add new USB IDs for cp2104/5 devices on Bx50v3 boards due to the design
    change.
    
    Signed-off-by: Ken Lin <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    yungching0725 authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    bcea8e9 View commit details
    Browse the repository at this point in the history
  14. USB: serial: ftdi_sio: fix modem-status error handling

    commit 427c3a9 upstream.
    
    Make sure to detect short responses when fetching the modem status in
    order to avoid parsing uninitialised buffer data and having bits of it
    leak to user space.
    
    Note that we still allow for short 1-byte responses.
    
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Reviewed-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    af82872 View commit details
    Browse the repository at this point in the history
  15. USB: serial: ftdi_sio: fix extreme low-latency setting

    commit c6dce26 upstream.
    
    Since commit 557aaa7 ("ft232: support the ASYNC_LOW_LATENCY
    flag") the FTDI driver has been using a receive latency-timer value of
    1 ms instead of the device default of 16 ms.
    
    The latency timer is used to periodically empty a non-full receive
    buffer, but a status header is always sent when the timer expires
    including when the buffer is empty. This means that a two-byte bulk
    message is received every millisecond also for an otherwise idle port as
    long as it is open.
    
    Let's restore the pre-2009 behaviour which reduces the rate of the
    status messages to 1/16th (e.g. interrupt frequency drops from 1 kHz to
    62.5 Hz) by not setting ASYNC_LOW_LATENCY by default.
    
    Anyone willing to pay the price for the minimum-latency behaviour should
    set the flag explicitly instead using the TIOCSSERIAL ioctl or a tool
    such as setserial (e.g. setserial /dev/ttyUSB0 low_latency).
    
    Note that since commit 0cbd81a ("USB: ftdi_sio: remove
    tty->low_latency") the ASYNC_LOW_LATENCY flag has no other effects but
    to set a minimal latency timer.
    
    Reported-by: Antoine Aubert <[email protected]>
    Fixes: 557aaa7 ("ft232: support the ASYNC_LOW_LATENCY flag")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    cfad081 View commit details
    Browse the repository at this point in the history
  16. USB: serial: ftdi_sio: fix line-status over-reporting

    commit a6bb1e1 upstream.
    
    FTDI devices use a receive latency timer to periodically empty the
    receive buffer and report modem and line status (also when the buffer is
    empty).
    
    When a break or error condition is detected the corresponding status
    flags will be set on a packet with nonzero data payload and the flags
    are not updated until the break is over or further characters are
    received.
    
    In order to avoid over-reporting break and error conditions, these flags
    must therefore only be processed for packets with payload.
    
    This specifically fixes the case where after an overrun, the error
    condition is continuously reported and NULL-characters inserted until
    further data is received.
    
    Reported-by: Michael Walle <[email protected]>
    Fixes: 72fda3c ("USB: serial: ftd_sio: implement sysrq handling on
    break")
    Fixes: 166ceb6 ("USB: ftdi_sio: clean up line-status handling")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    22034ee View commit details
    Browse the repository at this point in the history
  17. USB: serial: spcp8x5: fix modem-status handling

    commit 5ed8d41 upstream.
    
    Make sure to detect short control transfers and return zero on success
    when retrieving the modem status.
    
    This fixes the TIOCMGET implementation which since e1ed212 ("USB:
    spcp8x5: add proper modem-status support") has returned TIOCM_LE on
    successful retrieval, and avoids leaking bits from the stack on short
    transfers.
    
    This also fixes the carrier-detect implementation which since the above
    mentioned commit unconditionally has returned true.
    
    Fixes: e1ed212 ("USB: spcp8x5: add proper modem-status support")
    Reviewed-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    06b1cf3 View commit details
    Browse the repository at this point in the history
  18. USB: serial: opticon: fix CTS retrieval at open

    commit 2eee050 upstream.
    
    The opticon driver used a control request at open to trigger a CTS
    status notification to be sent over the bulk-in pipe. When the driver
    was converted to using the generic read implementation, an inverted test
    prevented this request from being sent, something which could lead to
    TIOCMGET reporting an incorrect CTS state.
    
    Reported-by: Dan Carpenter <[email protected]>
    Fixes: 7a6ee2b ("USB: opticon: switch to generic read implementation")
    Reviewed-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    b04a2ca View commit details
    Browse the repository at this point in the history
  19. USB: serial: ark3116: fix register-accessor error handling

    commit 9fef37d upstream.
    
    The current implementation failed to detect short transfers, something
    which could lead to bits of the uninitialised heap transfer buffer
    leaking to user space.
    
    Fixes: 149fc79 ("USB: ark3116: Setup some basic infrastructure for new ark3116 driver.")
    Fixes: f4c1e8d ("USB: ark3116: Make existing functions 16450-aware and add close and release functions.")
    Reviewed-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    67f47e5 View commit details
    Browse the repository at this point in the history
  20. x86/platform/goldfish: Prevent unconditional loading

    commit 47512cf upstream.
    
    The goldfish platform code registers the platform device unconditionally
    which causes havoc in several ways if the goldfish_pdev_bus driver is
    enabled:
    
     - Access to the hardcoded physical memory region, which is either not
       available or contains stuff which is completely unrelated.
    
     - Prevents that the interrupt of the serial port can be requested
    
     - In case of a spurious interrupt it goes into a infinite loop in the
       interrupt handler of the pdev_bus driver (which needs to be fixed
       seperately).
    
    Add a 'goldfish' command line option to make the registration opt-in when
    the platform is compiled in.
    
    I'm seriously grumpy about this engineering trainwreck, which has seven
    SOBs from Intel developers for 50 lines of code. And none of them figured
    out that this is broken. Impressive fail!
    
    Fixes: ddd70cf ("goldfish: platform device for x86")
    Reported-by: Gabriel C <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Acked-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    KAGA-KOKO authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    d7f9730 View commit details
    Browse the repository at this point in the history
  21. goldfish: Sanitize the broken interrupt handler

    commit 6cf18e6 upstream.
    
    This interrupt handler is broken in several ways:
    
      - It loops forever when the op code is not decodeable
    
      - It never returns IRQ_HANDLED because the only way to exit the loop
        returns IRQ_NONE unconditionally.
    
    The whole concept of this is broken. Creating devices in an interrupt
    handler is beyond any point of sanity.
    
    Make it at least behave halfways sane so accidental users do not have to
    deal with a hard to debug lockup.
    
    Fixes: e809c22 ("goldfish: add the goldfish virtual bus")
    Reported-by: Gabriel C <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Acked-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    KAGA-KOKO authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    1569697 View commit details
    Browse the repository at this point in the history
  22. block: fix double-free in the failure path of cgwb_bdi_init()

    commit 5f478e4 upstream.
    
    When !CONFIG_CGROUP_WRITEBACK, bdi has single bdi_writeback_congested
    at bdi->wb_congested.  cgwb_bdi_init() allocates it with kzalloc() and
    doesn't do further initialization.  This usually works fine as the
    reference count gets bumped to 1 by wb_init() and the put from
    wb_exit() releases it.
    
    However, when wb_init() fails, it puts the wb base ref automatically
    freeing the wb and the explicit kfree() in cgwb_bdi_init() error path
    ends up trying to free the same pointer the second time causing a
    double-free.
    
    Fix it by explicitly initilizing the refcnt to 1 and putting the base
    ref from cgwb_bdi_destroy().
    
    Signed-off-by: Tejun Heo <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Fixes: a13f35e ("writeback: don't embed root bdi_writeback_congested in bdi_writeback")
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    htejun authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    de56348 View commit details
    Browse the repository at this point in the history
  23. rtlwifi: rtl_usb: Fix for URB leaking when doing ifconfig up/down

    commit 575ddce upstream.
    
    In the function rtl_usb_start we pre-allocate a certain number of urbs
    for RX path but they will not be freed when calling rtl_usb_stop. This
    results in leaking urbs when doing ifconfig up and down. Eventually,
    the system has no available urbs.
    
    Signed-off-by: Michael Schenk <[email protected]>
    Signed-off-by: Larry Finger <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Michael Schenk authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    151d4c0 View commit details
    Browse the repository at this point in the history
  24. Revert "usb: chipidea: imx: enable CI_HDRC_SET_NON_ZERO_TTHA"

    commit 1bc7da8 upstream.
    
    This reverts commit e765bfb.
    
    In the most of cases, we only use one transaction per frame and the
    frame rate may be high, If the platforms want to support multiple
    transactions but less frame rate cases like [1] and [2], it can set
    "non-zero-ttctrl-ttha" at dts.
    
    [1] http://www.spinics.net/lists/linux-usb/msg123125.html
    [2] http://www.spinics.net/lists/linux-usb/msg118679.html
    
    Signed-off-by: Peter Chen <[email protected]>
    Cc: Martin Fuzzey <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Peter Chen authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    e0913cc View commit details
    Browse the repository at this point in the history
  25. kvm: vmx: ensure VMCS is current while enabling PML

    commit 4e59516 upstream.
    
    Between loading the new VMCS and enabling PML, the CPU was unpinned.
    If the vCPU thread were migrated to another CPU in the interim (e.g.,
    due to preemption or sleeping alloc_page), then the VMWRITEs to enable
    PML would target the wrong VMCS -- or no VMCS at all:
    
      [ 2087.266950] vmwrite error: reg 200e value 3fe1d52000 (err -506126336)
      [ 2087.267062] vmwrite error: reg 812 value 1ff (err 511)
      [ 2087.267125] vmwrite error: reg 401e value 12229c00 (err 304258048)
    
    This patch ensures that the VMCS remains current while enabling PML by
    doing the VMWRITEs while the CPU is pinned. Allocation of the PML buffer
    is hoisted out of the critical section.
    
    Signed-off-by: Peter Feiner <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Cc: "Herongguang (Stephen)" <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    peterfeiner authored and gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    c171caf View commit details
    Browse the repository at this point in the history
  26. Linux 4.4.52

    gregkh committed Feb 26, 2017
    Configuration menu
    Copy the full SHA
    dd4534d View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2017

  1. samples: move mic/mpssd example code from Documentation

    commit 6bee835 upstream.
    
    Move mic/mpssd examples to samples and remove it from Documentation
    Makefile. Create a new Makefile to build mic/mpssd. It can be built
    from top level directory or from mic/mpssd directory:
    
    Run make -C samples/mic/mpssd or cd samples/mic/mpssd; make
    
    Acked-by: Jonathan Corbet <[email protected]>
    Signed-off-by: Shuah Khan <[email protected]>
    [backported to 4.4-stable as this code is broken on newer versions of
     gcc and we don't want to break the build for a Documentation sample.
     - gregkh]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Shuah Khan authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    faf6aa4 View commit details
    Browse the repository at this point in the history
  2. MIPS: Fix special case in 64 bit IP checksumming.

    commit 66fd848 upstream.
    
    For certain arguments such as saddr = 0xc0a8fd60, daddr = 0xc0a8fda1,
    len = 80, proto = 17, sum = 0x7eae049d there will be a carry when
    folding the intermediate 64 bit checksum to 32 bit but the code doesn't
    add the carry back to the one's complement sum, thus an incorrect result
    will be generated.
    
    Reported-by: Mark Zhang <[email protected]>
    Signed-off-by: Ralf Baechle <[email protected]>
    Reviewed-by: James Hogan <[email protected]>
    Signed-off-by: James Hogan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ralfbaechle authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    5636da7 View commit details
    Browse the repository at this point in the history
  3. MIPS: BCM47XX: Fix button inversion for Asus WL-500W

    commit bdfdaf1 upstream.
    
    The Asus WL-500W buttons are active high, but the software treats them
    as active low. Fix the inverted logic.
    
    Fixes: 3be9725 ("MIPS: BCM47XX: Import buttons database from OpenWrt")
    Signed-off-by: Mirko Parthey <[email protected]>
    Acked-by: Rafał Miłecki <[email protected]>
    Cc: Hauke Mehrtens <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/15295/
    Signed-off-by: James Hogan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mparthey authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    b32e43c View commit details
    Browse the repository at this point in the history
  4. MIPS: OCTEON: Fix copy_from_user fault handling for large buffers

    commit 884b426 upstream.
    
    If copy_from_user is called with a large buffer (>= 128 bytes) and the
    userspace buffer refers partially to unreadable memory, then it is
    possible for Octeon's copy_from_user to report the wrong number of bytes
    have been copied. In the case where the buffer size is an exact multiple
    of 128 and the fault occurs in the last 64 bytes, copy_from_user will
    report that all the bytes were copied successfully but leave some
    garbage in the destination buffer.
    
    The bug is in the main __copy_user_common loop in octeon-memcpy.S where
    in the middle of the loop, src and dst are incremented by 128 bytes. The
    l_exc_copy fault handler is used after this but that assumes that
    "src < THREAD_BUADDR($28)". This is not the case if src has already been
    incremented.
    
    Fix by adding an extra fault handler which rewinds the src and dst
    pointers 128 bytes before falling though to l_exc_copy.
    
    Thanks to the pwritev test from the strace test suite for originally
    highlighting this bug!
    
    Fixes: 5b3b168 ("MIPS: Add Cavium OCTEON processor support ...")
    Signed-off-by: James Cowgill <[email protected]>
    Acked-by: David Daney <[email protected]>
    Reviewed-by: James Hogan <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14978/
    Signed-off-by: James Hogan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jcowgill authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    093292b View commit details
    Browse the repository at this point in the history
  5. MIPS: Lantiq: Keep ethernet enabled during boot

    commit 774f0c6 upstream.
    
    Disabling ethernet during reboot (only to enable it again when the
    ethernet driver attaches) can put the chip into a faulty state where it
    corrupts the header of all incoming packets.
    
    This happens if packets arrive during the time window where the core is
    disabled, and it can be easily reproduced by rebooting while sending a
    flood ping to the broadcast address.
    
    Fixes: 95135bf ("MIPS: Lantiq: Deactivate most of the devices by default")
    Signed-off-by: Felix Fietkau <[email protected]>
    Acked-by: John Crispin <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/15078/
    Signed-off-by: James Hogan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    nbd168 authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    f1be0f5 View commit details
    Browse the repository at this point in the history
  6. MIPS: Clear ISA bit correctly in get_frame_info()

    commit ccaf7ca upstream.
    
    get_frame_info() can be called in microMIPS kernels with the ISA bit
    already clear. For example this happens when unwind_stack_by_address()
    is called because we begin with a PC that has the ISA bit set & subtract
    the (odd) offset from the preceding symbol (which does not have the ISA
    bit set). Since get_frame_info() unconditionally subtracts 1 from the PC
    in microMIPS kernels it incorrectly misaligns the address it then
    attempts to access code at, leading to an address error exception.
    
    Fix this by using msk_isa16_mode() to clear the ISA bit, which allows
    get_frame_info() to function regardless of whether it is provided with a
    PC that has the ISA bit set or not.
    
    Signed-off-by: Paul Burton <[email protected]>
    Fixes: 34c2f66 ("MIPS: microMIPS: Add unaligned access support.")
    Cc: Leonid Yegoshin <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14528/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    paulburton authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    0d45490 View commit details
    Browse the repository at this point in the history
  7. MIPS: Prevent unaligned accesses during stack unwinding

    commit a3552da upstream.
    
    During stack unwinding we call a number of functions to determine what
    type of instruction we're looking at. The union mips_instruction pointer
    provided to them may be pointing at a 2 byte, but not 4 byte, aligned
    address & we thus cannot directly access the 4 byte wide members of the
    union mips_instruction. To avoid this is_ra_save_ins() copies the
    required half-words of the microMIPS instruction to a correctly aligned
    union mips_instruction on the stack, which it can then access safely.
    The is_jump_ins() & is_sp_move_ins() functions do not correctly perform
    this temporary copy, and instead attempt to directly dereference 4 byte
    fields which may be misaligned and lead to an address exception.
    
    Fix this by copying the instruction halfwords to a temporary union
    mips_instruction in get_frame_info() such that we can provide a 4 byte
    aligned union mips_instruction to the is_*_ins() functions and they do
    not need to deal with misalignment themselves.
    
    Signed-off-by: Paul Burton <[email protected]>
    Fixes: 34c2f66 ("MIPS: microMIPS: Add unaligned access support.")
    Cc: Leonid Yegoshin <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14529/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    paulburton authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    2998bf6 View commit details
    Browse the repository at this point in the history
  8. MIPS: Fix get_frame_info() handling of microMIPS function size

    commit b6c7a32 upstream.
    
    get_frame_info() is meant to iterate over up to the first 128
    instructions within a function, but for microMIPS kernels it will not
    reach that many instructions unless the function is 512 bytes long since
    we calculate the maximum number of instructions to check by dividing the
    function length by the 4 byte size of a union mips_instruction. In
    microMIPS kernels this won't do since instructions are variable length.
    
    Fix this by instead checking whether the pointer to the current
    instruction has reached the end of the function, and use max_insns as a
    simple constant to check the number of iterations against.
    
    Signed-off-by: Paul Burton <[email protected]>
    Fixes: 34c2f66 ("MIPS: microMIPS: Add unaligned access support.")
    Cc: Leonid Yegoshin <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14530/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    paulburton authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    72a0cfa View commit details
    Browse the repository at this point in the history
  9. MIPS: Fix is_jump_ins() handling of 16b microMIPS instructions

    commit 67c7505 upstream.
    
    is_jump_ins() checks 16b instruction fields without verifying that the
    instruction is indeed 16b, as is done by is_ra_save_ins() &
    is_sp_move_ins(). Add the appropriate check.
    
    Signed-off-by: Paul Burton <[email protected]>
    Fixes: 34c2f66 ("MIPS: microMIPS: Add unaligned access support.")
    Cc: Leonid Yegoshin <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14531/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    paulburton authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    d75d675 View commit details
    Browse the repository at this point in the history
  10. MIPS: Calculate microMIPS ra properly when unwinding the stack

    commit bb9bc46 upstream.
    
    get_frame_info() calculates the offset of the return address within a
    stack frame simply by dividing a the bottom 16 bits of the instruction,
    treated as a signed integer, by the size of a long. Whilst this works
    for MIPS32 & MIPS64 ISAs where the sw or sd instructions are used, it's
    incorrect for microMIPS where encodings differ. The result is that we
    typically completely fail to unwind the stack on microMIPS.
    
    Fix this by adjusting is_ra_save_ins() to calculate the return address
    offset, and take into account the various different encodings there in
    the same place as we consider whether an instruction is storing the
    ra/$31 register.
    
    With this we are now able to unwind the stack for kernels targetting the
    microMIPS ISA, for example we can produce:
    
        Call Trace:
        [<80109e1f>] show_stack+0x63/0x7c
        [<8011ea17>] __warn+0x9b/0xac
        [<8011ea45>] warn_slowpath_fmt+0x1d/0x20
        [<8013fe53>] register_console+0x43/0x314
        [<8067c58d>] of_setup_earlycon+0x1dd/0x1ec
        [<8067f63f>] early_init_dt_scan_chosen_stdout+0xe7/0xf8
        [<8066c115>] do_early_param+0x75/0xac
        [<801302f9>] parse_args+0x1dd/0x308
        [<8066c459>] parse_early_options+0x25/0x28
        [<8066c48b>] parse_early_param+0x2f/0x38
        [<8066e8cf>] setup_arch+0x113/0x488
        [<8066c4f3>] start_kernel+0x57/0x328
        ---[ end trace 0000000000000000 ]---
    
    Whereas previously we only produced:
    
        Call Trace:
        [<80109e1f>] show_stack+0x63/0x7c
        ---[ end trace 0000000000000000 ]---
    
    Signed-off-by: Paul Burton <[email protected]>
    Fixes: 34c2f66 ("MIPS: microMIPS: Add unaligned access support.")
    Cc: Leonid Yegoshin <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14532/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    paulburton authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    cc387ae View commit details
    Browse the repository at this point in the history
  11. MIPS: Handle microMIPS jumps in the same way as MIPS32/MIPS64 jumps

    commit 096a0de upstream.
    
    is_jump_ins() checks for plain jump ("j") instructions since commit
    e7438c4 ("MIPS: Fix sibling call handling in get_frame_info") but
    that commit didn't make the same change to the microMIPS code, leaving
    it inconsistent with the MIPS32/MIPS64 code. Handle the microMIPS
    encoding of the jump instruction too such that it behaves consistently.
    
    Signed-off-by: Paul Burton <[email protected]>
    Fixes: e7438c4 ("MIPS: Fix sibling call handling in get_frame_info")
    Cc: Tony Wu <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14533/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    paulburton authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    ab7546e View commit details
    Browse the repository at this point in the history
  12. am437x-vpfe: always assign bpp variable

    commit 6ebf757 upstream.
    
    In vpfe_s_fmt(), when the sensor format and the requested format were
    the same, bpp was assigned to vpfe->bpp without being initialized first.
    
    Grab the bpp value that is currently used by using __vpfe_get_format()
    instead of its wrapper, vpfe_try_fmt().
    
    This use of uninitialized variable has been found by compiling the
    kernel with clang.
    
    Fixes: 417d2e5 ("[media] media: platform: add VPFE capture driver
    support for AM437X")
    
    Signed-off-by: Nicolas Iooss <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    fishilico authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    5988e73 View commit details
    Browse the repository at this point in the history
  13. uvcvideo: Fix a wrong macro

    commit 17c341e upstream.
    
    Don't mix up UVC_BUF_STATE_* and VB2_BUF_STATE_* codes.
    
    Fixes: 6998b6f ("[media] uvcvideo: Use videobuf2-vmalloc")
    
    Signed-off-by: Guennadi Liakhovetski <[email protected]>
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    lyakh authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    b0bde9f View commit details
    Browse the repository at this point in the history
  14. media: fix dm1105.c build error

    commit e3bb3cd upstream.
    
    Fix dm1105 build error when CONFIG_I2C_ALGOBIT=m and
    CONFIG_DVB_DM1105=y.
    
    drivers/built-in.o: In function `dm1105_probe':
    dm1105.c:(.text+0x2836e7): undefined reference to `i2c_bit_add_bus'
    
    Signed-off-by: Randy Dunlap <[email protected]>
    Reported-by: kbuild test robot <[email protected]>
    Cc: Javier Martinez Canillas <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rddunlap authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    f3a0b20 View commit details
    Browse the repository at this point in the history
  15. ARM: at91: define LPDDR types

    commit e3f0a40 upstream.
    
    The Atmel MPDDR controller support LPDDR2 and LPDDR3 memories, add their
    types.
    
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Sebastian Reichel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexandrebelloni authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    b401418 View commit details
    Browse the repository at this point in the history
  16. ARM: dts: at91: Enable DMA on sama5d4_xplained console

    commit ef8d02d upstream.
    
    Enable DMA on usart3 to get a more reliable console. This is especially
    useful for automation and kernelci were a kernel with PROVE_LOCKING enabled
    is quite susceptible to character loss, resulting in tests failure.
    
    Acked-by: Nicolas Ferre <[email protected]>
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexandrebelloni authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    be83ed0 View commit details
    Browse the repository at this point in the history
  17. ARM: dts: at91: Enable DMA on sama5d2_xplained console

    commit 78162d4 upstream.
    
    Enable DMA on uart1 to get a more reliable console.
    
    Acked-by: Nicolas Ferre <[email protected]>
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexandrebelloni authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    6b1d7b6 View commit details
    Browse the repository at this point in the history
  18. ALSA: hda/realtek - Cannot adjust speaker's volume on a Dell AIO

    commit 9f1bc2c upstream.
    
    The issue is the same as "dd9aa335c880 ALSA: hda/realtek - Can't adjust
    speaker's volume on a Dell AIO", the output requires to connect to a node
    with Amp-out capability.
    
    Applying the same fixup "ALC298_FIXUP_SPK_VOLUME" can fix the issue.
    
    Signed-off-by: Kai-Heng Feng <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    khfeng authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    1f4f370 View commit details
    Browse the repository at this point in the history
  19. ALSA: hda - fix Lewisburg audio issue

    commit e7480b3 upstream.
    
    Like for Sunrise Point, the total stream number of Lewisburg's
    input and output stream exceeds 15 (GCAP is 0x9701), which will
    cause some streams do not work because of the overflow on
    SDxCTL.STRM field if using the legacy stream tag allocation method.
    
    Fixes: 5cf92c8 ("ALSA: hda - Add Intel Lewisburg device IDs Audio")
    Signed-off-by: Jaroslav Kysela <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    perexg authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    b9bf1f0 View commit details
    Browse the repository at this point in the history
  20. ALSA: timer: Reject user params with too small ticks

    commit 71321eb upstream.
    
    When a user sets a too small ticks with a fine-grained timer like
    hrtimer, the kernel tries to fire up the timer irq too frequently.
    This may lead to the condensed locks, eventually the kernel spinlock
    lockup with warnings.
    
    For avoiding such a situation, we define a lower limit of the
    resolution, namely 1ms.  When the user passes a too small tick value
    that results in less than that, the kernel returns -EINVAL now.
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    9879f9d View commit details
    Browse the repository at this point in the history
  21. ALSA: ctxfi: Fallback DMA mask to 32bit

    commit 15c75b0 upstream.
    
    Currently ctxfi driver tries to set only the 64bit DMA mask on 64bit
    architectures, and bails out if it fails.  This causes a problem on
    some platforms since the 64bit DMA isn't always guaranteed.  We should
    fall back to the default 32bit DMA when 64bit DMA fails.
    
    Fixes: 6d74b86 ("ALSA: ctxfi - Allow 64bit DMA")
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    70dbc00 View commit details
    Browse the repository at this point in the history
  22. ALSA: seq: Fix link corruption by event error handling

    commit f3ac9f7 upstream.
    
    The sequencer FIFO management has a bug that may lead to a corruption
    (shortage) of the cell linked list.  When a sequencer client faces an
    error at the event delivery, it tries to put back the dequeued cell.
    When the first queue was put back, this forgot the tail pointer
    tracking, and the link will be screwed up.
    
    Although there is no memory corruption, the sequencer client may stall
    forever at exit while flushing the pending FIFO cells in
    snd_seq_pool_done(), as spotted by syzkaller.
    
    This patch addresses the missing tail pointer tracking at
    snd_seq_fifo_cell_putback().  Also the patch makes sure to clear the
    cell->enxt pointer at snd_seq_fifo_event_in() for avoiding a similar
    mess-up of the FIFO linked list.
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    003aa34 View commit details
    Browse the repository at this point in the history
  23. ALSA: hda - Add subwoofer support for Dell Inspiron 17 7000 Gaming

    commit 493de34 upstream.
    
    Dell Inspiron 17 7000 Gaming laptop needs a similar quirk like
    Inspiron 7599 to support its subwoofer speaker.
    
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=194191
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    cd585d3 View commit details
    Browse the repository at this point in the history
  24. ALSA: hda - Fix micmute hotkey problem for a lenovo AIO machine

    commit 29693ef upstream.
    
    On this machine, the micmute button is connected to Line2 of the
    codec and the micmute led is connected to GPIO2 of the codec.
    
    After applying this quirk, both hotkey and led work well.
    
    Signed-off-by: Hui Wang <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jason77-wang authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    8c8f42c View commit details
    Browse the repository at this point in the history
  25. staging: rtl: fix possible NULL pointer dereference

    commit 6e01700 upstream.
    
    gcc-7 detects that wlanhdr_to_ethhdr() in two drivers calls memcpy() with
    a destination argument that an earlier function call may have set to NULL:
    
    staging/rtl8188eu/core/rtw_recv.c: In function 'wlanhdr_to_ethhdr':
    staging/rtl8188eu/core/rtw_recv.c:1318:2: warning: argument 1 null where non-null expected [-Wnonnull]
    staging/rtl8712/rtl871x_recv.c: In function 'r8712_wlanhdr_to_ethhdr':
    staging/rtl8712/rtl871x_recv.c:649:2: warning: argument 1 null where non-null expected [-Wnonnull]
    
    I'm fixing this by adding a NULL pointer check and returning failure
    from the function, which is hopefully already handled properly.
    
    This seems to date back to when the drivers were originally added,
    so backporting the fix to stable seems appropriate. There are other
    related realtek drivers in the kernel, but none of them contain a
    function with a similar name or produce this warning.
    
    Fixes: 1cc18a2 ("staging: r8188eu: Add files for new driver - part 5")
    Fixes: 2865d42 ("staging: r8712u: Add the new driver to the mainline kernel")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    272d60b View commit details
    Browse the repository at this point in the history
  26. regulator: Fix regulator_summary for deviceless consumers

    commit e42a46b upstream.
    
    It is allowed to call regulator_get with a NULL dev argument
    (_regulator_get explicitly checks for it) but this causes an error later
    when printing /sys/kernel/debug/regulator_summary.
    
    Fix this by explicitly handling "deviceless" consumers in the debugfs code.
    
    Signed-off-by: Leonard Crestez <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    cdleonard authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    5cc0cd0 View commit details
    Browse the repository at this point in the history
  27. iommu/vt-d: Fix some macros that are incorrectly specified in intel-i…

    …ommu
    
    commit aaa5930 upstream.
    
    Some of the macros are incorrect with wrong bit-shifts resulting in picking
    the incorrect invalidation granularity. Incorrect Source-ID in extended
    devtlb invalidation caused device side errors.
    
    To: Joerg Roedel <[email protected]>
    To: David Woodhouse <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: CQ Tang <[email protected]>
    Cc: Ashok Raj <[email protected]>
    
    Fixes: 2f26e0a ("iommu/vt-d: Add basic SVM PASID support")
    Signed-off-by: CQ Tang <[email protected]>
    Signed-off-by: Ashok Raj <[email protected]>
    Tested-by: CQ Tang <[email protected]>
    Signed-off-by: Joerg Roedel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    changqin-tang authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    0785256 View commit details
    Browse the repository at this point in the history
  28. iommu/vt-d: Tylersburg isoch identity map check is done too late.

    commit 21e722c upstream.
    
    The check to set identity map for tylersburg is done too late. It needs
    to be done before the check for identity_map domain is done.
    
    To: Joerg Roedel <[email protected]>
    To: David Woodhouse <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: Ashok Raj <[email protected]>
    
    Fixes: 86080cc ("iommu/vt-d: Allocate si_domain in init_dmars()")
    Signed-off-by: Ashok Raj <[email protected]>
    Reported-by: Yunhong Jiang <[email protected]>
    Signed-off-by: Joerg Roedel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ashok-raj authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    31dac0e View commit details
    Browse the repository at this point in the history
  29. mm/page_alloc: fix nodes for reclaim in fast path

    commit e02dc01 upstream.
    
    When @node_reclaim_node isn't 0, the page allocator tries to reclaim
    pages if the amount of free memory in the zones are below the low
    watermark.  On Power platform, none of NUMA nodes are scanned for page
    reclaim because no nodes match the condition in zone_allows_reclaim().
    On Power platform, RECLAIM_DISTANCE is set to 10 which is the distance
    of Node-A to Node-A.  So the preferred node even won't be scanned for
    page reclaim.
    
       __alloc_pages_nodemask()
       get_page_from_freelist()
          zone_allows_reclaim()
    
    Anton proposed the test code as below:
    
       # cat alloc.c
          :
       int main(int argc, char *argv[])
       {
    	void *p;
    	unsigned long size;
    	unsigned long start, end;
    
    	start = time(NULL);
    	size = strtoul(argv[1], NULL, 0);
    	printf("To allocate %ldGB memory\n", size);
    
    	size <<= 30;
    	p = malloc(size);
    	assert(p);
    	memset(p, 0, size);
    
    	end = time(NULL);
    	printf("Used time: %ld seconds\n", end - start);
    	sleep(3600);
    	return 0;
       }
    
    The system I use for testing has two NUMA nodes.  Both have 128GB
    memory.  In below scnario, the page caches on node#0 should be reclaimed
    when it encounters pressure to accommodate request of allocation.
    
       # echo 2 > /proc/sys/vm/zone_reclaim_mode; \
         sync; \
         echo 3 > /proc/sys/vm/drop_caches; \
       # taskset -c 0 cat file.32G > /dev/null; \
         grep FilePages /sys/devices/system/node/node0/meminfo
         Node 0 FilePages:       33619712 kB
       # taskset -c 0 ./alloc 128
       # grep FilePages /sys/devices/system/node/node0/meminfo
         Node 0 FilePages:       33619840 kB
       # grep MemFree /sys/devices/system/node/node0/meminfo
         Node 0 MemFree:          186816 kB
    
    With the patch applied, the pagecache on node-0 is reclaimed when its
    free memory is running out.  It's the expected behaviour.
    
       # echo 2 > /proc/sys/vm/zone_reclaim_mode; \
         sync; \
         echo 3 > /proc/sys/vm/drop_caches
       # taskset -c 0 cat file.32G > /dev/null; \
         grep FilePages /sys/devices/system/node/node0/meminfo
         Node 0 FilePages:       33605568 kB
       # taskset -c 0 ./alloc 128
       # grep FilePages /sys/devices/system/node/node0/meminfo
         Node 0 FilePages:        1379520 kB
       # grep MemFree /sys/devices/system/node/node0/meminfo
         Node 0 MemFree:           317120 kB
    
    Fixes: 5f7a75a ("mm: page_alloc: do not cache reclaim distances")
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Gavin Shan <[email protected]>
    Acked-by: Mel Gorman <[email protected]>
    Acked-by: Michal Hocko <[email protected]>
    Cc: Anton Blanchard <[email protected]>
    Cc: Michael Ellerman <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Gavin Shan authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    612e467 View commit details
    Browse the repository at this point in the history
  30. mm: vmpressure: fix sending wrong events on underflow

    commit e1587a4 upstream.
    
    At the end of a window period, if the reclaimed pages is greater than
    scanned, an unsigned underflow can result in a huge pressure value and
    thus a critical event.  Reclaimed pages is found to go higher than
    scanned because of the addition of reclaimed slab pages to reclaimed in
    shrink_node without a corresponding increment to scanned pages.
    
    Minchan Kim mentioned that this can also happen in the case of a THP
    page where the scanned is 1 and reclaimed could be 512.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Vinayak Menon <[email protected]>
    Acked-by: Minchan Kim <[email protected]>
    Acked-by: Michal Hocko <[email protected]>
    Cc: Johannes Weiner <[email protected]>
    Cc: Mel Gorman <[email protected]>
    Cc: Vlastimil Babka <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Vladimir Davydov <[email protected]>
    Cc: Anton Vorontsov <[email protected]>
    Cc: Shiraz Hashim <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Vinayak Menon authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    66f43a5 View commit details
    Browse the repository at this point in the history
  31. mm: do not access page->mapping directly on page_endio

    commit dd8416c upstream.
    
    With rw_page, page_endio is used for completing IO on a page and it
    propagates write error to the address space if the IO fails.  The
    problem is it accesses page->mapping directly which might be okay for
    file-backed pages but it shouldn't for anonymous page.  Otherwise, it
    can corrupt one of field from anon_vma under us and system goes panic
    randomly.
    
    swap_writepage
      bdev_writepage
        ops->rw_page
    
    I encountered the BUG during developing new zram feature and it was
    really hard to figure it out because it made random crash, somtime
    mmap_sem lockdep, sometime other places where places never related to
    zram/zsmalloc, and not reproducible with some configuration.
    
    When I consider how that bug is subtle and people do fast-swap test with
    brd, it's worth to add stable mark, I think.
    
    Fixes: dd6bd0d ("swap: use bdev_read_page() / bdev_write_page()")
    Signed-off-by: Minchan Kim <[email protected]>
    Acked-by: Michal Hocko <[email protected]>
    Cc: Matthew Wilcox <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    minchank authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    c5c893e View commit details
    Browse the repository at this point in the history
  32. ipc/shm: Fix shmat mmap nil-page protection

    commit 95e91b8 upstream.
    
    The issue is described here, with a nice testcase:
    
        https://bugzilla.kernel.org/show_bug.cgi?id=192931
    
    The problem is that shmat() calls do_mmap_pgoff() with MAP_FIXED, and
    the address rounded down to 0.  For the regular mmap case, the
    protection mentioned above is that the kernel gets to generate the
    address -- arch_get_unmapped_area() will always check for MAP_FIXED and
    return that address.  So by the time we do security_mmap_addr(0) things
    get funky for shmat().
    
    The testcase itself shows that while a regular user crashes, root will
    not have a problem attaching a nil-page.  There are two possible fixes
    to this.  The first, and which this patch does, is to simply allow root
    to crash as well -- this is also regular mmap behavior, ie when hacking
    up the testcase and adding mmap(...  |MAP_FIXED).  While this approach
    is the safer option, the second alternative is to ignore SHM_RND if the
    rounded address is 0, thus only having MAP_SHARED flags.  This makes the
    behavior of shmat() identical to the mmap() case.  The downside of this
    is obviously user visible, but does make sense in that it maintains
    semantics after the round-down wrt 0 address and mmap.
    
    Passes shm related ltp tests.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Davidlohr Bueso <[email protected]>
    Reported-by: Gareth Evans <[email protected]>
    Cc: Manfred Spraul <[email protected]>
    Cc: Michael Kerrisk <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Davidlohr Bueso authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    f0ae015 View commit details
    Browse the repository at this point in the history
  33. dm cache: fix corruption seen when using cache > 2TB

    commit ca763d0 upstream.
    
    A rounding bug due to compiler generated temporary being 32bit was found
    in remap_to_cache().  A localized cast in remap_to_cache() fixes the
    corruption but this preferred fix (changing from uint32_t to sector_t)
    eliminates potential for future rounding errors elsewhere.
    
    Signed-off-by: Joe Thornber <[email protected]>
    Signed-off-by: Mike Snitzer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jthornber authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    fdea1f9 View commit details
    Browse the repository at this point in the history
  34. dm stats: fix a leaked s->histogram_boundaries array

    commit 6085831 upstream.
    
    Fixes: dfcfac3 ("dm stats: collect and report histogram of IO latencies")
    Signed-off-by: Mikulas Patocka <[email protected]>
    Signed-off-by: Mike Snitzer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Mikulas Patocka authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    6a28431 View commit details
    Browse the repository at this point in the history
  35. scsi: storvsc: use tagged SRB requests if supported by the device

    commit 3cd6d3d upstream.
    
    Properly set SRB flags when hosting device supports tagged queuing.
    This patch improves the performance on Fiber Channel disks.
    
    Signed-off-by: Long Li <[email protected]>
    Reviewed-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    longlimsft authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    5cdc819 View commit details
    Browse the repository at this point in the history
  36. scsi: storvsc: properly handle SRB_ERROR when sense message is present

    commit bba5dc3 upstream.
    
    When sense message is present on error, we should pass along to the upper
    layer to decide how to deal with the error.
    This patch fixes connectivity issues with Fiber Channel devices.
    
    Signed-off-by: Long Li <[email protected]>
    Reviewed-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    longlimsft authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    80bccab View commit details
    Browse the repository at this point in the history
  37. scsi: storvsc: properly set residual data length on errors

    commit 40630f4 upstream.
    
    On I/O errors, the Windows driver doesn't set data_transfer_length
    on error conditions other than SRB_STATUS_DATA_OVERRUN.
    In these cases we need to set data_transfer_length to 0,
    indicating there is no data transferred. On SRB_STATUS_DATA_OVERRUN,
    data_transfer_length is set by the Windows driver to the actual data transferred.
    
    Reported-by: Shiva Krishna <[email protected]>
    Signed-off-by: Long Li <[email protected]>
    Reviewed-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    longlimsft authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    18dbfca View commit details
    Browse the repository at this point in the history
  38. scsi: aacraid: Reorder Adapter status check

    commit c421530 upstream.
    
    The driver currently checks the SELF_TEST_FAILED first and then
    KERNEL_PANIC next. Under error conditions(boot code failure) both
    SELF_TEST_FAILED and KERNEL_PANIC can be set at the same time.
    
    The driver has the capability to reset the controller on an KERNEL_PANIC,
    but not on SELF_TEST_FAILED.
    
    Fixed by first checking KERNEL_PANIC and then the others.
    
    Fixes: e8b12f0 ([SCSI] aacraid: Add new code for PMC-Sierra's SRC base controller family)
    Signed-off-by: Raghava Aditya Renukunta <[email protected]>
    Reviewed-by: David Carroll <[email protected]>
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Raghava Aditya Renukunta authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    2dc9a85 View commit details
    Browse the repository at this point in the history
  39. scsi: use 'scsi_device_from_queue()' for scsi_dh

    commit 857de6e upstream.
    
    The device handler needs to check if a given queue belongs to a scsi
    device; only then does it make sense to attach a device handler.
    
    [mkp: dropped flags]
    
    Signed-off-by: Hannes Reinecke <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hreinecke authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    33950b5 View commit details
    Browse the repository at this point in the history
  40. sd: get disk reference in sd_check_events()

    commit eb72d0b upstream.
    
    sd_check_events() is called asynchronously, and might race
    with device removal. So always take a disk reference when
    processing the event to avoid the device being removed while
    the event is processed.
    
    Signed-off-by: Hannes Reinecke <[email protected]>
    Reviewed-by: Ewan D. Milne <[email protected]>
    Reviewed-by: Bart Van Assche <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Cc: Jinpu Wang <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hreinecke authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    ea240cf View commit details
    Browse the repository at this point in the history
  41. Fix: Disable sys_membarrier when nohz_full is enabled

    commit 9075653 upstream.
    
    Userspace applications should be allowed to expect the membarrier system
    call with MEMBARRIER_CMD_SHARED command to issue memory barriers on
    nohz_full CPUs, but synchronize_sched() does not take those into
    account.
    
    Given that we do not want unrelated processes to be able to affect
    real-time sensitive nohz_full CPUs, simply return ENOSYS when membarrier
    is invoked on a kernel with enabled nohz_full CPUs.
    
    Signed-off-by: Mathieu Desnoyers <[email protected]>
    CC: Josh Triplett <[email protected]>
    CC: Steven Rostedt <[email protected]>
    Signed-off-by: Paul E. McKenney <[email protected]>
    Cc: Frederic Weisbecker <[email protected]>
    Cc: Chris Metcalf <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Acked-by: Lai Jiangshan <[email protected]>
    Reviewed-by: Josh Triplett <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    compudj authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    c0ef1f5 View commit details
    Browse the repository at this point in the history
  42. jbd2: don't leak modified metadata buffers on an aborted journal

    commit e112666 upstream.
    
    If the journal has been aborted, we shouldn't mark the underlying
    buffer head as dirty, since that will cause the metadata block to get
    modified.  And if the journal has been aborted, we shouldn't allow
    this since it will almost certainly lead to a corrupted file system.
    
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tytso authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    973f40f View commit details
    Browse the repository at this point in the history
  43. block/loop: fix race between I/O and set_status

    commit ecdd095 upstream.
    
    Inside set_status, transfer need to setup again, so
    we have to drain IO before the transition, otherwise
    oops may be triggered like the following:
    
    	divide error: 0000 [Freescale#1] SMP KASAN
    	CPU: 0 PID: 2935 Comm: loop7 Not tainted 4.10.0-rc7+ Freescale#213
    	Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
    	01/01/2011
    	task: ffff88006ba1e840 task.stack: ffff880067338000
    	RIP: 0010:transfer_xor+0x1d1/0x440 drivers/block/loop.c:110
    	RSP: 0018:ffff88006733f108 EFLAGS: 00010246
    	RAX: 0000000000000000 RBX: ffff8800688d7000 RCX: 0000000000000059
    	RDX: 0000000000000000 RSI: 1ffff1000d743f43 RDI: ffff880068891c08
    	RBP: ffff88006733f160 R08: ffff8800688d7001 R09: 0000000000000000
    	R10: 0000000000000000 R11: 0000000000000000 R12: ffff8800688d7000
    	R13: ffff880067b7d000 R14: dffffc0000000000 R15: 0000000000000000
    	FS:  0000000000000000(0000) GS:ffff88006d000000(0000)
    	knlGS:0000000000000000
    	CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    	CR2: 00000000006c17e0 CR3: 0000000066e3b000 CR4: 00000000001406f0
    	Call Trace:
    	 lo_do_transfer drivers/block/loop.c:251 [inline]
    	 lo_read_transfer drivers/block/loop.c:392 [inline]
    	 do_req_filebacked drivers/block/loop.c:541 [inline]
    	 loop_handle_cmd drivers/block/loop.c:1677 [inline]
    	 loop_queue_work+0xda0/0x49b0 drivers/block/loop.c:1689
    	 kthread_worker_fn+0x4c3/0xa30 kernel/kthread.c:630
    	 kthread+0x326/0x3f0 kernel/kthread.c:227
    	 ret_from_fork+0x31/0x40 arch/x86/entry/entry_64.S:430
    	Code: 03 83 e2 07 41 29 df 42 0f b6 04 30 4d 8d 44 24 01 38 d0 7f 08
    	84 c0 0f 85 62 02 00 00 44 89 f8 41 0f b6 48 ff 25 ff 01 00 00 99 <f7>
    	7d c8 48 63 d2 48 03 55 d0 48 89 d0 48 89 d7 48 c1 e8 03 83
    	RIP: transfer_xor+0x1d1/0x440 drivers/block/loop.c:110 RSP:
    	ffff88006733f108
    	---[ end trace 0166f7bd3b0c0933 ]---
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: Ming Lei <[email protected]>
    Tested-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ming1 authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    356d71d View commit details
    Browse the repository at this point in the history
  44. loop: fix LO_FLAGS_PARTSCAN hang

    commit e02898b upstream.
    
    loop_reread_partitions() needs to do I/O, but we just froze the queue,
    so we end up waiting forever. This can easily be reproduced with losetup
    -P. Fix it by moving the reread to after we unfreeze the queue.
    
    Fixes: ecdd095 ("block/loop: fix race between I/O and set_status")
    Reported-by: Tejun Heo <[email protected]>
    Signed-off-by: Omar Sandoval <[email protected]>
    Reviewed-by: Ming Lei <[email protected]>
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    osandov authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    cd3db55 View commit details
    Browse the repository at this point in the history
  45. ext4: Include forgotten start block on fallocate insert range

    commit 2a9b8cb upstream.
    
    While doing 'insert range' start block should be also shifted right.
    The bug can be easily reproduced by the following test:
    
        ptr = malloc(4096);
        assert(ptr);
    
        fd = open("./ext4.file", O_CREAT | O_TRUNC | O_RDWR, 0600);
        assert(fd >= 0);
    
        rc = fallocate(fd, 0, 0, 8192);
        assert(rc == 0);
        for (i = 0; i < 2048; i++)
                *((unsigned short *)ptr + i) = 0xbeef;
        rc = pwrite(fd, ptr, 4096, 0);
        assert(rc == 4096);
        rc = pwrite(fd, ptr, 4096, 4096);
        assert(rc == 4096);
    
        for (block = 2; block < 1000; block++) {
                rc = fallocate(fd, FALLOC_FL_INSERT_RANGE, 4096, 4096);
                assert(rc == 0);
    
                for (i = 0; i < 2048; i++)
                        *((unsigned short *)ptr + i) = block;
    
                rc = pwrite(fd, ptr, 4096, 4096);
                assert(rc == 4096);
        }
    
    Because start block is not included in the range the hole appears at
    the wrong offset (just after the desired offset) and the following
    pwrite() overwrites already existent block, keeping hole untouched.
    
    Simple way to verify wrong behaviour is to check zeroed blocks after
    the test:
    
       $ hexdump ./ext4.file | grep '0000 0000'
    
    The root cause of the bug is a wrong range (start, stop], where start
    should be inclusive, i.e. [start, stop].
    
    This patch fixes the problem by including start into the range.  But
    not to break left shift (range collapse) stop points to the beginning
    of the a block, not to the end.
    
    The other not obvious change is an iterator check on validness in a
    main loop.  Because iterator is unsigned the following corner case
    should be considered with care: insert a block at 0 offset, when stop
    variables overflows and never becomes less than start, which is 0.
    To handle this special case iterator is set to NULL to indicate that
    end of the loop is reached.
    
    Fixes: 331573f
    Signed-off-by: Roman Pen <[email protected]>
    Signed-off-by: Theodore Ts'o <[email protected]>
    Cc: Namjae Jeon <[email protected]>
    Cc: Andreas Dilger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Roman Pen authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    3daefda View commit details
    Browse the repository at this point in the history
  46. ext4: do not polute the extents cache while shifting extents

    commit 03e916f upstream.
    
    Inside ext4_ext_shift_extents() function ext4_find_extent() is called
    without EXT4_EX_NOCACHE flag, which should prevent cache population.
    
    This leads to oudated offsets in the extents tree and wrong blocks
    afterwards.
    
    Patch fixes the problem providing EXT4_EX_NOCACHE flag for each
    ext4_find_extents() call inside ext4_ext_shift_extents function.
    
    Fixes: 331573f
    Signed-off-by: Roman Pen <[email protected]>
    Signed-off-by: Theodore Ts'o <[email protected]>
    Cc: Namjae Jeon <[email protected]>
    Cc: Andreas Dilger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Roman Pen authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    a3068b3 View commit details
    Browse the repository at this point in the history
  47. ext4: trim allocation requests to group size

    commit cd648b8 upstream.
    
    If filesystem groups are artifically small (using parameter -g to
    mkfs.ext4), ext4_mb_normalize_request() can result in a request that is
    larger than a block group. Trim the request size to not confuse
    allocation code.
    
    Reported-by: "Kirill A. Shutemov" <[email protected]>
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jankara authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    8774c73 View commit details
    Browse the repository at this point in the history
  48. ext4: fix data corruption in data=journal mode

    commit 3b13649 upstream.
    
    ext4_journalled_write_end() did not propely handle all the cases when
    generic_perform_write() did not copy all the data into the target page
    and could mark buffers with uninitialized contents as uptodate and dirty
    leading to possible data corruption (which would be quickly fixed by
    generic_perform_write() retrying the write but still). Fix the problem
    by carefully handling the case when the page that is written to is not
    uptodate.
    
    Reported-by: Al Viro <[email protected]>
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jankara authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    9d63681 View commit details
    Browse the repository at this point in the history
  49. ext4: fix inline data error paths

    commit eb5efbc upstream.
    
    The write_end() function must always unlock the page and drop its ref
    count, even on an error.
    
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tytso authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    6ec4583 View commit details
    Browse the repository at this point in the history
  50. ext4: preserve the needs_recovery flag when the journal is aborted

    commit 97abd7d upstream.
    
    If the journal is aborted, the needs_recovery feature flag should not
    be removed.  Otherwise, it's the journal might not get replayed and
    this could lead to more data getting lost.
    
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tytso authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    9a79248 View commit details
    Browse the repository at this point in the history
  51. ext4: return EROFS if device is r/o and journal replay is needed

    commit 4753d8a upstream.
    
    If the file system requires journal recovery, and the device is
    read-ony, return EROFS to the mount system call.  This allows xfstests
    generic/050 to pass.
    
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tytso authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    6ad4196 View commit details
    Browse the repository at this point in the history
  52. samples/seccomp: fix 64-bit comparison macros

    commit 916cafd upstream.
    
    There were some bugs in the JNE64 and JLT64 comparision macros. This fixes
    them, improves comments, and cleans up the file while we are at it.
    
    Reported-by: Stephen Röttger <[email protected]>
    Signed-off-by: Mathias Svensson <[email protected]>
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: James Morris <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Mathias Svensson authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    da25939 View commit details
    Browse the repository at this point in the history
  53. target: Obtain se_node_acl->acl_kref during get_initiator_node_acl

    commit 21aaa23 upstream.
    
    This patch addresses a long standing race where obtaining
    se_node_acl->acl_kref in __transport_register_session()
    happens a bit too late, and leaves open the potential
    for core_tpg_del_initiator_node_acl() to hit a NULL
    pointer dereference.
    
    Instead, take ->acl_kref in core_tpg_get_initiator_node_acl()
    while se_portal_group->acl_node_mutex is held, and move the
    final target_put_nacl() from transport_deregister_session()
    into transport_free_session() so that fabric driver login
    failure handling using the modern method to still work
    as expected.
    
    Also, update core_tpg_get_initiator_node_acl() to take
    an extra reference for dynamically generated acls for
    demo-mode, before returning to fabric caller.  Also
    update iscsi-target sendtargets special case handling
    to use target_tpg_has_node_acl() when checking if
    demo_mode_discovery == true during discovery lookup.
    
    Note the existing wait_for_completion(&acl->acl_free_comp)
    in core_tpg_del_initiator_node_acl() does not change.
    
    Cc: Sagi Grimberg <[email protected]>
    Cc: Christoph Hellwig <[email protected]>
    Cc: Hannes Reinecke <[email protected]>
    Cc: Andy Grover <[email protected]>
    Cc: Mike Christie <[email protected]>
    Signed-off-by: Nicholas Bellinger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    nablio3000 authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    4a3c526 View commit details
    Browse the repository at this point in the history
  54. target: Fix multi-session dynamic se_node_acl double free OOPs

    commit 01d4d67 upstream.
    
    This patch addresses a long-standing bug with multi-session
    (eg: iscsi-target + iser-target) se_node_acl dynamic free
    withini transport_deregister_session().
    
    This bug is caused when a storage endpoint is configured with
    demo-mode (generate_node_acls = 1 + cache_dynamic_acls = 1)
    initiators, and initiator login creates a new dynamic node acl
    and attaches two sessions to it.
    
    After that, demo-mode for the storage instance is disabled via
    configfs (generate_node_acls = 0 + cache_dynamic_acls = 0) and
    the existing dynamic acl is never converted to an explicit ACL.
    
    The end result is dynamic acl resources are released twice when
    the sessions are shutdown in transport_deregister_session().
    
    If the storage instance is not changed to disable demo-mode,
    or the dynamic acl is converted to an explict ACL, or there
    is only a single session associated with the dynamic ACL,
    the bug is not triggered.
    
    To address this big, move the release of dynamic se_node_acl
    memory into target_complete_nacl() so it's only freed once
    when se_node_acl->acl_kref reaches zero.
    
    (Drop unnecessary list_del_init usage - HCH)
    
    Reported-by: Rob Millner <[email protected]>
    Tested-by: Rob Millner <[email protected]>
    Cc: Rob Millner <[email protected]>
    Signed-off-by: Nicholas Bellinger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    nablio3000 authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    6af0acc View commit details
    Browse the repository at this point in the history
  55. ath5k: drop bogus warning on drv_set_key with unsupported cipher

    commit a70e1d6 upstream.
    
    Simply return -EOPNOTSUPP instead.
    
    Signed-off-by: Felix Fietkau <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    nbd168 authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    dc7bbf8 View commit details
    Browse the repository at this point in the history
  56. ath9k: fix race condition in enabling/disabling IRQs

    commit 3a5e969 upstream.
    
    The code currently relies on refcounting to disable IRQs from within the
    IRQ handler and re-enabling them again after the tasklet has run.
    
    However, due to race conditions sometimes the IRQ handler might be
    called twice, or the tasklet may not run at all (if interrupted in the
    middle of a reset).
    
    This can cause nasty imbalances in the irq-disable refcount which will
    get the driver permanently stuck until the entire radio has been stopped
    and started again (ath_reset will not recover from this).
    
    Instead of using this fragile logic, change the code to ensure that
    running the irq handler during tasklet processing is safe, and leave the
    refcount untouched.
    
    Signed-off-by: Felix Fietkau <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    nbd168 authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    1aeced7 View commit details
    Browse the repository at this point in the history
  57. ath9k: use correct OTP register offsets for the AR9340 and AR9550

    commit c9f1e32 upstream.
    
    This patch fixes the OTP register definitions for the AR934x and AR9550
    WMAC SoC.
    
    Previously, the ath9k driver was unable to initialize the integrated
    WMAC on an Aerohive AP121:
    
    | ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
    | ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
    | ath: phy0: Unable to initialize hardware; initialization status: -5
    | ath9k ar934x_wmac: failed to initialize device
    | ath9k: probe of ar934x_wmac failed with error -5
    
    It turns out that the AR9300_OTP_STATUS and AR9300_OTP_DATA
    definitions contain a typo.
    
    Cc: Gabor Juhos <[email protected]>
    Fixes: add295a "ath9k: use correct OTP register offsets for AR9550"
    Signed-off-by: Christian Lamparter <[email protected]>
    Signed-off-by: Chris Blake <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    chunkeey authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    7666ef1 View commit details
    Browse the repository at this point in the history
  58. crypto: testmgr - Pad aes_ccm_enc_tv_template vector

    commit 1c68bb0 upstream.
    
    Running with KASAN and crypto tests currently gives
    
     BUG: KASAN: global-out-of-bounds in __test_aead+0x9d9/0x2200 at addr ffffffff8212fca0
     Read of size 16 by task cryptomgr_test/1107
     Address belongs to variable 0xffffffff8212fca0
     CPU: 0 PID: 1107 Comm: cryptomgr_test Not tainted 4.10.0+ Freescale#45
     Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014
     Call Trace:
      dump_stack+0x63/0x8a
      kasan_report.part.1+0x4a7/0x4e0
      ? __test_aead+0x9d9/0x2200
      ? crypto_ccm_init_crypt+0x218/0x3c0 [ccm]
      kasan_report+0x20/0x30
      check_memory_region+0x13c/0x1a0
      memcpy+0x23/0x50
      __test_aead+0x9d9/0x2200
      ? kasan_unpoison_shadow+0x35/0x50
      ? alg_test_akcipher+0xf0/0xf0
      ? crypto_skcipher_init_tfm+0x2e3/0x310
      ? crypto_spawn_tfm2+0x37/0x60
      ? crypto_ccm_init_tfm+0xa9/0xd0 [ccm]
      ? crypto_aead_init_tfm+0x7b/0x90
      ? crypto_alloc_tfm+0xc4/0x190
      test_aead+0x28/0xc0
      alg_test_aead+0x54/0xd0
      alg_test+0x1eb/0x3d0
      ? alg_find_test+0x90/0x90
      ? __sched_text_start+0x8/0x8
      ? __wake_up_common+0x70/0xb0
      cryptomgr_test+0x4d/0x60
      kthread+0x173/0x1c0
      ? crypto_acomp_scomp_free_ctx+0x60/0x60
      ? kthread_create_on_node+0xa0/0xa0
      ret_from_fork+0x2c/0x40
     Memory state around the buggy address:
      ffffffff8212fb80: 00 00 00 00 01 fa fa fa fa fa fa fa 00 00 00 00
      ffffffff8212fc00: 00 01 fa fa fa fa fa fa 00 00 00 00 01 fa fa fa
     >ffffffff8212fc80: fa fa fa fa 00 05 fa fa fa fa fa fa 00 00 00 00
                                       ^
      ffffffff8212fd00: 01 fa fa fa fa fa fa fa 00 00 00 00 01 fa fa fa
      ffffffff8212fd80: fa fa fa fa 00 00 00 00 00 05 fa fa fa fa fa fa
    
    This always happens on the same IV which is less than 16 bytes.
    
    Per Ard,
    
    "CCM IVs are 16 bytes, but due to the way they are constructed
    internally, the final couple of bytes of input IV are dont-cares.
    
    Apparently, we do read all 16 bytes, which triggers the KASAN errors."
    
    Fix this by padding the IV with null bytes to be at least 16 bytes.
    
    Fixes: 0bc5a6c ("crypto: testmgr - Disable rfc4309 test and convert test vectors")
    Acked-by: Ard Biesheuvel <[email protected]>
    Signed-off-by: Laura Abbott <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    labbott authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    434ed4a View commit details
    Browse the repository at this point in the history
  59. fuse: add missing FR_FORCE

    commit 2e38bea upstream.
    
    fuse_file_put() was missing the "force" flag for the RELEASE request when
    sending synchronously (fuseblk).
    
    If this flag is not set, then a sync request may be interrupted before it
    is dequeued by the userspace filesystem.  In this case the OPEN won't be
    balanced with a RELEASE.
    
    Signed-off-by: Miklos Szeredi <[email protected]>
    Fixes: 5a18ec1 ("fuse: fix hang of single threaded fuseblk filesystem")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Miklos Szeredi authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    d4a8db6 View commit details
    Browse the repository at this point in the history
  60. arm/arm64: KVM: Enforce unconditional flush to PoC when mapping to st…

    …age-2
    
    commit 8f36eba upstream.
    
    When we fault in a page, we flush it to the PoC (Point of Coherency)
    if the faulting vcpu has its own caches off, so that it can observe
    the page we just brought it.
    
    But if the vcpu has its caches on, we skip that step. Bad things
    happen when *another* vcpu tries to access that page with its own
    caches disabled. At that point, there is no garantee that the
    data has made it to the PoC, and we access stale data.
    
    The obvious fix is to always flush to PoC when a page is faulted
    in, no matter what the state of the vcpu is.
    
    Fixes: 2d58b73 ("arm64: KVM: force cache clean on page fault when caches are off")
    Reviewed-by: Christoffer Dall <[email protected]>
    Signed-off-by: Marc Zyngier <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Marc Zyngier authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    e83a28c View commit details
    Browse the repository at this point in the history
  61. iio: pressure: mpl115: do not rely on structure field ordering

    commit 6a6e1d5 upstream.
    
    Fixes a regression triggered by a change in the layout of
    struct iio_chan_spec, but the real bug is in the driver which assumed
    a specific structure layout in the first place. Hint: the three bits were
    not OR:ed together as implied by the indentation prior to this patch,
    there was a comma between the first two, which accidentally moved the
    ..._SCALE and ..._OFFSET bits to the next structure field. That field
    was .info_mask_shared_by_type before the _available attributes was added
    by commit 5123960 ("iio:core: add a callback to allow drivers to
    provide _available attributes") and .info_mask_separate_available
    afterwards, and the regression happened.
    
    info_mask_shared_by_type is actually a better choice than the originally
    intended info_mask_separate for the ..._SCALE and ..._OFFSET bits since
    a constant is returned from mpl115_read_raw for the scale/offset. Using
    info_mask_shared_by_type also preserves the behavior from before the
    regression and is therefore less likely to cause other interesting side
    effects.
    
    The above mentioned regression causes unintended sysfs attibutes to
    show up that are not backed by code, in turn causing a NULL pointer
    defererence to happen on access.
    
    Fixes: 3017d90 ("iio: Add Freescale MPL115A2 pressure / temperature sensor driver")
    Fixes: 5123960 ("iio:core: add a callback to allow drivers to provide _available attributes")
    Signed-off-by: Peter Rosin <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    peda-r authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    2ab6b8c View commit details
    Browse the repository at this point in the history
  62. iio: pressure: mpl3115: do not rely on structure field ordering

    commit 9cf6cdb upstream.
    
    Fixes a regression triggered by a change in the layout of
    struct iio_chan_spec, but the real bug is in the driver which assumed
    a specific structure layout in the first place. Hint: the two bits were
    not OR:ed together as implied by the indentation prior to this patch,
    there was a comma between them, which accidentally moved the ..._SCALE
    bit to the next structure field. That field was .info_mask_shared_by_type
    before the _available attributes was added by commit 5123960
    ("iio:core: add a callback to allow drivers to provide _available
    attributes") and .info_mask_separate_available afterwards, and the
    regression happened.
    
    info_mask_shared_by_type is actually a better choice than the originally
    intended info_mask_separate for the ..._SCALE bit since a constant is
    returned from mpl3115_read_raw for the scale. Using
    info_mask_shared_by_type also preserves the behavior from before the
    regression and is therefore less likely to cause other interesting side
    effects.
    
    The above mentioned regression causes an unintended sysfs attibute to
    show up that is not backed by code, in turn causing the following NULL
    pointer defererence to happen on access.
    
    Segmentation fault
    
    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = ecc3c000
    [00000000] *pgd=87f91831
    Internal error: Oops: 80000007 [Freescale#1] SMP ARM
    Modules linked in:
    CPU: 1 PID: 1051 Comm: cat Not tainted 4.10.0-rc5-00009-gffd8858-dirty Freescale#3
    Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    task: ed54ec00 task.stack: ee2bc000
    PC is at 0x0
    LR is at iio_read_channel_info_avail+0x40/0x280
    pc : [<00000000>]    lr : [<c06fbc1c>]    psr: a0070013
    sp : ee2bdda8  ip : 00000000  fp : ee2bddf4
    r10: c0a53c74  r9 : ed79f000  r8 : ee8d1018
    r7 : 00001000  r6 : 00000fff  r5 : ee8b9a00  r4 : ed79f000
    r3 : ee2bddc4  r2 : ee2bddbc  r1 : c0a86dcc  r0 : ee8d1000
    Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
    Control: 10c5387d  Table: 3cc3c04a  DAC: 00000051
    Process cat (pid: 1051, stack limit = 0xee2bc210)
    Stack: (0xee2bdda8 to 0xee2be000)
    dda0:                   ee2bddc0 00000002 c016d720 c016d394 ed54ec00 00000000
    ddc0: 60070013 ed413780 00000001 edffd480 ee8b9a00 00000fff 00001000 ee8d1018
    dde0: ed79f000 c0a53c74 ee2bde0c ee2bddf8 c0513c58 c06fbbe8 edffd480 edffd540
    de00: ee2bde3c ee2bde10 c0293474 c0513c40 c02933e4 ee2bde60 00000001 ed413780
    de20: 00000001 ed413780 00000000 edffd480 ee2bde4c ee2bde40 c0291d00 c02933f0
    de40: ee2bde9c ee2bde50 c024679c c0291ce0 edffd4b0 b6e37000 00020000 ee2bdf78
    de60: 00000000 00000000 ed54ec00 ed013200 00000817 c0a111fc edffd540 ed413780
    de80: b6e37000 00020000 00020000 ee2bdf78 ee2bded4 ee2bdea0 c0292890 c0246604
    dea0: c0117940 c016ba50 00000025 c0a111fc b6e37000 ed413780 ee2bdf78 00020000
    dec0: ee2bc000 b6e37000 ee2bdf44 ee2bded8 c021d158 c0292770 c0117764 b6e36004
    dee0: c0f0d7c4 ee2bdfb0 b6f89228 00021008 ee2bdfac ee2bdf00 c0101374 c0117770
    df00: 00000000 00000000 ee2bc000 00000000 ee2bdf34 ee2bdf20 c016ba04 c0171080
    df20: 00000000 00020000 ed413780 b6e37000 00000000 ee2bdf78 ee2bdf74 ee2bdf48
    df40: c021e7a0 c021d130 c023e300 c023e280 ee2bdf74 00000000 00000000 ed413780
    df60: ed413780 00020000 ee2bdfa4 ee2bdf78 c021e870 c021e71c 00000000 00000000
    df80: 00020000 00020000 b6e37000 00000003 c0108084 00000000 00000000 ee2bdfa8
    dfa0: c0107ee0 c021e838 00020000 00020000 00000003 b6e37000 00020000 0001a2b4
    dfc0: 00020000 00020000 b6e37000 00000003 7fffe000 00000000 00000000 00020000
    dfe0: 00000000 be98eb4c 0000c740 b6f1985c 60070010 00000003 00000000 00000000
    Backtrace:
    [<c06fbbdc>] (iio_read_channel_info_avail) from [<c0513c58>] (dev_attr_show+0x24/0x50)
     r10:c0a53c74 r9:ed79f000 r8:ee8d1018 r7:00001000 r6:00000fff r5:ee8b9a00
     r4:edffd480
    [<c0513c34>] (dev_attr_show) from [<c0293474>] (sysfs_kf_seq_show+0x90/0x110)
     r5:edffd540 r4:edffd480
    [<c02933e4>] (sysfs_kf_seq_show) from [<c0291d00>] (kernfs_seq_show+0x2c/0x30)
     r10:edffd480 r9:00000000 r8:ed413780 r7:00000001 r6:ed413780 r5:00000001
     r4:ee2bde60 r3:c02933e4
    [<c0291cd4>] (kernfs_seq_show) from [<c024679c>] (seq_read+0x1a4/0x4e0)
    [<c02465f8>] (seq_read) from [<c0292890>] (kernfs_fop_read+0x12c/0x1cc)
     r10:ee2bdf78 r9:00020000 r8:00020000 r7:b6e37000 r6:ed413780 r5:edffd540
     r4:c0a111fc
    [<c0292764>] (kernfs_fop_read) from [<c021d158>] (__vfs_read+0x34/0x118)
     r10:b6e37000 r9:ee2bc000 r8:00020000 r7:ee2bdf78 r6:ed413780 r5:b6e37000
     r4:c0a111fc
    [<c021d124>] (__vfs_read) from [<c021e7a0>] (vfs_read+0x90/0x11c)
     r8:ee2bdf78 r7:00000000 r6:b6e37000 r5:ed413780 r4:00020000
    [<c021e710>] (vfs_read) from [<c021e870>] (SyS_read+0x44/0x90)
     r8:00020000 r7:ed413780 r6:ed413780 r5:00000000 r4:00000000
    [<c021e82c>] (SyS_read) from [<c0107ee0>] (ret_fast_syscall+0x0/0x1c)
     r10:00000000 r8:c0108084 r7:00000003 r6:b6e37000 r5:00020000 r4:00020000
    Code: bad PC value
    ---[ end trace 9c4938ccd0389004 ]---
    
    Fixes: cc26ad4 ("iio: Add Freescale MPL3115A2 pressure / temperature sensor driver")
    Fixes: 5123960 ("iio:core: add a callback to allow drivers to provide _available attributes")
    Reported-by: Ken Lin <[email protected]>
    Tested-by: Ken Lin <[email protected]>
    Signed-off-by: Peter Rosin <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    peda-r authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    3584716 View commit details
    Browse the repository at this point in the history
  63. can: usb_8dev: Fix memory leak of priv->cmd_msg_buffer

    commit 7c42631 upstream.
    
    The priv->cmd_msg_buffer is allocated in the probe function, but never
    kfree()ed. This patch converts the kzalloc() to resource-managed
    kzalloc.
    
    Signed-off-by: Marc Kleine-Budde <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    marckleinebudde authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    20bc8a8 View commit details
    Browse the repository at this point in the history
  64. w1: don't leak refcount on slave attach failure in w1_attach_slave_de…

    …vice()
    
    commit d2ce4ea upstream.
    
    Near the beginning of w1_attach_slave_device() we increment a w1 master
    reference count.
    Later, when we are going to exit this function without actually attaching
    a slave device (due to failure of __w1_attach_slave_device()) we need to
    decrement this reference count back.
    
    Signed-off-by: Maciej S. Szmigiero <[email protected]>
    Fixes: 9fcbbac ("w1: process w1 netlink commands in w1_process thread")
    Cc: Evgeniy Polyakov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    maciejsszmigiero authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    1df66c4 View commit details
    Browse the repository at this point in the history
  65. w1: ds2490: USB transfer buffers need to be DMAable

    commit 61cd1b4 upstream.
    
    ds2490 driver was doing USB transfers from / to buffers on a stack.
    This is not permitted and made the driver non-working with vmapped stacks.
    
    Since all these transfers are done under the same bus_mutex lock we can
    simply use shared buffers in a device private structure for two most common
    of them.
    
    While we are at it, let's also fix a comparison between int and size_t in
    ds9490r_search() which made the driver spin in this function if state
    register get requests were failing.
    
    Signed-off-by: Maciej S. Szmigiero <[email protected]>
    Acked-by: Evgeniy Polyakov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    maciejsszmigiero authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    89eb5ed View commit details
    Browse the repository at this point in the history
  66. usb: musb: da8xx: Remove CPPI 3.0 quirk and methods

    commit a994ce2 upstream.
    
    DA8xx driver is registering and using the CPPI 3.0 DMA controller but
    actually, the DA8xx has a CPPI 4.1 DMA controller.
    Remove the CPPI 3.0 quirk and methods.
    
    Fixes: f8e9f34 ("usb: musb: Fix up DMA related macros")
    Fixes: 7f6283e ("usb: musb: Set up function pointers for DMA")
    Signed-off-by: Alexandre Bailon <[email protected]>
    Acked-by: Sergei Shtylyov <[email protected]>
    Acked-by: Tony Lindgren <[email protected]>
    Signed-off-by: Bin Liu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    anobli authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    900466a View commit details
    Browse the repository at this point in the history
  67. usb: host: xhci: plat: check hcc_params after add hcd

    commit 5de4e1e upstream.
    
    The commit 4ac5308 ("usb: xhci: plat: Create both
    HCDs before adding them") move add hcd to the end of
    probe, this cause hcc_params uninitiated, because xHCI
    driver sets hcc_params in xhci_gen_setup() called from
    usb_add_hcd().
    
    This patch checks the Maximum Primary Stream Array Size
    in the hcc_params register after add primary hcd.
    
    Signed-off-by: William wu <[email protected]>
    Acked-by: Roger Quadros <[email protected]>
    Fixes: 4ac5308 ("usb: xhci: plat: Create both HCDs before adding them")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wuliangfeng authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    61e9e9b View commit details
    Browse the repository at this point in the history
  68. usb: gadget: udc: fsl: Add missing complete function.

    commit 5528954 upstream.
    
    Commit 304f7e5 ("usb: gadget: Refactor request completion")
    removed check if req->req.complete is non-NULL, resulting in a NULL
    pointer derefence and a kernel panic.
    This patch adds an empty complete function instead of re-introducing
    the req->req.complete check.
    
    Fixes: 304f7e5 ("usb: gadget: Refactor request completion")
    
    Signed-off-by: Magnus Lilja <[email protected]>
    Signed-off-by: Felipe Balbi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Magnus Lilja authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    80190fc View commit details
    Browse the repository at this point in the history
  69. hv: allocate synic pages for all present CPUs

    commit 421b8f2 upstream.
    
    It may happen that not all CPUs are online when we do hv_synic_alloc() and
    in case more CPUs come online later we may try accessing these allocated
    structures.
    
    Signed-off-by: Vitaly Kuznetsov <[email protected]>
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    vittyvk authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    374907e View commit details
    Browse the repository at this point in the history
  70. hv: init percpu_list in hv_synic_alloc()

    commit 3c7630d upstream.
    
    Initializing hv_context.percpu_list in hv_synic_alloc() helps to prevent a
    crash in percpu_channel_enq() when not all CPUs were online during
    initialization and it naturally belongs there.
    
    Signed-off-by: Vitaly Kuznetsov <[email protected]>
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    vittyvk authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    862d2b7 View commit details
    Browse the repository at this point in the history
  71. Drivers: hv: util: kvp: Fix a rescind processing issue

    commit 5a66fec upstream.
    
    KVP may use a char device to support the communication between
    the user level daemon and the driver. When the KVP channel is rescinded
    we need to make sure that the char device is fully cleaned up before
    we can process a new KVP offer from the host. Implement this logic.
    
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kattisrinivasan authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    abaeda7 View commit details
    Browse the repository at this point in the history
  72. Drivers: hv: util: Fcopy: Fix a rescind processing issue

    commit 20951c7 upstream.
    
    Fcopy may use a char device to support the communication between
    the user level daemon and the driver. When the Fcopy channel is rescinded
    we need to make sure that the char device is fully cleaned up before
    we can process a new Fcopy offer from the host. Implement this logic.
    
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kattisrinivasan authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    9b45ab2 View commit details
    Browse the repository at this point in the history
  73. Drivers: hv: util: Backup: Fix a rescind processing issue

    commit d77044d upstream.
    
    VSS may use a char device to support the communication between
    the user level daemon and the driver. When the VSS channel is rescinded
    we need to make sure that the char device is fully cleaned up before
    we can process a new VSS offer from the host. Implement this logic.
    
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kattisrinivasan authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    f414af2 View commit details
    Browse the repository at this point in the history
  74. RDMA/core: Fix incorrect structure packing for booleans

    commit 55efcfc upstream.
    
    The RDMA core uses ib_pack() to convert from unpacked CPU structs
    to on-the-wire bitpacked structs.
    
    This process requires that 1 bit fields are declared as u8 in the
    unpacked struct, otherwise the packing process does not read the
    value properly and the packed result is wired to 0. Several
    places wrongly used int.
    
    Crucially this means the kernel has never, set reversible
    correctly in the path record request. It has always asked for
    irreversible paths even if the ULP requests otherwise.
    
    When the kernel is used with a SM that supports this feature, it
    completely breaks communication management if reversible paths are
    not properly requested.
    
    The only reason this ever worked is because opensm ignores the
    reversible bit.
    
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jgunthorpe authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    88326fe View commit details
    Browse the repository at this point in the history
  75. rdma_cm: fail iwarp accepts w/o connection params

    commit f2625f7 upstream.
    
    cma_accept_iw() needs to return an error if conn_params is NULL.
    Since this is coming from user space, we can crash.
    
    Reported-by: Shaobo He <[email protected]>
    Acked-by: Sean Hefty <[email protected]>
    Signed-off-by: Steve Wise <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Steve Wise authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    44dd30e View commit details
    Browse the repository at this point in the history
  76. gfs2: Add missing rcu locking for glock lookup

    commit f38e5fb upstream.
    
    We must hold the rcu read lock across looking up glocks and trying to
    bump their refcount to prevent the glocks from being freed in between.
    
    Signed-off-by: Andrew Price <[email protected]>
    Signed-off-by: Andreas Gruenbacher <[email protected]>
    Signed-off-by: Bob Peterson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    andyprice authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    70a0902 View commit details
    Browse the repository at this point in the history
  77. rtlwifi: Fix alignment issues

    commit 40b368a upstream.
    
    The addresses of Wlan NIC registers are natural alignment, but some
    drivers have bugs. These are evident on platforms that need natural
    alignment to access registers.  This change contains the following:
     1. Function _rtl8821ae_dbi_read() is used to read one byte from DBI,
        thus it should use rtl_read_byte().
     2. Register 0x4C7 of 8192ee is single byte.
    
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Signed-off-by: Larry Finger <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Ping-Ke Shih authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    6e10c33 View commit details
    Browse the repository at this point in the history
  78. rtlwifi: rtl8192c-common: Fix "BUG: KASAN:

    commit 6773386 upstream.
    
    Kernels built with CONFIG_KASAN=y report the following BUG for rtl8192cu
    and rtl8192c-common:
    
    ==================================================================
    BUG: KASAN: slab-out-of-bounds in rtl92c_dm_bt_coexist+0x858/0x1e40
         [rtl8192c_common] at addr ffff8801c90edb08
    Read of size 1 by task kworker/0:1/38
    page:ffffea0007243800 count:1 mapcount:0 mapping:          (null)
         index:0x0 compound_mapcount: 0
    flags: 0x8000000000004000(head)
    page dumped because: kasan: bad access detected
    CPU: 0 PID: 38 Comm: kworker/0:1 Not tainted 4.9.7-gentoo Freescale#3
    Hardware name: Gigabyte Technology Co., Ltd. To be filled by
         O.E.M./Z77-DS3H, BIOS F11a 11/13/2013
    Workqueue: rtl92c_usb rtl_watchdog_wq_callback [rtlwifi]
      0000000000000000 ffffffff829eea33 ffff8801d7f0fa30 ffff8801c90edb08
      ffffffff824c0f09 ffff8801d4abee80 0000000000000004 0000000000000297
      ffffffffc070b57c ffff8801c7aa7c48 ffff880100000004 ffffffff000003e8
    Call Trace:
      [<ffffffff829eea33>] ? dump_stack+0x5c/0x79
      [<ffffffff824c0f09>] ? kasan_report_error+0x4b9/0x4e0
      [<ffffffffc070b57c>] ? _usb_read_sync+0x15c/0x280 [rtl_usb]
      [<ffffffff824c0f75>] ? __asan_report_load1_noabort+0x45/0x50
      [<ffffffffc06d7a88>] ? rtl92c_dm_bt_coexist+0x858/0x1e40 [rtl8192c_common]
      [<ffffffffc06d7a88>] ? rtl92c_dm_bt_coexist+0x858/0x1e40 [rtl8192c_common]
      [<ffffffffc06d0cbe>] ? rtl92c_dm_rf_saving+0x96e/0x1330 [rtl8192c_common]
    ...
    
    The problem is due to rtl8192ce and rtl8192cu sharing routines, and having
    different layouts of struct rtl_pci_priv, which is used by rtl8192ce, and
    struct rtl_usb_priv, which is used by rtl8192cu. The problem was resolved
    by placing the struct bt_coexist_info at the head of each of those private
    areas.
    
    Reported-and-tested-by: Dmitry Osipenko <[email protected]>
    Signed-off-by: Larry Finger <[email protected]>
    Cc: Dmitry Osipenko <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    lwfinger authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    781e6a0 View commit details
    Browse the repository at this point in the history
  79. nfsd: minor nfsd_setattr cleanup

    commit 758e99f upstream.
    
    Simplify exit paths, size_change use.
    
    Signed-off-by: Christoph Hellwig <[email protected]>
    Signed-off-by: J. Bruce Fields <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Christoph Hellwig authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    6030493 View commit details
    Browse the repository at this point in the history
  80. nfsd: special case truncates some more

    commit 783112f upstream.
    
    Both the NFS protocols and the Linux VFS use a setattr operation with a
    bitmap of attributes to set to set various file attributes including the
    file size and the uid/gid.
    
    The Linux syscalls never mix size updates with unrelated updates like
    the uid/gid, and some file systems like XFS and GFS2 rely on the fact
    that truncates don't update random other attributes, and many other file
    systems handle the case but do not update the other attributes in the
    same transaction.  NFSD on the other hand passes the attributes it gets
    on the wire more or less directly through to the VFS, leading to updates
    the file systems don't expect.  XFS at least has an assert on the
    allowed attributes, which caught an unusual NFS client setting the size
    and group at the same time.
    
    To handle this issue properly this splits the notify_change call in
    nfsd_setattr into two separate ones.
    
    Signed-off-by: Christoph Hellwig <[email protected]>
    Tested-by: Chuck Lever <[email protected]>
    Signed-off-by: J. Bruce Fields <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Christoph Hellwig authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    3ee4f44 View commit details
    Browse the repository at this point in the history
  81. NFSv4: Fix memory and state leak in _nfs4_open_and_get_state

    commit a974dee upstream.
    
    If we exit because the file access check failed, we currently
    leak the struct nfs4_state. We need to attach it to the
    open context before returning.
    
    Fixes: 3efb972 ("NFSv4: Refactor _nfs4_open_and_get_state..")
    Signed-off-by: Trond Myklebust <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    trondmypd authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    52fb4bd View commit details
    Browse the repository at this point in the history
  82. NFSv4: fix getacl head length estimation

    commit 6682c14 upstream.
    
    Bitmap and attrlen follow immediately after the op reply header.  This
    was an oversight from commit bf118a3.
    
    Consequences of this are just minor efficiency (extra calls to
    xdr_shrink_bufhead).
    
    Fixes: bf118a3 "NFSv4: include bitmap in nfsv4 get acl data"
    Reviewed-by: Kinglong Mee <[email protected]>
    Signed-off-by: J. Bruce Fields <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    J. Bruce Fields authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    5d23e89 View commit details
    Browse the repository at this point in the history
  83. NFSv4: fix getacl ERANGE for some ACL buffer sizes

    commit ed92d8c upstream.
    
    We're not taking into account that the space needed for the (variable
    length) attr bitmap, with the result that we'd sometimes get a spurious
    ERANGE when the ACL data got close to the end of a page.
    
    Just add in an extra page to make sure.
    
    Signed-off-by: Weston Andros Adamson <[email protected]>
    Signed-off-by: J. Bruce Fields <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    westonandrosadamson authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    a0378b5 View commit details
    Browse the repository at this point in the history
  84. rtc: sun6i: Add some locking

    commit a9422a1 upstream.
    
    Some registers have a read-modify-write access pattern that are not atomic.
    
    Add some locking to prevent from concurrent accesses.
    
    Acked-by: Chen-Yu Tsai <[email protected]>
    Signed-off-by: Maxime Ripard <[email protected]>
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mripard authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    ee360e9 View commit details
    Browse the repository at this point in the history
  85. rtc: sun6i: Switch to the external oscillator

    commit fb61bb8 upstream.
    
    The RTC is clocked from either an internal, imprecise, oscillator or an
    external one, which is usually much more accurate.
    
    The difference perceived between the time elapsed and the time reported by
    the RTC is in a 10% scale, which prevents the RTC from being useful at all.
    
    Fortunately, the external oscillator is reported to be mandatory in the
    Allwinner datasheet, so we can just switch to it.
    
    Fixes: 9765d2d ("rtc: sun6i: Add sun6i RTC driver")
    Signed-off-by: Maxime Ripard <[email protected]>
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mripard authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    037cd23 View commit details
    Browse the repository at this point in the history
  86. md linear: fix a race between linear_add() and linear_congested()

    commit 03a9e24 upstream.
    
    Recently I receive a bug report that on Linux v3.0 based kerenl, hot add
    disk to a md linear device causes kernel crash at linear_congested(). From
    the crash image analysis, I find in linear_congested(), mddev->raid_disks
    contains value N, but conf->disks[] only has N-1 pointers available. Then
    a NULL pointer deference crashes the kernel.
    
    There is a race between linear_add() and linear_congested(), RCU stuffs
    used in these two functions cannot avoid the race. Since Linuv v4.0
    RCU code is replaced by introducing mddev_suspend().  After checking the
    upstream code, it seems linear_congested() is not called in
    generic_make_request() code patch, so mddev_suspend() cannot provent it
    from being called. The possible race still exists.
    
    Here I explain how the race still exists in current code.  For a machine
    has many CPUs, on one CPU, linear_add() is called to add a hard disk to a
    md linear device; at the same time on other CPU, linear_congested() is
    called to detect whether this md linear device is congested before issuing
    an I/O request onto it.
    
    Now I use a possible code execution time sequence to demo how the possible
    race happens,
    
    seq    linear_add()                linear_congested()
     0                                 conf=mddev->private
     1   oldconf=mddev->private
     2   mddev->raid_disks++
     3                              for (i=0; i<mddev->raid_disks;i++)
     4                                bdev_get_queue(conf->disks[i].rdev->bdev)
     5   mddev->private=newconf
    
    In linear_add() mddev->raid_disks is increased in time seq 2, and on
    another CPU in linear_congested() the for-loop iterates conf->disks[i] by
    the increased mddev->raid_disks in time seq 3,4. But conf with one more
    element (which is a pointer to struct dev_info type) to conf->disks[] is
    not updated yet, accessing its structure member in time seq 4 will cause a
    NULL pointer deference fault.
    
    To fix this race, there are 2 parts of modification in the patch,
     1) Add 'int raid_disks' in struct linear_conf, as a copy of
        mddev->raid_disks. It is initialized in linear_conf(), always being
        consistent with pointers number of 'struct dev_info disks[]'. When
        iterating conf->disks[] in linear_congested(), use conf->raid_disks to
        replace mddev->raid_disks in the for-loop, then NULL pointer deference
        will not happen again.
     2) RCU stuffs are back again, and use kfree_rcu() in linear_add() to
        free oldconf memory. Because oldconf may be referenced as mddev->private
        in linear_congested(), kfree_rcu() makes sure that its memory will not
        be released until no one uses it any more.
    Also some code comments are added in this patch, to make this modification
    to be easier understandable.
    
    This patch can be applied for kernels since v4.0 after commit:
    3be260c ("md/linear: remove rcu protections in favour of
    suspend/resume"). But this bug is reported on Linux v3.0 based kernel, for
    people who maintain kernels before Linux v4.0, they need to do some back
    back port to this patch.
    
    Changelog:
     - V3: add 'int raid_disks' in struct linear_conf, and use kfree_rcu() to
           replace rcu_call() in linear_add().
     - v2: add RCU stuffs by suggestion from Shaohua and Neil.
     - v1: initial effort.
    
    Signed-off-by: Coly Li <[email protected]>
    Cc: Shaohua Li <[email protected]>
    Cc: Neil Brown <[email protected]>
    Signed-off-by: Shaohua Li <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    [email protected] authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    5a1f03f View commit details
    Browse the repository at this point in the history
  87. bcma: use (get|put)_device when probing/removing device driver

    commit a971df0 upstream.
    
    This allows tracking device state and e.g. makes devm work as expected.
    
    Signed-off-by: Rafał Miłecki <[email protected]>
    Signed-off-by: Kalle Valo <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Rafał Miłecki authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    79a7ff1 View commit details
    Browse the repository at this point in the history
  88. dmaengine: ipu: Make sure the interrupt routine checks all interrupts.

    commit adee40b upstream.
    
    Commit 3d8cc00 ("dmaengine: ipu: Consolidate duplicated irq handlers")
    consolidated the two interrupts routines into one, but the remaining
    interrupt routine only checks the status of the error interrupts, not the
    normal interrupts.
    
    This patch fixes that problem (tested on i.MX31 PDK board).
    
    Fixes: 3d8cc00 ("dmaengine: ipu: Consolidate duplicated irq handlers")
    Cc: Vinod Koul <[email protected]>
    Signed-off-by: Magnus Lilja <[email protected]>
    Signed-off-by: Vinod Koul <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Magnus Lilja authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    afee78f View commit details
    Browse the repository at this point in the history
  89. powerpc/xmon: Fix data-breakpoint

    commit c21a493 upstream.
    
    Currently xmon data-breakpoint feature is broken.
    
    Whenever there is a watchpoint match occurs, hw_breakpoint_handler will
    be called by do_break via notifier chains mechanism. If watchpoint is
    registered by xmon, hw_breakpoint_handler won't find any associated
    perf_event and returns immediately with NOTIFY_STOP. Similarly, do_break
    also returns without notifying to xmon.
    
    Solve this by returning NOTIFY_DONE when hw_breakpoint_handler does not
    find any perf_event associated with matched watchpoint, rather than
    NOTIFY_STOP, which tells the core code to continue calling the other
    breakpoint handlers including the xmon one.
    
    Signed-off-by: Ravi Bangoria <[email protected]>
    Signed-off-by: Michael Ellerman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Ravi Bangoria authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    15959b7 View commit details
    Browse the repository at this point in the history
  90. MIPS: IP22: Reformat inline assembler code to modern standards.

    commit f9f1c8d upstream.
    
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ralfbaechle authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    4dd2905 View commit details
    Browse the repository at this point in the history
  91. MIPS: IP22: Fix build error due to binutils 2.25 uselessnes.

    commit ae2f5e5 upstream.
    
    Fix the following build error with binutils 2.25.
    
      CC      arch/mips/mm/sc-ip22.o
    {standard input}: Assembler messages:
    {standard input}:132: Error: number (0x9000000080000000) larger than 32 bits
    {standard input}:159: Error: number (0x9000000080000000) larger than 32 bits
    {standard input}:200: Error: number (0x9000000080000000) larger than 32 bits
    scripts/Makefile.build:293: recipe for target 'arch/mips/mm/sc-ip22.o' failed
    make[1]: *** [arch/mips/mm/sc-ip22.o] Error 1
    
    MIPS has used .set mips3 to temporarily switch the assembler to 64 bit
    mode in 64 bit kernels virtually forever.  Binutils 2.25 broke this
    behavious partially by happily accepting 64 bit instructions in .set mips3
    mode but puking on 64 bit constants when generating 32 bit ELF.  Binutils
    2.26 restored the old behaviour again.
    
    Fix build with binutils 2.25 by open coding the offending
    
    	dli $1, 0x9000000080000000
    
    as
    
    	li	$1, 0x9000
    	dsll	$1, $1, 48
    
    which is ugly be the only thing that will build on all binutils vintages.
    
    Signed-off-by: Ralf Baechle <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ralfbaechle authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    1d31606 View commit details
    Browse the repository at this point in the history
  92. scsi: lpfc: Correct WQ creation for pagesize

    commit 8ea73db upstream.
    
    Correct WQ creation for pagesize
    
    The driver was calculating the adapter command pagesize indicator from
    the system pagesize. However, the buffers the driver allocates are only
    one size (SLI4_PAGE_SIZE), so no calculation was necessary.
    
    Signed-off-by: Dick Kennedy <[email protected]>
    Signed-off-by: James Smart <[email protected]>
    Reviewed-by: Hannes Reinecke <[email protected]>
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Cc: Mauricio Faria de Oliveira <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jsmart-gh authored and gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    9cee694 View commit details
    Browse the repository at this point in the history
  93. Linux 4.4.53

    gregkh committed Mar 12, 2017
    Configuration menu
    Copy the full SHA
    49616e7 View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2017

  1. TTY: n_hdlc, fix lockdep false positive

    commit e9b736d upstream.
    
    The class of 4 n_hdls buf locks is the same because a single function
    n_hdlc_buf_list_init is used to init all the locks. But since
    flush_tx_queue takes n_hdlc->tx_buf_list.spinlock and then calls
    n_hdlc_buf_put which takes n_hdlc->tx_free_buf_list.spinlock, lockdep
    emits a warning:
    =============================================
    [ INFO: possible recursive locking detected ]
    4.3.0-25.g91e30a7-default Freescale#1 Not tainted
    ---------------------------------------------
    a.out/1248 is trying to acquire lock:
     (&(&list->spinlock)->rlock){......}, at: [<ffffffffa01fd020>] n_hdlc_buf_put+0x20/0x60 [n_hdlc]
    
    but task is already holding lock:
     (&(&list->spinlock)->rlock){......}, at: [<ffffffffa01fdc07>] n_hdlc_tty_ioctl+0x127/0x1d0 [n_hdlc]
    
    other info that might help us debug this:
     Possible unsafe locking scenario:
    
           CPU0
           ----
      lock(&(&list->spinlock)->rlock);
      lock(&(&list->spinlock)->rlock);
    
     *** DEADLOCK ***
    
     May be due to missing lock nesting notation
    
    2 locks held by a.out/1248:
     #0:  (&tty->ldisc_sem){++++++}, at: [<ffffffff814c9eb0>] tty_ldisc_ref_wait+0x20/0x50
     Freescale#1:  (&(&list->spinlock)->rlock){......}, at: [<ffffffffa01fdc07>] n_hdlc_tty_ioctl+0x127/0x1d0 [n_hdlc]
    ...
    Call Trace:
    ...
     [<ffffffff81738fd0>] _raw_spin_lock_irqsave+0x50/0x70
     [<ffffffffa01fd020>] n_hdlc_buf_put+0x20/0x60 [n_hdlc]
     [<ffffffffa01fdc24>] n_hdlc_tty_ioctl+0x144/0x1d0 [n_hdlc]
     [<ffffffff814c25c1>] tty_ioctl+0x3f1/0xe40
    ...
    
    Fix it by initializing the spin_locks separately. This removes also
    reduntand memset of a freshly kzallocated space.
    
    Signed-off-by: Jiri Slaby <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Jiri Slaby authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    59c4d78 View commit details
    Browse the repository at this point in the history
  2. tty: n_hdlc: get rid of racy n_hdlc.tbuf

    commit 82f2341 upstream.
    
    Currently N_HDLC line discipline uses a self-made singly linked list for
    data buffers and has n_hdlc.tbuf pointer for buffer retransmitting after
    an error.
    
    The commit be10eb7
    ("tty: n_hdlc add buffer flushing") introduced racy access to n_hdlc.tbuf.
    After tx error concurrent flush_tx_queue() and n_hdlc_send_frames() can put
    one data buffer to tx_free_buf_list twice. That causes double free in
    n_hdlc_release().
    
    Let's use standard kernel linked list and get rid of n_hdlc.tbuf:
    in case of tx error put current data buffer after the head of tx_buf_list.
    
    Signed-off-by: Alexander Popov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    a13xp0p0v authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    999853d View commit details
    Browse the repository at this point in the history
  3. serial: 8250_pci: Add MKS Tenta SCOM-0800 and SCOM-0801 cards

    commit 1c9c858 upstream.
    
    The MKS Instruments SCOM-0800 and SCOM-0801 cards (originally by Tenta
    Technologies) are 3U CompactPCI serial cards with 4 and 8 serial ports,
    respectively.  The first 4 ports are implemented by an OX16PCI954 chip,
    and the second 4 ports are implemented by an OX16C954 chip on a local
    bus, bridged by the second PCI function of the OX16PCI954.  The ports
    are jumper-selectable as RS-232 and RS-422/485, and the UARTs use a
    non-standard oscillator frequency of 20 MHz (base_baud = 1250000).
    
    Signed-off-by: Ian Abbott <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ian-abbott authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    4b34572 View commit details
    Browse the repository at this point in the history
  4. KVM: s390: Disable dirty log retrieval for UCONTROL guests

    commit e1e8a96 upstream.
    
    User controlled KVM guests do not support the dirty log, as they have
    no single gmap that we can check for changes.
    
    As they have no single gmap, kvm->arch.gmap is NULL and all further
    referencing to it for dirty checking will result in a NULL
    dereference.
    
    Let's return -EINVAL if a caller tries to sync dirty logs for a
    UCONTROL guest.
    
    Fixes: 15f36eb ("KVM: s390: Add proper dirty bitmap support to S390 kvm.")
    Signed-off-by: Janosch Frank <[email protected]>
    Reported-by: Martin Schwidefsky <[email protected]>
    Reviewed-by: Cornelia Huck <[email protected]>
    Signed-off-by: Christian Borntraeger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Janosch Frank authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    0a3df04 View commit details
    Browse the repository at this point in the history
  5. KVM: VMX: use correct vmcs_read/write for guest segment selector/base

    commit 96794e4 upstream.
    
    Guest segment selector is 16 bit field and guest segment base is natural
    width field. Fix two incorrect invocations accordingly.
    
    Without this patch, build fails when aggressive inlining is used with ICC.
    
    Signed-off-by: Chao Peng <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    chao-p authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    cae929b View commit details
    Browse the repository at this point in the history
  6. Bluetooth: Add another AR3012 04ca:3018 device

    commit 441ad62 upstream.
    
    T:  Bus=01 Lev=01 Prnt=01 Port=07 Cnt=04 Dev#=  5 Spd=12  MxCh= 0
    D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=04ca ProdID=3018 Rev=00.01
    C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    
    Signed-off-by: Dmitry Tunin <[email protected]>
    Signed-off-by: Marcel Holtmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hanipouspilot authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    00cfdbf View commit details
    Browse the repository at this point in the history
  7. s390/qdio: clear DSCI prior to scanning multiple input queues

    commit 1e4a382 upstream.
    
    For devices with multiple input queues, tiqdio_call_inq_handlers()
    iterates over all input queues and clears the device's DSCI
    during each iteration. If the DSCI is re-armed during one
    of the later iterations, we therefore do not scan the previous
    queues again.
    The re-arming also raises a new adapter interrupt. But its
    handler does not trigger a rescan for the device, as the DSCI
    has already been erroneously cleared.
    This can result in queue stalls on devices with multiple
    input queues.
    
    Fix it by clearing the DSCI just once, prior to scanning the queues.
    
    As the code is moved in front of the loop, we also need to access
    the DSCI directly (ie irq->dsci) instead of going via each queue's
    parent pointer to the same irq. This is not a functional change,
    and a follow-up patch will clean up the other users.
    
    In practice, this bug only affects CQ-enabled HiperSockets devices,
    ie. devices with sysfs-attribute "hsuid" set. Setting a hsuid is
    needed for AF_IUCV socket applications that use HiperSockets
    communication.
    
    Fixes: 104ea55 ("qdio: support asynchronous delivery of storage blocks")
    Reviewed-by: Ursula Braun <[email protected]>
    Signed-off-by: Julian Wiedmann <[email protected]>
    Signed-off-by: Martin Schwidefsky <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    julianwiedmann authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    ec50c80 View commit details
    Browse the repository at this point in the history
  8. s390/dcssblk: fix device size calculation in dcssblk_direct_access()

    commit a63f53e upstream.
    
    Since commit dd22f55 "block: Change direct_access calling convention",
    the device size calculation in dcssblk_direct_access() is off-by-one.
    This results in bdev_direct_access() always returning -ENXIO because the
    returned value is not page aligned.
    
    Fix this by adding 1 to the dev_sz calculation.
    
    Fixes: dd22f55 ("block: Change direct_access calling convention")
    Signed-off-by: Gerald Schaefer <[email protected]>
    Signed-off-by: Martin Schwidefsky <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    gerald-schaefer authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    792bd1f View commit details
    Browse the repository at this point in the history
  9. s390: TASK_SIZE for kernel threads

    commit fb94a68 upstream.
    
    Return a sensible value if TASK_SIZE if called from a kernel thread.
    
    This gets us around an issue with copy_mount_options that does a magic
    size calculation "TASK_SIZE - (unsigned long)data" while in a kernel
    thread and data pointing to kernel space.
    
    Signed-off-by: Martin Schwidefsky <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Martin Schwidefsky authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    9cf431d View commit details
    Browse the repository at this point in the history
  10. s390: make setup_randomness work

    commit da8fd82 upstream.
    
    Commit bcfcbb6 ("s390: add system information as device
    randomness") intended to add some virtual machine specific information
    to the randomness pool.
    
    Unfortunately it uses the page allocator before it is ready to use. In
    result the page allocator always returns NULL and the setup_randomness
    function never adds anything to the randomness pool.
    
    To fix this use memblock_alloc and memblock_free instead.
    
    Fixes: bcfcbb6 ("s390: add system information as device randomness")
    Signed-off-by: Heiko Carstens <[email protected]>
    Signed-off-by: Martin Schwidefsky <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    heicarst authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    296f7bd View commit details
    Browse the repository at this point in the history
  11. s390: use correct input data address for setup_randomness

    commit 4920e3c upstream.
    
    The current implementation of setup_randomness uses the stack address
    and therefore the pointer to the SYSIB 3.2.2 block as input data
    address. Furthermore the length of the input data is the number of
    virtual-machine description blocks which is typically one.
    
    This means that typically a single zero byte is fed to
    add_device_randomness.
    
    Fix both of these and use the address of the first virtual machine
    description block as input data address and also use the correct
    length.
    
    Fixes: bcfcbb6 ("s390: add system information as device randomness")
    Signed-off-by: Heiko Carstens <[email protected]>
    Signed-off-by: Martin Schwidefsky <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    heicarst authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    376a12e View commit details
    Browse the repository at this point in the history
  12. net: mvpp2: fix DMA address calculation in mvpp2_txq_inc_put()

    commit 239a3b6 upstream.
    
    When TX descriptors are filled in, the buffer DMA address is split
    between the tx_desc->buf_phys_addr field (high-order bits) and
    tx_desc->packet_offset field (5 low-order bits).
    
    However, when we re-calculate the DMA address from the TX descriptor in
    mvpp2_txq_inc_put(), we do not take tx_desc->packet_offset into
    account. This means that when the DMA address is not aligned on a 32
    bytes boundary, we end up calling dma_unmap_single() with a DMA address
    that was not the one returned by dma_map_single().
    
    This inconsistency is detected by the kernel when DMA_API_DEBUG is
    enabled. We fix this problem by properly calculating the DMA address in
    mvpp2_txq_inc_put().
    
    Signed-off-by: Thomas Petazzoni <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tpetazzoni authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    b57ffb2 View commit details
    Browse the repository at this point in the history
  13. mnt: Tuck mounts under others instead of creating shadow/side mounts.

    commit 1064f87 upstream.
    
    Ever since mount propagation was introduced in cases where a mount in
    propagated to parent mount mountpoint pair that is already in use the
    code has placed the new mount behind the old mount in the mount hash
    table.
    
    This implementation detail is problematic as it allows creating
    arbitrary length mount hash chains.
    
    Furthermore it invalidates the constraint maintained elsewhere in the
    mount code that a parent mount and a mountpoint pair will have exactly
    one mount upon them.  Making it hard to deal with and to talk about
    this special case in the mount code.
    
    Modify mount propagation to notice when there is already a mount at
    the parent mount and mountpoint where a new mount is propagating to
    and place that preexisting mount on top of the new mount.
    
    Modify unmount propagation to notice when a mount that is being
    unmounted has another mount on top of it (and no other children), and
    to replace the unmounted mount with the mount on top of it.
    
    Move the MNT_UMUONT test from __lookup_mnt_last into
    __propagate_umount as that is the only call of __lookup_mnt_last where
    MNT_UMOUNT may be set on any mount visible in the mount hash table.
    
    These modifications allow:
     - __lookup_mnt_last to be removed.
     - attach_shadows to be renamed __attach_mnt and its shadow
       handling to be removed.
     - commit_tree to be simplified
     - copy_tree to be simplified
    
    The result is an easier to understand tree of mounts that does not
    allow creation of arbitrary length hash chains in the mount hash table.
    
    The result is also a very slight userspace visible difference in semantics.
    The following two cases now behave identically, where before order
    mattered:
    
    case 1: (explicit user action)
    	B is a slave of A
    	mount something on A/a , it will propagate to B/a
    	and than mount something on B/a
    
    case 2: (tucked mount)
    	B is a slave of A
    	mount something on B/a
    	and than mount something on A/a
    
    Histroically umount A/a would fail in case 1 and succeed in case 2.
    Now umount A/a succeeds in both configurations.
    
    This very small change in semantics appears if anything to be a bug
    fix to me and my survey of userspace leads me to believe that no programs
    will notice or care of this subtle semantic change.
    
    v2: Updated to mnt_change_mountpoint to not call dput or mntput
    and instead to decrement the counts directly.  It is guaranteed
    that there will be other references when mnt_change_mountpoint is
    called so this is safe.
    
    v3: Moved put_mountpoint under mount_lock in attach_recursive_mnt
        As the locking in fs/namespace.c changed between v2 and v3.
    
    v4: Reworked the logic in propagate_mount_busy and __propagate_umount
        that detects when a mount completely covers another mount.
    
    v5: Removed unnecessary tests whose result is alwasy true in
        find_topper and attach_recursive_mnt.
    
    v6: Document the user space visible semantic difference.
    
    Fixes: b90fa9a ("[PATCH] shared mount handling: bind and rbind")
    Tested-by: Andrei Vagin <[email protected]>
    Signed-off-by: "Eric W. Biederman" <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ebiederm authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    839d426 View commit details
    Browse the repository at this point in the history
  14. IB/ipoib: Fix deadlock between rmmod and set_mode

    commit 0a0007f upstream.
    
    When calling set_mode from sys/fs, the call flow locks the sys/fs lock
    first and then tries to lock rtnl_lock (when calling ipoib_set_mod).
    On the other hand, the rmmod call flow takes the rtnl_lock first
    (when calling unregister_netdev) and then tries to take the sys/fs
    lock. Deadlock a->b, b->a.
    
    The problem starts when ipoib_set_mod frees it's rtnl_lck and tries
    to get it after that.
    
        set_mod:
        [<ffffffff8104f2bd>] ? check_preempt_curr+0x6d/0x90
        [<ffffffff814fee8e>] __mutex_lock_slowpath+0x13e/0x180
        [<ffffffff81448655>] ? __rtnl_unlock+0x15/0x20
        [<ffffffff814fed2b>] mutex_lock+0x2b/0x50
        [<ffffffff81448675>] rtnl_lock+0x15/0x20
        [<ffffffffa02ad807>] ipoib_set_mode+0x97/0x160 [ib_ipoib]
        [<ffffffffa02b5f5b>] set_mode+0x3b/0x80 [ib_ipoib]
        [<ffffffff8134b840>] dev_attr_store+0x20/0x30
        [<ffffffff811f0fe5>] sysfs_write_file+0xe5/0x170
        [<ffffffff8117b068>] vfs_write+0xb8/0x1a0
        [<ffffffff8117ba81>] sys_write+0x51/0x90
        [<ffffffff8100b0f2>] system_call_fastpath+0x16/0x1b
    
        rmmod:
        [<ffffffff81279ffc>] ? put_dec+0x10c/0x110
        [<ffffffff8127a2ee>] ? number+0x2ee/0x320
        [<ffffffff814fe6a5>] schedule_timeout+0x215/0x2e0
        [<ffffffff8127cc04>] ? vsnprintf+0x484/0x5f0
        [<ffffffff8127b550>] ? string+0x40/0x100
        [<ffffffff814fe323>] wait_for_common+0x123/0x180
        [<ffffffff81060250>] ? default_wake_function+0x0/0x20
        [<ffffffff8119661e>] ? ifind_fast+0x5e/0xb0
        [<ffffffff814fe43d>] wait_for_completion+0x1d/0x20
        [<ffffffff811f2e68>] sysfs_addrm_finish+0x228/0x270
        [<ffffffff811f2fb3>] sysfs_remove_dir+0xa3/0xf0
        [<ffffffff81273f66>] kobject_del+0x16/0x40
        [<ffffffff8134cd14>] device_del+0x184/0x1e0
        [<ffffffff8144e59b>] netdev_unregister_kobject+0xab/0xc0
        [<ffffffff8143c05e>] rollback_registered+0xae/0x130
        [<ffffffff8143c102>] unregister_netdevice+0x22/0x70
        [<ffffffff8143c16e>] unregister_netdev+0x1e/0x30
        [<ffffffffa02a91b0>] ipoib_remove_one+0xe0/0x120 [ib_ipoib]
        [<ffffffffa01ed95f>] ib_unregister_device+0x4f/0x100 [ib_core]
        [<ffffffffa021f5e1>] mlx4_ib_remove+0x41/0x180 [mlx4_ib]
        [<ffffffffa01ab771>] mlx4_remove_device+0x71/0x90 [mlx4_core]
    
    Fixes: 862096a ("IB/ipoib: Add more rtnl_link_ops callbacks")
    Cc: Or Gerlitz <[email protected]>
    Signed-off-by: Feras Daoud <[email protected]>
    Signed-off-by: Erez Shitrit <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ferasd authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    10beca5 View commit details
    Browse the repository at this point in the history
  15. IB/IPoIB: Add destination address when re-queue packet

    commit 2b08417 upstream.
    
    When sending packet to destination that was not resolved yet
    via path query, the driver keeps the skb and tries to re-send it
    again when the path is resolved.
    
    But when re-sending via dev_queue_xmit the kernel doesn't call
    to dev_hard_header, so IPoIB needs to keep 20 bytes in the skb
    and to put the destination address inside them.
    
    In that way the dev_start_xmit will have the correct destination,
    and the driver won't take the destination from the skb->data, while
    nothing exists there, which causes to packet be be dropped.
    
    The test flow is:
    1. Run the SM on remote node,
    2. Restart the driver.
    4. Ping some destination,
    3. Observe that first ICMP request will be dropped.
    
    Fixes: fc791b6 ("IB/ipoib: move back IB LL address into the hard header")
    Signed-off-by: Erez Shitrit <[email protected]>
    Signed-off-by: Noa Osherovich <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Tested-by: Yuval Shaia <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Erez Shitrit authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    bb4a21d View commit details
    Browse the repository at this point in the history
  16. IB/srp: Avoid that duplicate responses trigger a kernel bug

    commit 6cb72bc upstream.
    
    After srp_process_rsp() returns there is a short time during which
    the scsi_host_find_tag() call will return a pointer to the SCSI
    command that is being completed. If during that time a duplicate
    response is received, avoid that the following call stack appears:
    
    BUG: unable to handle kernel NULL pointer dereference at           (null)
    IP: srp_recv_done+0x450/0x6b0 [ib_srp]
    Oops: 0000 [Freescale#1] SMP
    CPU: 10 PID: 0 Comm: swapper/10 Not tainted 4.10.0-rc7-dbg+ Freescale#1
    Call Trace:
     <IRQ>
     __ib_process_cq+0x4b/0xd0 [ib_core]
     ib_poll_handler+0x1d/0x70 [ib_core]
     irq_poll_softirq+0xba/0x120
     __do_softirq+0xba/0x4c0
     irq_exit+0xbe/0xd0
     smp_apic_timer_interrupt+0x38/0x50
     apic_timer_interrupt+0x90/0xa0
     </IRQ>
    RIP: srp_recv_done+0x450/0x6b0 [ib_srp] RSP: ffff88046f483e20
    
    Signed-off-by: Bart Van Assche <[email protected]>
    Cc: Israel Rukshin <[email protected]>
    Cc: Max Gurtovoy <[email protected]>
    Cc: Laurence Oberman <[email protected]>
    Cc: Steve Feeley <[email protected]>
    Reviewed-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Bart Van Assche authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    944690c View commit details
    Browse the repository at this point in the history
  17. IB/srp: Fix race conditions related to task management

    commit 0a6fdbd upstream.
    
    Avoid that srp_process_rsp() overwrites the status information
    in ch if the SRP target response timed out and processing of
    another task management function has already started. Avoid that
    issuing multiple task management functions concurrently triggers
    list corruption. This patch prevents that the following stack
    trace appears in the system log:
    
    WARNING: CPU: 8 PID: 9269 at lib/list_debug.c:52 __list_del_entry_valid+0xbc/0xc0
    list_del corruption. prev->next should be ffffc90004bb7b00, but was ffff8804052ecc68
    CPU: 8 PID: 9269 Comm: sg_reset Tainted: G        W       4.10.0-rc7-dbg+ Freescale#3
    Call Trace:
     dump_stack+0x68/0x93
     __warn+0xc6/0xe0
     warn_slowpath_fmt+0x4a/0x50
     __list_del_entry_valid+0xbc/0xc0
     wait_for_completion_timeout+0x12e/0x170
     srp_send_tsk_mgmt+0x1ef/0x2d0 [ib_srp]
     srp_reset_device+0x5b/0x110 [ib_srp]
     scsi_ioctl_reset+0x1c7/0x290
     scsi_ioctl+0x12a/0x420
     sd_ioctl+0x9d/0x100
     blkdev_ioctl+0x51e/0x9f0
     block_ioctl+0x38/0x40
     do_vfs_ioctl+0x8f/0x700
     SyS_ioctl+0x3c/0x70
     entry_SYSCALL_64_fastpath+0x18/0xad
    
    Signed-off-by: Bart Van Assche <[email protected]>
    Cc: Israel Rukshin <[email protected]>
    Cc: Max Gurtovoy <[email protected]>
    Cc: Laurence Oberman <[email protected]>
    Cc: Steve Feeley <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Bart Van Assche authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    6962554 View commit details
    Browse the repository at this point in the history
  18. ktest: Fix child exit code processing

    commit 3267720 upstream.
    
    The child_exit errno needs to be shifted by 8 bits to compare against the
    return values for the bisect variables.
    
    Fixes: c5dacb8 ("ktest: Allow overriding bisect test results")
    Signed-off-by: Steven Rostedt (VMware) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rostedt authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    485171b View commit details
    Browse the repository at this point in the history
  19. ceph: remove req from unsafe list when unregistering it

    commit df963ea upstream.
    
    There's no reason a request should ever be on a s_unsafe list but not
    in the request tree.
    
    Link: http://tracker.ceph.com/issues/18474
    Signed-off-by: Jeff Layton <[email protected]>
    Reviewed-by: Yan, Zheng <[email protected]>
    Signed-off-by: Ilya Dryomov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jtlayton authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    05a9143 View commit details
    Browse the repository at this point in the history
  20. target: Fix NULL dereference during LUN lookup + active I/O shutdown

    commit bd4e2d2 upstream.
    
    When transport_clear_lun_ref() is shutting down a se_lun via
    configfs with new I/O in-flight, it's possible to trigger a
    NULL pointer dereference in transport_lookup_cmd_lun() due
    to the fact percpu_ref_get() doesn't do any __PERCPU_REF_DEAD
    checking before incrementing lun->lun_ref.count after
    lun->lun_ref has switched to atomic_t mode.
    
    This results in a NULL pointer dereference as LUN shutdown
    code in core_tpg_remove_lun() continues running after the
    existing ->release() -> core_tpg_lun_ref_release() callback
    completes, and clears the RCU protected se_lun->lun_se_dev
    pointer.
    
    During the OOPs, the state of lun->lun_ref in the process
    which triggered the NULL pointer dereference looks like
    the following on v4.1.y stable code:
    
    struct se_lun {
      lun_link_magic = 4294932337,
      lun_status = TRANSPORT_LUN_STATUS_FREE,
    
      .....
    
      lun_se_dev = 0x0,
      lun_sep = 0x0,
    
      .....
    
      lun_ref = {
        count = {
          counter = 1
        },
        percpu_count_ptr = 3,
        release = 0xffffffffa02fa1e0 <core_tpg_lun_ref_release>,
        confirm_switch = 0x0,
        force_atomic = false,
        rcu = {
          next = 0xffff88154fa1a5d0,
          func = 0xffffffff8137c4c0 <percpu_ref_switch_to_atomic_rcu>
        }
      }
    }
    
    To address this bug, use percpu_ref_tryget_live() to ensure
    once __PERCPU_REF_DEAD is visable on all CPUs and ->lun_ref
    has switched to atomic_t, all new I/Os will fail to obtain
    a new lun->lun_ref reference.
    
    Also use an explicit percpu_ref_kill_and_confirm() callback
    to block on ->lun_ref_comp to allow the first stage and
    associated RCU grace period to complete, and then block on
    ->lun_ref_shutdown waiting for the final percpu_ref_put()
    to drop the last reference via transport_lun_remove_cmd()
    before continuing with core_tpg_remove_lun() shutdown.
    
    Reported-by: Rob Millner <[email protected]>
    Tested-by: Rob Millner <[email protected]>
    Cc: Rob Millner <[email protected]>
    Tested-by: Vaibhav Tandon <[email protected]>
    Cc: Vaibhav Tandon <[email protected]>
    Tested-by: Bryant G. Ly <[email protected]>
    Signed-off-by: Nicholas Bellinger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    nablio3000 authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    ca739e3 View commit details
    Browse the repository at this point in the history
  21. nlm: Ensure callback code also checks that the files match

    commit 251af29 upstream.
    
    It is not sufficient to just check that the lock pids match when
    granting a callback, we also need to ensure that we're granting
    the callback on the right file.
    
    Reported-by: Pankaj Singh <[email protected]>
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Signed-off-by: Trond Myklebust <[email protected]>
    Signed-off-by: Anna Schumaker <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    trondmypd authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    e1c924e View commit details
    Browse the repository at this point in the history
  22. pwm: pca9685: Fix period change with same duty cycle

    commit 8d254a3 upstream.
    
    When first implementing support for changing the output frequency, an
    optimization was added to continue the PWM after changing the prescaler
    without having to reprogram the ON and OFF registers for the duty cycle,
    in case the duty cycle stayed the same. This was flawed, because we
    compared the absolute value of the duty cycle in nanoseconds instead of
    the ratio to the period.
    
    Fix the problem by removing the shortcut.
    
    Fixes: 01ec847 ("pwm-pca9685: Support changing the output frequency")
    Signed-off-by: Clemens Gruber <[email protected]>
    Reviewed-by: Mika Westerberg <[email protected]>
    Signed-off-by: Thierry Reding <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    clemensg authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    6ef213d View commit details
    Browse the repository at this point in the history
  23. xtensa: move parse_tag_fdt out of #ifdef CONFIG_BLK_DEV_INITRD

    commit 4ab1870 upstream.
    
    FDT tag parsing is not related to whether BLK_DEV_INITRD is configured
    or not, move it out of the corresponding #ifdef/#endif block.
    This fixes passing external FDT to the kernel configured w/o
    BLK_DEV_INITRD support.
    
    Signed-off-by: Max Filippov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jcmvbkbc authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    2109632 View commit details
    Browse the repository at this point in the history
  24. mac80211: flush delayed work when entering suspend

    commit a9e9200 upstream.
    
    The issue was found when entering suspend and resume.
    It triggers a warning in:
    mac80211/key.c: ieee80211_enable_keys()
    ...
    WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt ||
                 sdata->crypto_tx_tailroom_pending_dec);
    ...
    
    It points out sdata->crypto_tx_tailroom_pending_dec isn't cleaned up successfully
    in a delayed_work during suspend. Add a flush_delayed_work to fix it.
    
    Signed-off-by: Matt Chen <[email protected]>
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    matt680209 authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    8650af2 View commit details
    Browse the repository at this point in the history
  25. drm/amdgpu: add more cases to DCE11 possible crtc mask setup

    commit 4ce3bd4 upstream.
    
    Add cases for asics with 3 and 5 crtcs.  Fixes an artificial
    limitation on asics with 3 or 5 crtcs.
    
    Fixes:
    https://bugs.freedesktop.org/show_bug.cgi?id=99744
    
    Reviewed-by: Michel Dänzer <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexdeucher authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    0d80ac6 View commit details
    Browse the repository at this point in the history
  26. drm/ast: Fix test for VGA enabled

    commit 905f21a upstream.
    
    The test to see if VGA was already enabled is doing an unnecessary
    second test from a register that may or may not have been initialized
    to a valid value. Remove it.
    
    Signed-off-by: Y.C. Chen <[email protected]>
    Signed-off-by: Benjamin Herrenschmidt <[email protected]>
    Acked-by: Joel Stanley <[email protected]>
    Tested-by: Y.C. Chen <[email protected]>
    Signed-off-by: Dave Airlie <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ycchen0221 authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    8b78765 View commit details
    Browse the repository at this point in the history
  27. drm/ast: Call open_key before enable_mmio in POST code

    commit 9bb92f5 upstream.
    
    open_key enables access the registers used by enable_mmio
    
    Signed-off-by: Y.C. Chen <[email protected]>
    Signed-off-by: Benjamin Herrenschmidt <[email protected]>
    Acked-by: Joel Stanley <[email protected]>
    Tested-by: Y.C. Chen <[email protected]>
    Signed-off-by: Dave Airlie <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ycchen0221 authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    93eab4f View commit details
    Browse the repository at this point in the history
  28. drm/ast: Fix AST2400 POST failure without BMC FW or VBIOS

    commit 3856081 upstream.
    
    The current POST code for the AST2300/2400 family doesn't work properly
    if the chip hasn't been initialized previously by either the BMC own FW
    or the VBIOS. This fixes it.
    
    Signed-off-by: Y.C. Chen <[email protected]>
    Signed-off-by: Benjamin Herrenschmidt <[email protected]>
    Tested-by: Y.C. Chen <[email protected]>
    Acked-by: Joel Stanley <[email protected]>
    Signed-off-by: Dave Airlie <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ycchen0221 authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    b9cfd55 View commit details
    Browse the repository at this point in the history
  29. drm/edid: Add EDID_QUIRK_FORCE_8BPC quirk for Rotel RSX-1058

    commit 36fc579 upstream.
    
    Rotel RSX-1058 is a receiver with 4 HDMI inputs and a HDMI output, all
    1.1.
    
    When a sink that supports deep color is connected to the output, the
    receiver will send EDIDs that advertise this capability, even if it
    isn't possible with HDMI versions earlier than 1.3.
    
    Currently the kernel is assuming that deep color is possible and the
    sink displays an error.
    
    This quirk will make sure that deep color isn't used with this
    particular receiver.
    
    Fixes: 7a0baa6 ("Revert "drm/i915: Disable 12bpc hdmi for now"")
    Signed-off-by: Tomeu Vizoso <[email protected]>
    Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
    Cc: Matt Horan <[email protected]>
    Tested-by: Matt Horan <[email protected]>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99869
    Reviewed-by: Ville Syrjälä <[email protected]>
    Signed-off-by: Ville Syrjälä <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tomeuv authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    36fd36b View commit details
    Browse the repository at this point in the history
  30. drm/ttm: Make sure BOs being swapped out are cacheable

    commit 239ac65 upstream.
    
    The current caching state may not be tt_cached, even though the
    placement contains TTM_PL_FLAG_CACHED, because placement can contain
    multiple caching flags. Trying to swap out such a BO would trip up the
    
    	BUG_ON(ttm->caching_state != tt_cached);
    
    in ttm_tt_swapout.
    
    Signed-off-by: Michel Dänzer <[email protected]>
    Reviewed-by: Thomas Hellstrom <[email protected]>
    Reviewed-by: Christian König <[email protected]>.
    Reviewed-by: Sinclair Yeh <[email protected]>
    Signed-off-by: Christian König <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Michel Dänzer authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    59fc34f View commit details
    Browse the repository at this point in the history
  31. drm/atomic: fix an error code in mode_fixup()

    commit f9ad86e upstream.
    
    Having "ret" be a bool type works for everything except
    ret = funcs->atomic_check().  The other functions all return zero on
    error but ->atomic_check() returns negative error codes.  We want to
    propagate the error code but instead we return 1.
    
    I found this bug with static analysis and I don't know if it affects
    run time.
    
    Fixes: 4cd4df8 ("drm/atomic: Add ->atomic_check() to encoder helpers")
    Signed-off-by: Dan Carpenter <[email protected]>
    Signed-off-by: Daniel Vetter <[email protected]>
    Link: http://patchwork.freedesktop.org/patch/msgid/20170207234601.GA23981@mwanda
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Dan Carpenter authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    bb5b963 View commit details
    Browse the repository at this point in the history
  32. fakelb: fix schedule while atomic

    commit bdca1fd upstream.
    
    This patch changes the spinlock to mutex for the available fakelb phy
    list. When holding the spinlock the ieee802154_unregister_hw is called
    which holding the rtnl_mutex, in that case we get a "BUG: sleeping function
    called from invalid context" error. We simple change the spinlock to
    mutex which allows to hold the rtnl lock there.
    
    Signed-off-by: Alexander Aring <[email protected]>
    Signed-off-by: Marcel Holtmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Alexander Aring authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    77fec8b View commit details
    Browse the repository at this point in the history
  33. drm/i915/dsi: Do not clear DPOUNIT_CLOCK_GATE_DISABLE from vlv_init_d…

    …isplay_clock_gating
    
    commit bb98e72 upstream.
    
    On my Cherrytrail CUBE iwork8 Air tablet PIPE-A would get stuck on loading
    i915 at boot 1 out of every 3 boots, resulting in a non functional LCD.
    Once the i915 driver has successfully loaded, the panel can be disabled /
    enabled without hitting this issue.
    
    The getting stuck is caused by vlv_init_display_clock_gating() clearing
    the DPOUNIT_CLOCK_GATE_DISABLE bit in DSPCLK_GATE_D when called from
    chv_pipe_power_well_ops.enable() on driver load, while a pipe is enabled
    driving the DSI LCD by the BIOS.
    
    Clearing this bit while DSI is in use is a known issue and
    intel_dsi_pre_enable() / intel_dsi_post_disable() already set / clear it
    as appropriate.
    
    This commit modifies vlv_init_display_clock_gating() to leave the
    DPOUNIT_CLOCK_GATE_DISABLE bit alone fixing the pipe getting stuck.
    
    Changes in v2:
    -Replace PIPE-A with "a pipe" or "the pipe" in the commit msg and
    comment
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97330
    Signed-off-by: Hans de Goede <[email protected]>
    Reviewed-by: Ville Syrjälä <[email protected]>
    Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Ville Syrjälä <[email protected]>
    (cherry picked from commit 721d484)
    Signed-off-by: Jani Nikula <[email protected]>
    Signed-off-by: River Zhou <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jwrdegoede authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    7952b64 View commit details
    Browse the repository at this point in the history
  34. libceph: use BUG() instead of BUG_ON(1)

    commit d24cdcd upstream.
    
    I ran into this compile warning, which is the result of BUG_ON(1)
    not always leading to the compiler treating the code path as
    unreachable:
    
        include/linux/ceph/osdmap.h: In function 'ceph_can_shift_osds':
        include/linux/ceph/osdmap.h:62:1: error: control reaches end of non-void function [-Werror=return-type]
    
    Using BUG() here avoids the warning.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Ilya Dryomov <[email protected]>
    Cc: Heinrich Schuchardt <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    13ef90e View commit details
    Browse the repository at this point in the history
  35. fat: fix using uninitialized fields of fat_inode/fsinfo_inode

    commit c0d0e35 upstream.
    
    Recently fallocate patch was merged and it uses
    MSDOS_I(inode)->mmu_private at fat_evict_inode().  However,
    fat_inode/fsinfo_inode that was introduced in past didn't initialize
    MSDOS_I(inode) properly.
    
    With those combinations, it became the cause of accessing random entry
    in FAT area.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: OGAWA Hirofumi <[email protected]>
    Reported-by: Moreno Bartalucci <[email protected]>
    Tested-by: Moreno Bartalucci <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    OGAWAHirofumi authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    8353f33 View commit details
    Browse the repository at this point in the history
  36. drivers: hv: Turn off write permission on the hypercall page

    commit 372b1e9 upstream.
    
    The hypercall page only needs to be executable but currently it is setup to
    be writable as well. Fix the issue.
    
    Signed-off-by: K. Y. Srinivasan <[email protected]>
    Acked-by: Kees Cook <[email protected]>
    Reported-by: Stephen Hemminger <[email protected]>
    Tested-by: Stephen Hemminger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kattisrinivasan authored and gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    4cdfa66 View commit details
    Browse the repository at this point in the history
  37. Linux 4.4.54

    gregkh committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    804a935 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2017

  1. USB: serial: digi_acceleport: fix OOB data sanity check

    commit 2d38088 upstream.
    
    Make sure to check for short transfers to avoid underflow in a loop
    condition when parsing the receive buffer.
    
    Also fix an off-by-one error in the incomplete sanity check which could
    lead to invalid data being parsed.
    
    Fixes: 8c209e6 ("USB: make actual_length in struct urb field u32")
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Reviewed-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    4d95645 View commit details
    Browse the repository at this point in the history
  2. USB: serial: digi_acceleport: fix OOB-event processing

    commit 2e46565 upstream.
    
    A recent change claimed to fix an off-by-one error in the OOB-port
    completion handler, but instead introduced such an error. This could
    specifically led to modem-status changes going unnoticed, effectively
    breaking TIOCMGET.
    
    Note that the offending commit fixes a loop-condition underflow and is
    marked for stable, but should not be backported without this fix.
    
    Reported-by: Ben Hutchings <[email protected]>
    Fixes: 2d38088 ("USB: serial: digi_acceleport: fix OOB data sanity
    check")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    a8cb5c0 View commit details
    Browse the repository at this point in the history
  3. crypto: improve gcc optimization flags for serpent and wp512

    commit 7d6e910 upstream.
    
    An ancient gcc bug (first reported in 2003) has apparently resurfaced
    on MIPS, where kernelci.org reports an overly large stack frame in the
    whirlpool hash algorithm:
    
    crypto/wp512.c:987:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=]
    
    With some testing in different configurations, I'm seeing large
    variations in stack frames size up to 1500 bytes for what should have
    around 300 bytes at most. I also checked the reference implementation,
    which is essentially the same code but also comes with some test and
    benchmarking infrastructure.
    
    It seems that recent compiler versions on at least arm, arm64 and powerpc
    have a partial fix for this problem, but enabling "-fsched-pressure", but
    even with that fix they suffer from the issue to a certain degree. Some
    testing on arm64 shows that the time needed to hash a given amount of
    data is roughly proportional to the stack frame size here, which makes
    sense given that the wp512 implementation is doing lots of loads for
    table lookups, and the problem with the overly large stack is a result
    of doing a lot more loads and stores for spilled registers (as seen from
    inspecting the object code).
    
    Disabling -fschedule-insns consistently fixes the problem for wp512,
    in my collection of cross-compilers, the results are consistently better
    or identical when comparing the stack sizes in this function, though
    some architectures (notable x86) have schedule-insns disabled by
    default.
    
    The four columns are:
    default: -O2
    press:	 -O2 -fsched-pressure
    nopress: -O2 -fschedule-insns -fno-sched-pressure
    nosched: -O2 -no-schedule-insns (disables sched-pressure)
    
    				default	press	nopress	nosched
    alpha-linux-gcc-4.9.3		1136	848	1136	176
    am33_2.0-linux-gcc-4.9.3	2100	2076	2100	2104
    arm-linux-gnueabi-gcc-4.9.3	848	848	1048	352
    cris-linux-gcc-4.9.3		272	272	272	272
    frv-linux-gcc-4.9.3		1128	1000	1128	280
    hppa64-linux-gcc-4.9.3		1128	336	1128	184
    hppa-linux-gcc-4.9.3		644	308	644	276
    i386-linux-gcc-4.9.3		352	352	352	352
    m32r-linux-gcc-4.9.3		720	656	720	268
    microblaze-linux-gcc-4.9.3	1108	604	1108	256
    mips64-linux-gcc-4.9.3		1328	592	1328	208
    mips-linux-gcc-4.9.3		1096	624	1096	240
    powerpc64-linux-gcc-4.9.3	1088	432	1088	160
    powerpc-linux-gcc-4.9.3		1080	584	1080	224
    s390-linux-gcc-4.9.3		456	456	624	360
    sh3-linux-gcc-4.9.3		292	292	292	292
    sparc64-linux-gcc-4.9.3		992	240	992	208
    sparc-linux-gcc-4.9.3		680	592	680	312
    x86_64-linux-gcc-4.9.3		224	240	272	224
    xtensa-linux-gcc-4.9.3		1152	704	1152	304
    
    aarch64-linux-gcc-7.0.0		224	224	1104	208
    arm-linux-gnueabi-gcc-7.0.1	824	824	1048	352
    mips-linux-gcc-7.0.0		1120	648	1120	272
    x86_64-linux-gcc-7.0.1		240	240	304	240
    
    arm-linux-gnueabi-gcc-4.4.7	840			392
    arm-linux-gnueabi-gcc-4.5.4	784	728	784	320
    arm-linux-gnueabi-gcc-4.6.4	736	728	736	304
    arm-linux-gnueabi-gcc-4.7.4	944	784	944	352
    arm-linux-gnueabi-gcc-4.8.5	464	464	760	352
    arm-linux-gnueabi-gcc-4.9.3	848	848	1048	352
    arm-linux-gnueabi-gcc-5.3.1	824	824	1064	336
    arm-linux-gnueabi-gcc-6.1.1	808	808	1056	344
    arm-linux-gnueabi-gcc-7.0.1	824	824	1048	352
    
    Trying the same test for serpent-generic, the picture is a bit different,
    and while -fno-schedule-insns is generally better here than the default,
    -fsched-pressure wins overall, so I picked that instead.
    
    				default	press	nopress	nosched
    alpha-linux-gcc-4.9.3		1392	864	1392	960
    am33_2.0-linux-gcc-4.9.3	536	524	536	528
    arm-linux-gnueabi-gcc-4.9.3	552	552	776	536
    cris-linux-gcc-4.9.3		528	528	528	528
    frv-linux-gcc-4.9.3		536	400	536	504
    hppa64-linux-gcc-4.9.3		524	208	524	480
    hppa-linux-gcc-4.9.3		768	472	768	508
    i386-linux-gcc-4.9.3		564	564	564	564
    m32r-linux-gcc-4.9.3		712	576	712	532
    microblaze-linux-gcc-4.9.3	724	392	724	512
    mips64-linux-gcc-4.9.3		720	384	720	496
    mips-linux-gcc-4.9.3		728	384	728	496
    powerpc64-linux-gcc-4.9.3	704	304	704	480
    powerpc-linux-gcc-4.9.3		704	296	704	480
    s390-linux-gcc-4.9.3		560	560	592	536
    sh3-linux-gcc-4.9.3		540	540	540	540
    sparc64-linux-gcc-4.9.3		544	352	544	496
    sparc-linux-gcc-4.9.3		544	344	544	496
    x86_64-linux-gcc-4.9.3		528	536	576	528
    xtensa-linux-gcc-4.9.3		752	544	752	544
    
    aarch64-linux-gcc-7.0.0		432	432	656	480
    arm-linux-gnueabi-gcc-7.0.1	616	616	808	536
    mips-linux-gcc-7.0.0		720	464	720	488
    x86_64-linux-gcc-7.0.1		536	528	600	536
    
    arm-linux-gnueabi-gcc-4.4.7	592			440
    arm-linux-gnueabi-gcc-4.5.4	776	448	776	544
    arm-linux-gnueabi-gcc-4.6.4	776	448	776	544
    arm-linux-gnueabi-gcc-4.7.4	768	448	768	544
    arm-linux-gnueabi-gcc-4.8.5	488	488	776	544
    arm-linux-gnueabi-gcc-4.9.3	552	552	776	536
    arm-linux-gnueabi-gcc-5.3.1	552	552	776	536
    arm-linux-gnueabi-gcc-6.1.1	560	560	776	536
    arm-linux-gnueabi-gcc-7.0.1	616	616	808	536
    
    I did not do any runtime tests with serpent, so it is possible that stack
    frame size does not directly correlate with runtime performance here and
    it actually makes things worse, but it's more likely to help here, and
    the reduced stack frame size is probably enough reason to apply the patch,
    especially given that the crypto code is often used in deep call chains.
    
    Link: https://kernelci.org/build/id/58797d7559b5149efdf6c3a9/logs/
    Link: http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html
    Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11488
    Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
    Cc: Ralf Baechle <[email protected]>
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    e041ad0 View commit details
    Browse the repository at this point in the history
  4. MIPS: Update defconfigs for NF_CT_PROTO_DCCP/UDPLITE change

    commit 9ddc16a upstream.
    
    In linux-4.10-rc, NF_CT_PROTO_UDPLITE and NF_CT_PROTO_DCCP are bool
    symbols instead of tristate, and kernelci.org reports a bunch of
    warnings for this, like:
    
    arch/mips/configs/malta_kvm_guest_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
    arch/mips/configs/malta_defconfig:62:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
    arch/mips/configs/malta_defconfig:63:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
    arch/mips/configs/ip22_defconfig:70:warning: symbol value 'm' invalid for NF_CT_PROTO_DCCP
    arch/mips/configs/ip22_defconfig:71:warning: symbol value 'm' invalid for NF_CT_PROTO_UDPLITE
    
    This changes all the MIPS defconfigs with these symbols to have them
    built-in.
    
    Fixes: 9b91c96 ("netfilter: conntrack: built-in support for UDPlite")
    Fixes: c51d390 ("netfilter: conntrack: built-in support for DCCP")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14999/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    adc48c7 View commit details
    Browse the repository at this point in the history
  5. MIPS: ip27: Disable qlge driver in defconfig

    commit b617649 upstream.
    
    One of the last remaining failures in kernelci.org is for a gcc bug:
    
    drivers/net/ethernet/qlogic/qlge/qlge_main.c:4819:1: error: insn does not satisfy its constraints:
    drivers/net/ethernet/qlogic/qlge/qlge_main.c:4819:1: internal compiler error: in extract_constrain_insn, at recog.c:2190
    
    This is apparently broken in gcc-6 but fixed in gcc-7, and I cannot
    reproduce the problem here. However, it is clear that ip27_defconfig
    does not actually need this driver as the platform has only PCI-X but
    not PCIe, and the qlge adapter in turn is PCIe-only.
    
    The driver was originally enabled in 2010 along with lots of other
    drivers.
    
    Fixes: 59d302b ("MIPS: IP27: Make defconfig useful again.")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/15197/
    Signed-off-by: James Hogan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    8ed0fdc View commit details
    Browse the repository at this point in the history
  6. MIPS: Update ip27_defconfig for SCSI_DH change

    commit ea58fca upstream.
    
    Since linux-4.3, SCSI_DH is a bool symbol, causing a warning in
    kernelci.org:
    
    arch/mips/configs/ip27_defconfig:136:warning: symbol value 'm' invalid for SCSI_DH
    
    This updates the defconfig to have the feature built-in.
    
    Fixes: 086b91d ("scsi_dh: integrate into the core SCSI code")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/15001/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    7a6a965 View commit details
    Browse the repository at this point in the history
  7. MIPS: ip22: Fix ip28 build for modern gcc

    commit 23ca9b5 upstream.
    
    kernelci reports a failure of the ip28_defconfig build after upgrading its
    gcc version:
    
    arch/mips/sgi-ip22/Platform:29: *** gcc doesn't support needed option -mr10k-cache-barrier=store.  Stop.
    
    The problem apparently is that the -mr10k-cache-barrier=store option is now
    rejected for CPUs other than r10k. Explicitly including the CPU in the
    check fixes this and is safe because both options were introduced in
    gcc-4.4.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/15049/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    c018595 View commit details
    Browse the repository at this point in the history
  8. MIPS: Update lemote2f_defconfig for CPU_FREQ_STAT change

    commit b3f6046 upstream.
    
    Since linux-4.8, CPU_FREQ_STAT is a bool symbol, causing a warning in
    kernelci.org:
    
    arch/mips/configs/lemote2f_defconfig:42:warning: symbol value 'm' invalid for CPU_FREQ_STAT
    
    This updates the defconfig to have the feature built-in.
    
    Fixes: 1aefc75 ("cpufreq: stats: Make the stats code non-modular")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/15000/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    d2a8d74 View commit details
    Browse the repository at this point in the history
  9. mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy

    commit 906b268 upstream.
    
    kernelci.org reports a warning for this driver, as it copies a local
    variable into a 'const char *' string:
    
        drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    
    Using kstrndup() simplifies the code and avoids the warning.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Acked-by: Marek Vasut <[email protected]>
    Signed-off-by: Brian Norris <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    3dc8f1e View commit details
    Browse the repository at this point in the history
  10. MIPS: ralink: Cosmetic change to prom_init().

    commit 9c48568 upstream.
    
    Over the years the code has been changed various times leading to
    argc/argv being defined in a different function to where we actually
    use the variables. Clean this up by moving them to prom_init_cmdline().
    
    Signed-off-by: John Crispin <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/14902/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    blogic authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    4b91e7a View commit details
    Browse the repository at this point in the history
  11. MIPS: ralink: Remove unused rt*_wdt_reset functions

    commit 886f9c6 upstream.
    
    All pointers to these functions were removed, so now they produce
    warnings:
    
    arch/mips/ralink/rt305x.c:92:13: error: 'rt305x_wdt_reset' defined but not used [-Werror=unused-function]
    
    This removes the functions. If we need them again, the patch can be
    reverted later.
    
    Fixes: f576fb6 ("MIPS: ralink: cleanup the soc specific pinmux data")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Cc: John Crispin <[email protected]>
    Cc: Colin Ian King <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/15044/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    3288338 View commit details
    Browse the repository at this point in the history
  12. cpmac: remove hopeless #warning

    commit d43e6fb upstream.
    
    The #warning was present 10 years ago when the driver first got merged.
    As the platform is rather obsolete by now, it seems very unlikely that
    the warning will cause anyone to fix the code properly.
    
    kernelci.org reports the warning for every build in the meantime, so
    I think it's better to just turn it into a code comment to reduce
    noise.
    
    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 Mar 18, 2017
    Configuration menu
    Copy the full SHA
    5e45d83 View commit details
    Browse the repository at this point in the history
  13. mm: memcontrol: avoid unused function warning

    commit 358c07f upstream.
    
    A bugfix in v4.8-rc2 introduced a harmless warning when
    CONFIG_MEMCG_SWAP is disabled but CONFIG_MEMCG is enabled:
    
      mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function]
       static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
    
    This moves the function inside of the #ifdef block that hides the
    calling function, to avoid the warning.
    
    Fixes: 1f47b61 ("mm: memcontrol: fix swap counter leak on swapout from offline cgroup")
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Arnd Bergmann <[email protected]>
    Acked-by: Michal Hocko <[email protected]>
    Acked-by: Vladimir Davydov <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    5fad174 View commit details
    Browse the repository at this point in the history
  14. MIPS: DEC: Avoid la pseudo-instruction in delay slots

    commit 3021773 upstream.
    
    When expanding the la or dla pseudo-instruction in a delay slot the GNU
    assembler will complain should the pseudo-instruction expand to multiple
    actual instructions, since only the first of them will be in the delay
    slot leading to the pseudo-instruction being only partially executed if
    the branch is taken. Use of PTR_LA in the dec int-handler.S leads to
    such warnings:
    
      arch/mips/dec/int-handler.S: Assembler messages:
      arch/mips/dec/int-handler.S:149: Warning: macro instruction expanded into multiple instructions in a branch delay slot
      arch/mips/dec/int-handler.S:198: Warning: macro instruction expanded into multiple instructions in a branch delay slot
    
    Avoid this by open coding the PTR_LA macros.
    
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ralfbaechle authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    2e4aff2 View commit details
    Browse the repository at this point in the history
  15. MIPS: Netlogic: Fix CP0_EBASE redefinition warnings

    commit 32eb6e8 upstream.
    
    A couple of netlogic assembly files define CP0_EBASE to $15, the same as
    CP0_PRID in mipsregs.h, and use it for accessing both CP0_PRId and
    CP0_EBase registers. However commit 609cf6f ("MIPS: CPS: Early
    debug using an ns16550-compatible UART") added a different definition of
    CP0_EBASE to mipsregs.h, which included a register select of 1. This
    causes harmless build warnings like the following:
    
      arch/mips/netlogic/common/reset.S:53:0: warning: "CP0_EBASE" redefined
      #define CP0_EBASE $15
      ^
      In file included from arch/mips/netlogic/common/reset.S:41:0:
      ./arch/mips/include/asm/mipsregs.h:63:0: note: this is the location of the previous definition
      #define CP0_EBASE $15, 1
      ^
    
    Update the code to use the definitions from mipsregs.h for accessing
    both registers.
    
    Fixes: 609cf6f ("MIPS: CPS: Early debug using an ns16550-compatible UART")
    Signed-off-by: James Hogan <[email protected]>
    Acked-by: Jayachandran C <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/13183/
    Signed-off-by: Ralf Baechle <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    James Hogan authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    1276510 View commit details
    Browse the repository at this point in the history
  16. tracing: Add #undef to fix compile error

    commit bf7165c upstream.
    
    There are several trace include files that define TRACE_INCLUDE_FILE.
    
    Include several of them in the same .c file (as I currently have in
    some code I am working on), and the compile will blow up with a
    "warning: "TRACE_INCLUDE_FILE" redefined #define TRACE_INCLUDE_FILE syscalls"
    
    Every other include file in include/trace/events/ avoids that issue
    by having a #undef TRACE_INCLUDE_FILE before the #define; syscalls.h
    should have one, too.
    
    Link: http://lkml.kernel.org/r/[email protected]
    
    Fixes: b8007ef ("tracing: Separate raw syscall from syscall tracer")
    Signed-off-by: Rik van Riel <[email protected]>
    Signed-off-by: Steven Rostedt (VMware) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Rik van Riel authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    0748934 View commit details
    Browse the repository at this point in the history
  17. powerpc: Emulation support for load/store instructions on LE

    commit e148bd1 upstream.
    
    emulate_step() uses a number of underlying kernel functions that were
    initially not enabled for LE. This has been rectified since. So, fix
    emulate_step() for LE for the corresponding instructions.
    
    Reported-by: Anton Blanchard <[email protected]>
    Signed-off-by: Ravi Bangoria <[email protected]>
    Signed-off-by: Michael Ellerman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Ravi Bangoria authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    2ca39d1 View commit details
    Browse the repository at this point in the history
  18. usb: gadget: dummy_hcd: clear usb_gadget region before registration

    commit 5bbc852 upstream.
    
    When the user does device unbind and rebind test, the kernel will
    show below dump due to usb_gadget memory region is dirty after unbind.
    Clear usb_gadget region for every new probe.
    
    root@imx6qdlsolo:/sys/bus/platform/drivers/dummy_udc# echo dummy_udc.0 > bind
    [  102.523312] kobject (eddd78b0): tried to init an initialized object, something is seriously wrong.
    [  102.532447] CPU: 0 PID: 734 Comm: sh Not tainted 4.10.0-rc7-00872-g1b2b8e9 #1298
    [  102.539866] Hardware name: Freescale i.MX6 SoloX (Device Tree)
    [  102.545717] Backtrace:
    [  102.548225] [<c010d090>] (dump_backtrace) from [<c010d338>] (show_stack+0x18/0x1c)
    [  102.555822]  r7:ede34000 r6:60010013 r5:00000000 r4:c0f29418
    [  102.561512] [<c010d320>] (show_stack) from [<c040c2a4>] (dump_stack+0xb4/0xe8)
    [  102.568764] [<c040c1f0>] (dump_stack) from [<c040e6d4>] (kobject_init+0x80/0x9c)
    [  102.576187]  r10:0000001f r9:eddd7000 r8:eeaf8c10 r7:eddd78a8 r6:c177891c r5:c0f3b060
    [  102.584036]  r4:eddd78b0 r3:00000000
    [  102.587641] [<c040e654>] (kobject_init) from [<c05359a4>] (device_initialize+0x28/0xf8)
    [  102.595665]  r5:eebc4800 r4:eddd78a8
    [  102.599268] [<c053597c>] (device_initialize) from [<c05382ac>] (device_register+0x14/0x20)
    [  102.607556]  r7:eddd78a8 r6:00000000 r5:eebc4800 r4:eddd78a8
    [  102.613256] [<c0538298>] (device_register) from [<c0668ef4>] (usb_add_gadget_udc_release+0x8c/0x1ec)
    [  102.622410]  r5:eebc4800 r4:eddd7860
    [  102.626015] [<c0668e68>] (usb_add_gadget_udc_release) from [<c0669068>] (usb_add_gadget_udc+0x14/0x18)
    [  102.635351]  r10:0000001f r9:eddd7000 r8:eddd788c r7:bf003770 r6:eddd77f8 r5:eddd7818
    [  102.643198]  r4:eddd785c r3:eddd7b24
    [  102.646834] [<c0669054>] (usb_add_gadget_udc) from [<bf003428>] (dummy_udc_probe+0x170/0x1c4 [dummy_hcd])
    [  102.656458] [<bf0032b8>] (dummy_udc_probe [dummy_hcd]) from [<c053d114>] (platform_drv_probe+0x54/0xb8)
    [  102.665881]  r10:00000008 r9:c1778960 r8:bf004128 r7:fffffdfb r6:bf004128 r5:eeaf8c10
    [  102.673727]  r4:eeaf8c10
    [  102.676293] [<c053d0c0>] (platform_drv_probe) from [<c053b160>] (driver_probe_device+0x264/0x474)
    [  102.685186]  r7:00000000 r6:00000000 r5:c1778960 r4:eeaf8c10
    [  102.690876] [<c053aefc>] (driver_probe_device) from [<c05397c4>] (bind_store+0xb8/0x14c)
    [  102.698994]  r10:eeb3bb4c r9:ede34000 r8:0000000c r7:eeaf8c44 r6:bf004128 r5:c0f3b668
    [  102.706840]  r4:eeaf8c10
    [  102.709402] [<c053970c>] (bind_store) from [<c0538ca8>] (drv_attr_store+0x28/0x34)
    [  102.716998]  r9:ede34000 r8:00000000 r7:ee3863c0 r6:ee3863c0 r5:c0538c80 r4:c053970c
    [  102.724776] [<c0538c80>] (drv_attr_store) from [<c029c930>] (sysfs_kf_write+0x50/0x54)
    [  102.732711]  r5:c0538c80 r4:0000000c
    [  102.736313] [<c029c8e0>] (sysfs_kf_write) from [<c029be84>] (kernfs_fop_write+0x100/0x214)
    [  102.744599]  r7:ee3863c0 r6:eeb3bb40 r5:00000000 r4:00000000
    [  102.750287] [<c029bd84>] (kernfs_fop_write) from [<c0222dd8>] (__vfs_write+0x34/0x120)
    [  102.758231]  r10:00000000 r9:ede34000 r8:c0108bc4 r7:0000000c r6:ede35f80 r5:c029bd84
    [  102.766077]  r4:ee223780
    [  102.768638] [<c0222da4>] (__vfs_write) from [<c0224678>] (vfs_write+0xa8/0x170)
    [  102.775974]  r9:ede34000 r8:c0108bc4 r7:ede35f80 r6:01861cb0 r5:ee223780 r4:0000000c
    [  102.783743] [<c02245d0>] (vfs_write) from [<c0225498>] (SyS_write+0x4c/0xa8)
    [  102.790818]  r9:ede34000 r8:c0108bc4 r7:0000000c r6:01861cb0 r5:ee223780 r4:ee223780
    [  102.798595] [<c022544c>] (SyS_write) from [<c0108a20>] (ret_fast_syscall+0x0/0x1c)
    [  102.806188]  r7:00000004 r6:b6e83d58 r5:01861cb0 r4:0000000c
    
    Fixes: 90fccb5 ("usb: gadget: Gadget directory cleanup - group UDC drivers")
    Acked-by: Alan Stern <[email protected]>
    Signed-off-by: Peter Chen <[email protected]>
    Tested-by: Xiaolong Ye <[email protected]>
    Reported-by: Fengguang Wu <[email protected]>
    Signed-off-by: Felipe Balbi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Peter Chen authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    f47b97f View commit details
    Browse the repository at this point in the history
  19. usb: dwc3: gadget: make Set Endpoint Configuration macros safe

    commit 7369090 upstream.
    
    Some gadget drivers are bad, bad boys. We notice
    that ADB was passing bad Burst Size which caused top
    bits of param0 to be overwritten which confused DWC3
    when running this command.
    
    In order to avoid future issues, we're going to make
    sure values passed by macros are always safe for the
    controller. Note that ADB still needs a fix to *not*
    pass bad values.
    
    Reported-by: Mohamed Abbas <[email protected]>
    Sugested-by: Adam Andruszak <[email protected]>
    Signed-off-by: Felipe Balbi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Felipe Balbi authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    10af248 View commit details
    Browse the repository at this point in the history
  20. usb: gadget: function: f_fs: pass companion descriptor along

    commit 2bfa071 upstream.
    
    If we're dealing with SuperSpeed endpoints, we need
    to make sure to pass along the companion descriptor
    and initialize fields needed by the Gadget
    API. Eventually, f_fs.c should be converted to use
    config_ep_by_speed() like all other functions,
    though.
    
    Signed-off-by: Felipe Balbi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Felipe Balbi authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    4a1a3bb View commit details
    Browse the repository at this point in the history
  21. usb: host: xhci-dbg: HCIVERSION should be a binary number

    commit f95e60a upstream.
    
    According to xHCI spec, HCIVERSION containing a BCD encoding
    of the xHCI specification revision number, 0100h corresponds
    to xHCI version 1.0. Change "100" as "0x100".
    
    Cc: Lu Baolu <[email protected]>
    Fixes: 04abb6d ("xhci: Read and parse new xhci 1.1 capability register")
    Signed-off-by: Peter Chen <[email protected]>
    Signed-off-by: Mathias Nyman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Peter Chen authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    40c5634 View commit details
    Browse the repository at this point in the history
  22. usb: host: xhci-plat: Fix timeout on removal of hot pluggable xhci co…

    …ntrollers
    
    commit dcc7620 upstream.
    
    Upstream commit 98d74f9 ("xhci: fix 10 second timeout on removal of
    PCI hotpluggable xhci controllers") fixes a problem with hot pluggable PCI
    xhci controllers which can result in excessive timeouts, to the point where
    the system reports a deadlock.
    
    The same problem is seen with hot pluggable xhci controllers using the
    xhci-plat driver, such as the driver used for Type-C ports on rk3399.
    Similar to hot-pluggable PCI controllers, the driver for this chip
    removes the xhci controller from the system when the Type-C cable is
    disconnected.
    
    The solution for PCI devices works just as well for non-PCI devices
    and avoids the problem.
    
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Mathias Nyman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    groeck authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    cf09c7d View commit details
    Browse the repository at this point in the history
  23. USB: serial: safe_serial: fix information leak in completion handler

    commit 8c76d7c upstream.
    
    Add missing sanity check to the bulk-in completion handler to avoid an
    integer underflow that could be triggered by a malicious device.
    
    This avoids leaking up to 56 bytes from after the URB transfer buffer to
    user space.
    
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    3cdc946 View commit details
    Browse the repository at this point in the history
  24. USB: serial: omninet: fix reference leaks at open

    commit 3057241 upstream.
    
    This driver needlessly took another reference to the tty on open, a
    reference which was then never released on close. This lead to not just
    a leak of the tty, but also a driver reference leak that prevented the
    driver from being unloaded after a port had once been opened.
    
    Fixes: 4a90f09 ("tty: usb-serial krefs")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    54f11a9 View commit details
    Browse the repository at this point in the history
  25. USB: iowarrior: fix NULL-deref at probe

    commit b7321e8 upstream.
    
    Make sure to check for the required interrupt-in endpoint to avoid
    dereferencing a NULL-pointer should a malicious device lack such an
    endpoint.
    
    Note that a fairly recent change purported to fix this issue, but added
    an insufficient test on the number of endpoints only, a test which can
    now be removed.
    
    Fixes: 4ec0ef3 ("USB: iowarrior: fix oops with malicious USB descriptors")
    Fixes: 946b960 ("USB: add driver for iowarrior devices.")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    179295c View commit details
    Browse the repository at this point in the history
  26. USB: iowarrior: fix NULL-deref in write

    commit de46e56 upstream.
    
    Make sure to verify that we have the required interrupt-out endpoint for
    IOWarrior56 devices to avoid dereferencing a NULL-pointer in write
    should a malicious device lack such an endpoint.
    
    Fixes: 946b960 ("USB: add driver for iowarrior devices.")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    6498086 View commit details
    Browse the repository at this point in the history
  27. USB: serial: io_ti: fix NULL-deref in interrupt callback

    commit 0b1d250 upstream.
    
    Fix a NULL-pointer dereference in the interrupt callback should a
    malicious device send data containing a bad port number by adding the
    missing sanity check.
    
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    e71c7ba View commit details
    Browse the repository at this point in the history
  28. USB: serial: io_ti: fix information leak in completion handler

    commit 654b404 upstream.
    
    Add missing sanity check to the bulk-in completion handler to avoid an
    integer underflow that can be triggered by a malicious device.
    
    This avoids leaking 128 kB of memory content from after the URB transfer
    buffer to user space.
    
    Fixes: 8c209e6 ("USB: make actual_length in struct urb field u32")
    Fixes: 1da177e ("Linux-2.6.12-rc2")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    72bb2b9 View commit details
    Browse the repository at this point in the history
  29. serial: samsung: Continue to work if DMA request fails

    commit f98c7bc upstream.
    
    If DMA is not available (even when configured in DeviceTree), the driver
    will fail the startup procedure thus making serial console not
    available.
    
    For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
        [    1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000
        ...
        [   11.435732] samsung-uart 13800000.serial: DMA request failed
        [   72.963893] samsung-uart 13800000.serial: DMA request failed
        [   73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
    
    DMA is not necessary for serial to work, so continue with UART startup
    after emitting a warning.
    
    Fixes: 62c37ee ("serial: samsung: add dma reqest/release functions")
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    krzk authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    72ca0ab View commit details
    Browse the repository at this point in the history
  30. mvsas: fix misleading indentation

    commit 7789cd3 upstream.
    
    Fix a smatch warning:
    drivers/scsi/mvsas/mv_sas.c:740 mvs_task_prep() warn: curly braces intended?
    
    The code is correct, the indention is misleading. When the device is not
    ready we want to return SAS_PHY_DOWN. But current indentation makes it
    look like we only do so in the else branch of if (mvi_dev).
    
    Signed-off-by: Luis de Bethencourt <[email protected]>
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    luisbg authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    61fbad6 View commit details
    Browse the repository at this point in the history
  31. KVM: s390: Fix guest migration for huge guests resulting in panic

    commit 2e4d880 upstream.
    
    While we can technically not run huge page guests right now, we can
    setup a guest with huge pages. Trying to migrate it will trigger a
    VM_BUG_ON and, if the kernel is not configured to panic on a BUG, it
    will happily try to work on non-existing page table entries.
    
    With this patch, we always return "dirty" if we encounter a large page
    when migrating. This at least fixes the immediate problem until we
    have proper handling for both kind of pages.
    
    Fixes: 15f36eb ("KVM: s390: Add proper dirty bitmap support to S390 kvm.")
    Cc: <[email protected]> # 3.16+
    
    Signed-off-by: Janosch Frank <[email protected]>
    Acked-by: Christian Borntraeger <[email protected]>
    Signed-off-by: Martin Schwidefsky <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Janosch Frank authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    b0e8570 View commit details
    Browse the repository at this point in the history
  32. s390/kdump: Use "LINUX" ELF note name instead of "CORE"

    commit a4a81d8 upstream.
    
    In binutils/libbfd (bfd/elf.c) it is enforced that all s390 specific ELF
    notes like e.g. NT_S390_PREFIX or NT_S390_CTRS have "LINUX" specified
    as note name. Otherwise the notes are ignored.
    
    For /proc/vmcore we currently use "CORE" for these notes.
    
    Up to now this has not been a real problem because the dump analysis tool
    "crash" does not check the note name. But it will break all programs that
    use libbfd for processing ELF notes.
    
    So fix this and use "LINUX" for all s390 specific notes to comply with
    libbfd.
    
    Reported-by: Philipp Rudo <[email protected]>
    Reviewed-by: Philipp Rudo <[email protected]>
    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 Mar 18, 2017
    Configuration menu
    Copy the full SHA
    a084aee View commit details
    Browse the repository at this point in the history
  33. nfit, libnvdimm: fix interleave set cookie calculation

    commit 86ef58a upstream.
    
    The interleave-set cookie is a sum that sanity checks the composition of
    an interleave set has not changed from when the namespace was initially
    created.  The checksum is calculated by sorting the DIMMs by their
    location in the interleave-set. The comparison for the sort must be
    64-bit wide, not byte-by-byte as performed by memcmp() in the broken
    case.
    
    Fix the implementation to accept correct cookie values in addition to
    the Linux "memcmp" order cookies, but only allow correct cookies to be
    generated going forward. It does mean that namespaces created by
    third-party-tooling, or created by newer kernels with this fix, will not
    validate on older kernels. However, there are a couple mitigating
    conditions:
    
        1/ platforms with namespace-label capable NVDIMMs are not widely
           available.
    
        2/ interleave-sets with a single-dimm are by definition not affected
           (nothing to sort). This covers the QEMU-KVM NVDIMM emulation case.
    
    The cookie stored in the namespace label will be fixed by any write the
    namespace label, the most straightforward way to achieve this is to
    write to the "alt_name" attribute of a namespace in sysfs.
    
    Fixes: eaf9615 ("libnvdimm, nfit: add interleave-set state-tracking infrastructure")
    Reported-by: Nicholas Moulin <[email protected]>
    Tested-by: Nicholas Moulin <[email protected]>
    Signed-off-by: Dan Williams <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    djbw authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    66dd58f View commit details
    Browse the repository at this point in the history
  34. dm: flush queued bios when process blocks to avoid deadlock

    commit d67a5f4 upstream.
    
    Commit df2cb6d ("block: Avoid deadlocks with bio allocation by
    stacking drivers") created a workqueue for every bio set and code
    in bio_alloc_bioset() that tries to resolve some low-memory deadlocks
    by redirecting bios queued on current->bio_list to the workqueue if the
    system is low on memory.  However other deadlocks (see below **) may
    happen, without any low memory condition, because generic_make_request
    is queuing bios to current->bio_list (rather than submitting them).
    
    ** the related dm-snapshot deadlock is detailed here:
    https://www.redhat.com/archives/dm-devel/2016-July/msg00065.html
    
    Fix this deadlock by redirecting any bios on current->bio_list to the
    bio_set's rescue workqueue on every schedule() call.  Consequently,
    when the process blocks on a mutex, the bios queued on
    current->bio_list are dispatched to independent workqueus and they can
    complete without waiting for the mutex to be available.
    
    The structure blk_plug contains an entry cb_list and this list can contain
    arbitrary callback functions that are called when the process blocks.
    To implement this fix DM (ab)uses the onstack plug's cb_list interface
    to get its flush_current_bio_list() called at schedule() time.
    
    This fixes the snapshot deadlock - if the map method blocks,
    flush_current_bio_list() will be called and it redirects bios waiting
    on current->bio_list to appropriate workqueues.
    
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1267650
    Depends-on: df2cb6d ("block: Avoid deadlocks with bio allocation by stacking drivers")
    Signed-off-by: Mikulas Patocka <[email protected]>
    Signed-off-by: Mike Snitzer <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Mikulas Patocka authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    cd8ad4d View commit details
    Browse the repository at this point in the history
  35. ext4: don't BUG when truncating encrypted inodes on the orphan list

    commit 0d06863 upstream.
    
    Fix a BUG when the kernel tries to mount a file system constructed as
    follows:
    
    echo foo > foo.txt
    mke2fs -Fq -t ext4 -O encrypt foo.img 100
    debugfs -w foo.img << EOF
    write foo.txt a
    set_inode_field a i_flags 0x80800
    set_super_value s_last_orphan 12
    quit
    EOF
    
    root@kvm-xfstests:~# mount -o loop foo.img /mnt
    [  160.238770] ------------[ cut here ]------------
    [  160.240106] kernel BUG at /usr/projects/linux/ext4/fs/ext4/inode.c:3874!
    [  160.240106] invalid opcode: 0000 [Freescale#1] SMP
    [  160.240106] Modules linked in:
    [  160.240106] CPU: 0 PID: 2547 Comm: mount Tainted: G        W       4.10.0-rc3-00034-gcdd33b941b67 Freescale#227
    [  160.240106] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1 04/01/2014
    [  160.240106] task: f4518000 task.stack: f47b6000
    [  160.240106] EIP: ext4_block_zero_page_range+0x1a7/0x2b4
    [  160.240106] EFLAGS: 00010246 CPU: 0
    [  160.240106] EAX: 00000001 EBX: f7be4b50 ECX: f47b7dc0 EDX: 00000007
    [  160.240106] ESI: f43b05a8 EDI: f43babec EBP: f47b7dd0 ESP: f47b7dac
    [  160.240106]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    [  160.240106] CR0: 80050033 CR2: bfd85b08 CR3: 34a00680 CR4: 000006f0
    [  160.240106] Call Trace:
    [  160.240106]  ext4_truncate+0x1e9/0x3e5
    [  160.240106]  ext4_fill_super+0x286f/0x2b1e
    [  160.240106]  ? set_blocksize+0x2e/0x7e
    [  160.240106]  mount_bdev+0x114/0x15f
    [  160.240106]  ext4_mount+0x15/0x17
    [  160.240106]  ? ext4_calculate_overhead+0x39d/0x39d
    [  160.240106]  mount_fs+0x58/0x115
    [  160.240106]  vfs_kern_mount+0x4b/0xae
    [  160.240106]  do_mount+0x671/0x8c3
    [  160.240106]  ? _copy_from_user+0x70/0x83
    [  160.240106]  ? strndup_user+0x31/0x46
    [  160.240106]  SyS_mount+0x57/0x7b
    [  160.240106]  do_int80_syscall_32+0x4f/0x61
    [  160.240106]  entry_INT80_32+0x2f/0x2f
    [  160.240106] EIP: 0xb76b919e
    [  160.240106] EFLAGS: 00000246 CPU: 0
    [  160.240106] EAX: ffffffda EBX: 08053838 ECX: 08052188 EDX: 080537e8
    [  160.240106] ESI: c0ed0000 EDI: 00000000 EBP: 080537e8 ESP: bfa13660
    [  160.240106]  DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b
    [  160.240106] Code: 59 8b 00 a8 01 0f 84 09 01 00 00 8b 07 66 25 00 f0 66 3d 00 80 75 61 89 f8 e8 3e e2 ff ff 84 c0 74 56 83 bf 48 02 00 00 00 75 02 <0f> 0b 81 7d e8 00 10 00 00 74 02 0f 0b 8b 43 04 8b 53 08 31 c9
    [  160.240106] EIP: ext4_block_zero_page_range+0x1a7/0x2b4 SS:ESP: 0068:f47b7dac
    [  160.317241] ---[ end trace d6a773a375c810a5 ]---
    
    The problem is that when the kernel tries to truncate an inode in
    ext4_truncate(), it tries to clear any on-disk data beyond i_size.
    Without the encryption key, it can't do that, and so it triggers a
    BUG.
    
    E2fsck does *not* provide this service, and in practice most file
    systems have their orphan list processed by e2fsck, so to avoid
    crashing, this patch skips this step if we don't have access to the
    encryption key (which is the case when processing the orphan list; in
    all other cases, we will have the encryption key, or the kernel
    wouldn't have allowed the file to be opened).
    
    An open question is whether the fact that e2fsck isn't clearing the
    bytes beyond i_size causing problems --- and if we've lived with it
    not doing it for so long, can we drop this from the kernel replay of
    the orphan list in all cases (not just when we don't have the key for
    encrypted inodes).
    
    Addresses-Google-Bug: #35209576
    
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tytso authored and gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    1c5265b View commit details
    Browse the repository at this point in the history
  36. Linux 4.4.55

    gregkh committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    28ec98b View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2017

  1. netlink: remove mmapped netlink support

    commit d1b4c68 upstream.
    
    mmapped netlink has a number of unresolved issues:
    
    - TX zerocopy support had to be disabled more than a year ago via
      commit 4682a03 ("netlink: Always copy on mmap TX.")
      because the content of the mmapped area can change after netlink
      attribute validation but before message processing.
    
    - RX support was implemented mainly to speed up nfqueue dumping packet
      payload to userspace.  However, since commit ae08ce0
      ("netfilter: nfnetlink_queue: zero copy support") we avoid one copy
      with the socket-based interface too (via the skb_zerocopy helper).
    
    The other problem is that skbs attached to mmaped netlink socket
    behave different from normal skbs:
    
    - they don't have a shinfo area, so all functions that use skb_shinfo()
    (e.g. skb_clone) cannot be used.
    
    - reserving headroom prevents userspace from seeing the content as
    it expects message to start at skb->head.
    See for instance
    commit aa3a022 ("netlink: not trim skb for mmaped socket when dump").
    
    - skbs handed e.g. to netlink_ack must have non-NULL skb->sk, else we
    crash because it needs the sk to check if a tx ring is attached.
    
    Also not obvious, leads to non-intuitive bug fixes such as 7c7bdf3
    ("netfilter: nfnetlink: use original skbuff when acking batches").
    
    mmaped netlink also didn't play nicely with the skb_zerocopy helper
    used by nfqueue and openvswitch.  Daniel Borkmann fixed this via
    commit 6bb0fef ("netlink, mmap: fix edge-case leakages in nf queue
    zero-copy")' but at the cost of also needing to provide remaining
    length to the allocation function.
    
    nfqueue also has problems when used with mmaped rx netlink:
    - mmaped netlink doesn't allow use of nfqueue batch verdict messages.
      Problem is that in the mmap case, the allocation time also determines
      the ordering in which the frame will be seen by userspace (A
      allocating before B means that A is located in earlier ring slot,
      but this also means that B might get a lower sequence number then A
      since seqno is decided later.  To fix this we would need to extend the
      spinlocked region to also cover the allocation and message setup which
      isn't desirable.
    - nfqueue can now be configured to queue large (GSO) skbs to userspace.
      Queing GSO packets is faster than having to force a software segmentation
      in the kernel, so this is a desirable option.  However, with a mmap based
      ring one has to use 64kb per ring slot element, else mmap has to fall back
      to the socket path (NL_MMAP_STATUS_COPY) for all large packets.
    
    To use the mmap interface, userspace not only has to probe for mmap netlink
    support, it also has to implement a recv/socket receive path in order to
    handle messages that exceed the size of an rx ring element.
    
    Cc: Daniel Borkmann <[email protected]>
    Cc: Ken-ichirou MATSUZAWA <[email protected]>
    Cc: Pablo Neira Ayuso <[email protected]>
    Cc: Patrick McHardy <[email protected]>
    Cc: Thomas Graf <[email protected]>
    Signed-off-by: Florian Westphal <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Cc: Shi Yuejie <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Florian Westphal authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    0c0be31 View commit details
    Browse the repository at this point in the history
  2. vxlan: correctly validate VXLAN ID against VXLAN_N_VID

    [ Upstream commit 4e37d69 ]
    
    The incorrect check caused an off-by-one error: the maximum VID 0xffffff
    was unusable.
    
    Fixes: d342894 ("vxlan: virtual extensible lan")
    Signed-off-by: Matthias Schiffer <[email protected]>
    Acked-by: Jiri Benc <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    neocturne authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    51a219a View commit details
    Browse the repository at this point in the history
  3. vti6: return GRE_KEY for vti6

    [ Upstream commit 7dcdf94 ]
    
    Align vti6 with vti by returning GRE_KEY flag. This enables iproute2
    to display tunnel keys on "ip -6 tunnel show"
    
    Signed-off-by: David Forster <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    David Forster authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    f1b3aae View commit details
    Browse the repository at this point in the history
  4. ipv4: mask tos for input route

    [ Upstream commit 6e28099 ]
    
    Restore the lost masking of TOS in input route code to
    allow ip rules to match it properly.
    
    Problem [1] noticed by Shmulik Ladkani <[email protected]>
    
    [1] http://marc.info/?t=137331755300040&r=1&w=2
    
    Fixes: 89aef89 ("ipv4: Delete routing cache.")
    Signed-off-by: Julian Anastasov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Julian Anastasov authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    354f791 View commit details
    Browse the repository at this point in the history
  5. l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv

    [ Upstream commit 51fb60e ]
    
    l2tp_ip_backlog_recv may not return -1 if the packet gets dropped.
    The return value is passed up to ip_local_deliver_finish, which treats
    negative values as an IP protocol number for resubmission.
    
    Signed-off-by: Paul Hüber <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    p-hueber authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    2cd0afc View commit details
    Browse the repository at this point in the history
  6. net: don't call strlen() on the user buffer in packet_bind_spkt()

    [ Upstream commit 540e289 ]
    
    KMSAN (KernelMemorySanitizer, a new error detection tool) reports use of
    uninitialized memory in packet_bind_spkt():
    Acked-by: Eric Dumazet <[email protected]>
    
    ==================================================================
    BUG: KMSAN: use of unitialized memory
    CPU: 0 PID: 1074 Comm: packet Not tainted 4.8.0-rc6+ #1891
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs
    01/01/2011
     0000000000000000 ffff88006b6dfc08 ffffffff82559ae8 ffff88006b6dfb48
     ffffffff818a7c91 ffffffff85b9c870 0000000000000092 ffffffff85b9c550
     0000000000000000 0000000000000092 00000000ec400911 0000000000000002
    Call Trace:
     [<     inline     >] __dump_stack lib/dump_stack.c:15
     [<ffffffff82559ae8>] dump_stack+0x238/0x290 lib/dump_stack.c:51
     [<ffffffff818a6626>] kmsan_report+0x276/0x2e0 mm/kmsan/kmsan.c:1003
     [<ffffffff818a783b>] __msan_warning+0x5b/0xb0
    mm/kmsan/kmsan_instr.c:424
     [<     inline     >] strlen lib/string.c:484
     [<ffffffff8259b58d>] strlcpy+0x9d/0x200 lib/string.c:144
     [<ffffffff84b2eca4>] packet_bind_spkt+0x144/0x230
    net/packet/af_packet.c:3132
     [<ffffffff84242e4d>] SYSC_bind+0x40d/0x5f0 net/socket.c:1370
     [<ffffffff84242a22>] SyS_bind+0x82/0xa0 net/socket.c:1356
     [<ffffffff8515991b>] entry_SYSCALL_64_fastpath+0x13/0x8f
    arch/x86/entry/entry_64.o:?
    chained origin: 00000000eba00911
     [<ffffffff810bb787>] save_stack_trace+0x27/0x50
    arch/x86/kernel/stacktrace.c:67
     [<     inline     >] kmsan_save_stack_with_flags mm/kmsan/kmsan.c:322
     [<     inline     >] kmsan_save_stack mm/kmsan/kmsan.c:334
     [<ffffffff818a59f8>] kmsan_internal_chain_origin+0x118/0x1e0
    mm/kmsan/kmsan.c:527
     [<ffffffff818a7773>] __msan_set_alloca_origin4+0xc3/0x130
    mm/kmsan/kmsan_instr.c:380
     [<ffffffff84242b69>] SYSC_bind+0x129/0x5f0 net/socket.c:1356
     [<ffffffff84242a22>] SyS_bind+0x82/0xa0 net/socket.c:1356
     [<ffffffff8515991b>] entry_SYSCALL_64_fastpath+0x13/0x8f
    arch/x86/entry/entry_64.o:?
    origin description: ----address@SYSC_bind (origin=00000000eb400911)
    ==================================================================
    (the line numbers are relative to 4.8-rc6, but the bug persists
    upstream)
    
    , when I run the following program as root:
    
    =====================================
     #include <string.h>
     #include <sys/socket.h>
     #include <netpacket/packet.h>
     #include <net/ethernet.h>
    
     int main() {
       struct sockaddr addr;
       memset(&addr, 0xff, sizeof(addr));
       addr.sa_family = AF_PACKET;
       int fd = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ALL));
       bind(fd, &addr, sizeof(addr));
       return 0;
     }
    =====================================
    
    This happens because addr.sa_data copied from the userspace is not
    zero-terminated, and copying it with strlcpy() in packet_bind_spkt()
    results in calling strlen() on the kernel copy of that non-terminated
    buffer.
    
    Signed-off-by: Alexander Potapenko <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ramosian-glider authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    f331d64 View commit details
    Browse the repository at this point in the history
  7. net: net_enable_timestamp() can be called from irq contexts

    [ Upstream commit 13baa00 ]
    
    It is now very clear that silly TCP listeners might play with
    enabling/disabling timestamping while new children are added
    to their accept queue.
    
    Meaning net_enable_timestamp() can be called from BH context
    while current state of the static key is not enabled.
    
    Lets play safe and allow all contexts.
    
    The work queue is scheduled only under the problematic cases,
    which are the static key enable/disable transition, to not slow down
    critical paths.
    
    This extends and improves what we did in commit 5fa8bbd ("net: use
    a work queue to defer net_disable_timestamp() work")
    
    Fixes: b90e579 ("net: dont call jump_label_dec from irq context")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    a70c328 View commit details
    Browse the repository at this point in the history
  8. dccp: Unlock sock before calling sk_free()

    [ Upstream commit d5afb6f ]
    
    The code where sk_clone() came from created a new socket and locked it,
    but then, on the error path didn't unlock it.
    
    This problem stayed there for a long while, till b0691c8 ("net:
    Unlock sock before calling sk_free()") fixed it, but unfortunately the
    callers of sk_clone() (now sk_clone_locked()) were not audited and the
    one in dccp_create_openreq_child() remained.
    
    Now in the age of the syskaller fuzzer, this was finally uncovered, as
    reported by Dmitry:
    
     ---- 8< ----
    
    I've got the following report while running syzkaller fuzzer on
    86292b3 ("Merge branch 'akpm' (patches from Andrew)")
    
      [ BUG: held lock freed! ]
      4.10.0+ Freescale#234 Not tainted
      -------------------------
      syz-executor6/6898 is freeing memory
      ffff88006286cac0-ffff88006286d3b7, with a lock still held there!
       (slock-AF_INET6){+.-...}, at: [<ffffffff8362c2c9>] spin_lock
      include/linux/spinlock.h:299 [inline]
       (slock-AF_INET6){+.-...}, at: [<ffffffff8362c2c9>]
      sk_clone_lock+0x3d9/0x12c0 net/core/sock.c:1504
      5 locks held by syz-executor6/6898:
       #0:  (sk_lock-AF_INET6){+.+.+.}, at: [<ffffffff839a34b4>] lock_sock
      include/net/sock.h:1460 [inline]
       #0:  (sk_lock-AF_INET6){+.+.+.}, at: [<ffffffff839a34b4>]
      inet_stream_connect+0x44/0xa0 net/ipv4/af_inet.c:681
       Freescale#1:  (rcu_read_lock){......}, at: [<ffffffff83bc1c2a>]
      inet6_csk_xmit+0x12a/0x5d0 net/ipv6/inet6_connection_sock.c:126
       Freescale#2:  (rcu_read_lock){......}, at: [<ffffffff8369b424>] __skb_unlink
      include/linux/skbuff.h:1767 [inline]
       Freescale#2:  (rcu_read_lock){......}, at: [<ffffffff8369b424>] __skb_dequeue
      include/linux/skbuff.h:1783 [inline]
       Freescale#2:  (rcu_read_lock){......}, at: [<ffffffff8369b424>]
      process_backlog+0x264/0x730 net/core/dev.c:4835
       Freescale#3:  (rcu_read_lock){......}, at: [<ffffffff83aeb5c0>]
      ip6_input_finish+0x0/0x1700 net/ipv6/ip6_input.c:59
       Freescale#4:  (slock-AF_INET6){+.-...}, at: [<ffffffff8362c2c9>] spin_lock
      include/linux/spinlock.h:299 [inline]
       Freescale#4:  (slock-AF_INET6){+.-...}, at: [<ffffffff8362c2c9>]
      sk_clone_lock+0x3d9/0x12c0 net/core/sock.c:1504
    
    Fix it just like was done by b0691c8 ("net: Unlock sock before calling
    sk_free()").
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Cc: Cong Wang <[email protected]>
    Cc: Eric Dumazet <[email protected]>
    Cc: Gerrit Renker <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    acmel authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    9216632 View commit details
    Browse the repository at this point in the history
  9. tcp: fix various issues for sockets morphing to listen state

    [ Upstream commit 02b2faa ]
    
    Dmitry Vyukov reported a divide by 0 triggered by syzkaller, exploiting
    tcp_disconnect() path that was never really considered and/or used
    before syzkaller ;)
    
    I was not able to reproduce the bug, but it seems issues here are the
    three possible actions that assumed they would never trigger on a
    listener.
    
    1) tcp_write_timer_handler
    2) tcp_delack_timer_handler
    3) MTU reduction
    
    Only IPv6 MTU reduction was properly testing TCP_CLOSE and TCP_LISTEN
     states from tcp_v6_mtu_reduced()
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    2681a78 View commit details
    Browse the repository at this point in the history
  10. net: fix socket refcounting in skb_complete_wifi_ack()

    [ Upstream commit dd4f107 ]
    
    TX skbs do not necessarily hold a reference on skb->sk->sk_refcnt
    By the time TX completion happens, sk_refcnt might be already 0.
    
    sock_hold()/sock_put() would then corrupt critical state, like
    sk_wmem_alloc.
    
    Fixes: bf7fa55 ("mac80211: Resolve sk_refcnt/sk_wmem_alloc issue in wifi ack path")
    Signed-off-by: Eric Dumazet <[email protected]>
    Cc: Alexander Duyck <[email protected]>
    Cc: Johannes Berg <[email protected]>
    Cc: Soheil Hassas Yeganeh <[email protected]>
    Cc: Willem de Bruijn <[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 Mar 22, 2017
    Configuration menu
    Copy the full SHA
    9e76833 View commit details
    Browse the repository at this point in the history
  11. net: fix socket refcounting in skb_complete_tx_timestamp()

    [ Upstream commit 9ac25fc ]
    
    TX skbs do not necessarily hold a reference on skb->sk->sk_refcnt
    By the time TX completion happens, sk_refcnt might be already 0.
    
    sock_hold()/sock_put() would then corrupt critical state, like
    sk_wmem_alloc and lead to leaks or use after free.
    
    Fixes: 62bccb8 ("net-timestamp: Make the clone operation stand-alone from phy timestamping")
    Signed-off-by: Eric Dumazet <[email protected]>
    Cc: Alexander Duyck <[email protected]>
    Cc: Johannes Berg <[email protected]>
    Cc: Soheil Hassas Yeganeh <[email protected]>
    Cc: Willem de Bruijn <[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 Mar 22, 2017
    Configuration menu
    Copy the full SHA
    ec4d869 View commit details
    Browse the repository at this point in the history
  12. dccp: fix use-after-free in dccp_feat_activate_values

    [ Upstream commit 62f8f4d ]
    
    Dmitry reported crashes in DCCP stack [1]
    
    Problem here is that when I got rid of listener spinlock, I missed the
    fact that DCCP stores a complex state in struct dccp_request_sock,
    while TCP does not.
    
    Since multiple cpus could access it at the same time, we need to add
    protection.
    
    [1]
    BUG: KASAN: use-after-free in dccp_feat_activate_values+0x967/0xab0
    net/dccp/feat.c:1541 at addr ffff88003713be68
    Read of size 8 by task syz-executor2/8457
    CPU: 2 PID: 8457 Comm: syz-executor2 Not tainted 4.10.0-rc7+ Freescale#127
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
    Call Trace:
     <IRQ>
     __dump_stack lib/dump_stack.c:15 [inline]
     dump_stack+0x292/0x398 lib/dump_stack.c:51
     kasan_object_err+0x1c/0x70 mm/kasan/report.c:162
     print_address_description mm/kasan/report.c:200 [inline]
     kasan_report_error mm/kasan/report.c:289 [inline]
     kasan_report.part.1+0x20e/0x4e0 mm/kasan/report.c:311
     kasan_report mm/kasan/report.c:332 [inline]
     __asan_report_load8_noabort+0x29/0x30 mm/kasan/report.c:332
     dccp_feat_activate_values+0x967/0xab0 net/dccp/feat.c:1541
     dccp_create_openreq_child+0x464/0x610 net/dccp/minisocks.c:121
     dccp_v6_request_recv_sock+0x1f6/0x1960 net/dccp/ipv6.c:457
     dccp_check_req+0x335/0x5a0 net/dccp/minisocks.c:186
     dccp_v6_rcv+0x69e/0x1d00 net/dccp/ipv6.c:711
     ip6_input_finish+0x46d/0x17a0 net/ipv6/ip6_input.c:279
     NF_HOOK include/linux/netfilter.h:257 [inline]
     ip6_input+0xdb/0x590 net/ipv6/ip6_input.c:322
     dst_input include/net/dst.h:507 [inline]
     ip6_rcv_finish+0x289/0x890 net/ipv6/ip6_input.c:69
     NF_HOOK include/linux/netfilter.h:257 [inline]
     ipv6_rcv+0x12ec/0x23d0 net/ipv6/ip6_input.c:203
     __netif_receive_skb_core+0x1ae5/0x3400 net/core/dev.c:4190
     __netif_receive_skb+0x2a/0x170 net/core/dev.c:4228
     process_backlog+0xe5/0x6c0 net/core/dev.c:4839
     napi_poll net/core/dev.c:5202 [inline]
     net_rx_action+0xe70/0x1900 net/core/dev.c:5267
     __do_softirq+0x2fb/0xb7d kernel/softirq.c:284
     do_softirq_own_stack+0x1c/0x30 arch/x86/entry/entry_64.S:902
     </IRQ>
     do_softirq.part.17+0x1e8/0x230 kernel/softirq.c:328
     do_softirq kernel/softirq.c:176 [inline]
     __local_bh_enable_ip+0x1f2/0x200 kernel/softirq.c:181
     local_bh_enable include/linux/bottom_half.h:31 [inline]
     rcu_read_unlock_bh include/linux/rcupdate.h:971 [inline]
     ip6_finish_output2+0xbb0/0x23d0 net/ipv6/ip6_output.c:123
     ip6_finish_output+0x302/0x960 net/ipv6/ip6_output.c:148
     NF_HOOK_COND include/linux/netfilter.h:246 [inline]
     ip6_output+0x1cb/0x8d0 net/ipv6/ip6_output.c:162
     ip6_xmit+0xcdf/0x20d0 include/net/dst.h:501
     inet6_csk_xmit+0x320/0x5f0 net/ipv6/inet6_connection_sock.c:179
     dccp_transmit_skb+0xb09/0x1120 net/dccp/output.c:141
     dccp_xmit_packet+0x215/0x760 net/dccp/output.c:280
     dccp_write_xmit+0x168/0x1d0 net/dccp/output.c:362
     dccp_sendmsg+0x79c/0xb10 net/dccp/proto.c:796
     inet_sendmsg+0x164/0x5b0 net/ipv4/af_inet.c:744
     sock_sendmsg_nosec net/socket.c:635 [inline]
     sock_sendmsg+0xca/0x110 net/socket.c:645
     SYSC_sendto+0x660/0x810 net/socket.c:1687
     SyS_sendto+0x40/0x50 net/socket.c:1655
     entry_SYSCALL_64_fastpath+0x1f/0xc2
    RIP: 0033:0x4458b9
    RSP: 002b:00007f8ceb77bb58 EFLAGS: 00000282 ORIG_RAX: 000000000000002c
    RAX: ffffffffffffffda RBX: 0000000000000017 RCX: 00000000004458b9
    RDX: 0000000000000023 RSI: 0000000020e60000 RDI: 0000000000000017
    RBP: 00000000006e1b90 R08: 00000000200f9fe1 R09: 0000000000000020
    R10: 0000000000008010 R11: 0000000000000282 R12: 00000000007080a8
    R13: 0000000000000000 R14: 00007f8ceb77c9c0 R15: 00007f8ceb77c700
    Object at ffff88003713be50, in cache kmalloc-64 size: 64
    Allocated:
    PID = 8446
     save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
     save_stack+0x43/0xd0 mm/kasan/kasan.c:502
     set_track mm/kasan/kasan.c:514 [inline]
     kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:605
     kmem_cache_alloc_trace+0x82/0x270 mm/slub.c:2738
     kmalloc include/linux/slab.h:490 [inline]
     dccp_feat_entry_new+0x214/0x410 net/dccp/feat.c:467
     dccp_feat_push_change+0x38/0x220 net/dccp/feat.c:487
     __feat_register_sp+0x223/0x2f0 net/dccp/feat.c:741
     dccp_feat_propagate_ccid+0x22b/0x2b0 net/dccp/feat.c:949
     dccp_feat_server_ccid_dependencies+0x1b3/0x250 net/dccp/feat.c:1012
     dccp_make_response+0x1f1/0xc90 net/dccp/output.c:423
     dccp_v6_send_response+0x4ec/0xc20 net/dccp/ipv6.c:217
     dccp_v6_conn_request+0xaba/0x11b0 net/dccp/ipv6.c:377
     dccp_rcv_state_process+0x51e/0x1650 net/dccp/input.c:606
     dccp_v6_do_rcv+0x213/0x350 net/dccp/ipv6.c:632
     sk_backlog_rcv include/net/sock.h:893 [inline]
     __sk_receive_skb+0x36f/0xcc0 net/core/sock.c:479
     dccp_v6_rcv+0xba5/0x1d00 net/dccp/ipv6.c:742
     ip6_input_finish+0x46d/0x17a0 net/ipv6/ip6_input.c:279
     NF_HOOK include/linux/netfilter.h:257 [inline]
     ip6_input+0xdb/0x590 net/ipv6/ip6_input.c:322
     dst_input include/net/dst.h:507 [inline]
     ip6_rcv_finish+0x289/0x890 net/ipv6/ip6_input.c:69
     NF_HOOK include/linux/netfilter.h:257 [inline]
     ipv6_rcv+0x12ec/0x23d0 net/ipv6/ip6_input.c:203
     __netif_receive_skb_core+0x1ae5/0x3400 net/core/dev.c:4190
     __netif_receive_skb+0x2a/0x170 net/core/dev.c:4228
     process_backlog+0xe5/0x6c0 net/core/dev.c:4839
     napi_poll net/core/dev.c:5202 [inline]
     net_rx_action+0xe70/0x1900 net/core/dev.c:5267
     __do_softirq+0x2fb/0xb7d kernel/softirq.c:284
    Freed:
    PID = 15
     save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
     save_stack+0x43/0xd0 mm/kasan/kasan.c:502
     set_track mm/kasan/kasan.c:514 [inline]
     kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:578
     slab_free_hook mm/slub.c:1355 [inline]
     slab_free_freelist_hook mm/slub.c:1377 [inline]
     slab_free mm/slub.c:2954 [inline]
     kfree+0xe8/0x2b0 mm/slub.c:3874
     dccp_feat_entry_destructor.part.4+0x48/0x60 net/dccp/feat.c:418
     dccp_feat_entry_destructor net/dccp/feat.c:416 [inline]
     dccp_feat_list_pop net/dccp/feat.c:541 [inline]
     dccp_feat_activate_values+0x57f/0xab0 net/dccp/feat.c:1543
     dccp_create_openreq_child+0x464/0x610 net/dccp/minisocks.c:121
     dccp_v6_request_recv_sock+0x1f6/0x1960 net/dccp/ipv6.c:457
     dccp_check_req+0x335/0x5a0 net/dccp/minisocks.c:186
     dccp_v6_rcv+0x69e/0x1d00 net/dccp/ipv6.c:711
     ip6_input_finish+0x46d/0x17a0 net/ipv6/ip6_input.c:279
     NF_HOOK include/linux/netfilter.h:257 [inline]
     ip6_input+0xdb/0x590 net/ipv6/ip6_input.c:322
     dst_input include/net/dst.h:507 [inline]
     ip6_rcv_finish+0x289/0x890 net/ipv6/ip6_input.c:69
     NF_HOOK include/linux/netfilter.h:257 [inline]
     ipv6_rcv+0x12ec/0x23d0 net/ipv6/ip6_input.c:203
     __netif_receive_skb_core+0x1ae5/0x3400 net/core/dev.c:4190
     __netif_receive_skb+0x2a/0x170 net/core/dev.c:4228
     process_backlog+0xe5/0x6c0 net/core/dev.c:4839
     napi_poll net/core/dev.c:5202 [inline]
     net_rx_action+0xe70/0x1900 net/core/dev.c:5267
     __do_softirq+0x2fb/0xb7d kernel/softirq.c:284
    Memory state around the buggy address:
     ffff88003713bd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
     ffff88003713bd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    >ffff88003713be00: fc fc fc fc fc fc fc fc fc fc fb fb fb fb fb fb
                                                              ^
    
    Fixes: 079096f ("tcp/dccp: install syn_recv requests into ehash table")
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Tested-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    d0ebde9 View commit details
    Browse the repository at this point in the history
  13. vrf: Fix use-after-free in vrf_xmit

    [ Upstream commit f7887d4 ]
    
    KASAN detected a use-after-free:
    
    [  269.467067] BUG: KASAN: use-after-free in vrf_xmit+0x7f1/0x827 [vrf] at addr ffff8800350a21c0
    [  269.467067] Read of size 4 by task ssh/1879
    [  269.467067] CPU: 1 PID: 1879 Comm: ssh Not tainted 4.10.0+ Freescale#249
    [  269.467067] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
    [  269.467067] Call Trace:
    [  269.467067]  dump_stack+0x81/0xb6
    [  269.467067]  kasan_object_err+0x21/0x78
    [  269.467067]  kasan_report+0x2f7/0x450
    [  269.467067]  ? vrf_xmit+0x7f1/0x827 [vrf]
    [  269.467067]  ? ip_output+0xa4/0xdb
    [  269.467067]  __asan_load4+0x6b/0x6d
    [  269.467067]  vrf_xmit+0x7f1/0x827 [vrf]
    ...
    
    Which corresponds to the skb access after xmit handling. Fix by saving
    skb->len and using the saved value to update stats.
    
    Fixes: 193125d ("net: Introduce VRF device driver")
    Signed-off-by: David Ahern <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    David Ahern authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    e671f1c View commit details
    Browse the repository at this point in the history
  14. uapi: fix linux/packet_diag.h userspace compilation error

    [ Upstream commit 745cb7f ]
    
    Replace MAX_ADDR_LEN with its numeric value to fix the following
    linux/packet_diag.h userspace compilation error:
    
    /usr/include/linux/packet_diag.h:67:17: error: 'MAX_ADDR_LEN' undeclared here (not in a function)
      __u8 pdmc_addr[MAX_ADDR_LEN];
    
    This is not the first case in the UAPI where the numeric value
    of MAX_ADDR_LEN is used instead of symbolic one, uapi/linux/if_link.h
    already does the same:
    
    $ grep MAX_ADDR_LEN include/uapi/linux/if_link.h
    	__u8 mac[32]; /* MAX_ADDR_LEN */
    
    There are no UAPI headers besides these two that use MAX_ADDR_LEN.
    
    Signed-off-by: Dmitry V. Levin <[email protected]>
    Acked-by: Pavel Emelyanov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ldv-alt authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    6c72458 View commit details
    Browse the repository at this point in the history
  15. act_connmark: avoid crashing on malformed nlattrs with null parms

    [ Upstream commit 52491c7 ]
    
    tcf_connmark_init does not check in its configuration if TCA_CONNMARK_PARMS
    is set, resulting in a null pointer dereference when trying to access it.
    
    [501099.043007] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
    [501099.043039] IP: [<ffffffffc10c60fb>] tcf_connmark_init+0x8b/0x180 [act_connmark]
    ...
    [501099.044334] Call Trace:
    [501099.044345]  [<ffffffffa47270e8>] ? tcf_action_init_1+0x198/0x1b0
    [501099.044363]  [<ffffffffa47271b0>] ? tcf_action_init+0xb0/0x120
    [501099.044380]  [<ffffffffa47250a4>] ? tcf_exts_validate+0xc4/0x110
    [501099.044398]  [<ffffffffc0f5fa97>] ? u32_set_parms+0xa7/0x270 [cls_u32]
    [501099.044417]  [<ffffffffc0f60bf0>] ? u32_change+0x680/0x87b [cls_u32]
    [501099.044436]  [<ffffffffa4725d1d>] ? tc_ctl_tfilter+0x4dd/0x8a0
    [501099.044454]  [<ffffffffa44a23a1>] ? security_capable+0x41/0x60
    [501099.044471]  [<ffffffffa470ca01>] ? rtnetlink_rcv_msg+0xe1/0x220
    [501099.044490]  [<ffffffffa470c920>] ? rtnl_newlink+0x870/0x870
    [501099.044507]  [<ffffffffa472cc61>] ? netlink_rcv_skb+0xa1/0xc0
    [501099.044524]  [<ffffffffa47073f4>] ? rtnetlink_rcv+0x24/0x30
    [501099.044541]  [<ffffffffa472c634>] ? netlink_unicast+0x184/0x230
    [501099.044558]  [<ffffffffa472c9d8>] ? netlink_sendmsg+0x2f8/0x3b0
    [501099.044576]  [<ffffffffa46d8880>] ? sock_sendmsg+0x30/0x40
    [501099.044592]  [<ffffffffa46d8e03>] ? SYSC_sendto+0xd3/0x150
    [501099.044608]  [<ffffffffa425fda1>] ? __do_page_fault+0x2d1/0x510
    [501099.044626]  [<ffffffffa47fbd7b>] ? system_call_fast_compare_end+0xc/0x9b
    
    Fixes: 22a5dc0 ("net: sched: Introduce connmark action")
    Signed-off-by: Étienne Noss <[email protected]>
    Signed-off-by: Victorien Molle <[email protected]>
    Acked-by: Cong Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    etene authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    710fbeb View commit details
    Browse the repository at this point in the history
  16. mpls: Send route delete notifications when router module is unloaded

    [ Upstream commit e37791e ]
    
    When the mpls_router module is unloaded, mpls routes are deleted but
    notifications are not sent to userspace leaving userspace caches
    out of sync. Add the call to mpls_notify_route in mpls_net_exit as
    routes are freed.
    
    Fixes: 0189197 ("mpls: Basic routing support")
    Signed-off-by: David Ahern <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    David Ahern authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    b57955e View commit details
    Browse the repository at this point in the history
  17. ipv6: make ECMP route replacement less greedy

    [ Upstream commit 67e1940 ]
    
    Commit 2759647 ("ipv6: fix ECMP route replacement") introduced a
    loop that removes all siblings of an ECMP route that is being
    replaced. However, this loop doesn't stop when it has replaced
    siblings, and keeps removing other routes with a higher metric.
    We also end up triggering the WARN_ON after the loop, because after
    this nsiblings < 0.
    
    Instead, stop the loop when we have taken care of all routes with the
    same metric as the route being replaced.
    
      Reproducer:
      ===========
        #!/bin/sh
    
        ip netns add ns1
        ip netns add ns2
        ip -net ns1 link set lo up
    
        for x in 0 1 2 ; do
            ip link add veth$x netns ns2 type veth peer name eth$x netns ns1
            ip -net ns1 link set eth$x up
            ip -net ns2 link set veth$x up
        done
    
        ip -net ns1 -6 r a 2000::/64 nexthop via fe80::0 dev eth0 \
                nexthop via fe80::1 dev eth1 nexthop via fe80::2 dev eth2
        ip -net ns1 -6 r a 2000::/64 via fe80::42 dev eth0 metric 256
        ip -net ns1 -6 r a 2000::/64 via fe80::43 dev eth0 metric 2048
    
        echo "before replace, 3 routes"
        ip -net ns1 -6 r | grep -v '^fe80\|^ff00'
        echo
    
        ip -net ns1 -6 r c 2000::/64 nexthop via fe80::4 dev eth0 \
                nexthop via fe80::5 dev eth1 nexthop via fe80::6 dev eth2
    
        echo "after replace, only 2 routes, metric 2048 is gone"
        ip -net ns1 -6 r | grep -v '^fe80\|^ff00'
    
    Fixes: 2759647 ("ipv6: fix ECMP route replacement")
    Signed-off-by: Sabrina Dubroca <[email protected]>
    Acked-by: Nicolas Dichtel <[email protected]>
    Reviewed-by: Xin Long <[email protected]>
    Reviewed-by: Michal Kubecek <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    qsn authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    5f8bc38 View commit details
    Browse the repository at this point in the history
  18. ipv6: avoid write to a possibly cloned skb

    [ Upstream commit 79e4950 ]
    
    ip6_fragment, in case skb has a fraglist, checks if the
    skb is cloned.  If it is, it will move to the 'slow path' and allocates
    new skbs for each fragment.
    
    However, right before entering the slowpath loop, it updates the
    nexthdr value of the last ipv6 extension header to NEXTHDR_FRAGMENT,
    to account for the fragment header that will be inserted in the new
    ipv6-fragment skbs.
    
    In case original skb is cloned this munges nexthdr value of another
    skb.  Avoid this by doing the nexthdr update for each of the new fragment
    skbs separately.
    
    This was observed with tcpdump on a bridge device where netfilter ipv6
    reassembly is active:  tcpdump shows malformed fragment headers as
    the l4 header (icmpv6, tcp, etc). is decoded as a fragment header.
    
    Cc: Hannes Frederic Sowa <[email protected]>
    Reported-by: Andreas Karis <[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 Mar 22, 2017
    Configuration menu
    Copy the full SHA
    aed728c View commit details
    Browse the repository at this point in the history
  19. bridge: drop netfilter fake rtable unconditionally

    [ Upstream commit a13b208 ]
    
    Andreas reports kernel oops during rmmod of the br_netfilter module.
    Hannes debugged the oops down to a NULL rt6info->rt6i_indev.
    
    Problem is that br_netfilter has the nasty concept of adding a fake
    rtable to skb->dst; this happens in a br_netfilter prerouting hook.
    
    A second hook (in bridge LOCAL_IN) is supposed to remove these again
    before the skb is handed up the stack.
    
    However, on module unload hooks get unregistered which means an
    skb could traverse the prerouting hook that attaches the fake_rtable,
    while the 'fake rtable remove' hook gets removed from the hooklist
    immediately after.
    
    Fixes: 34666d4 ("netfilter: bridge: move br_netfilter out of the core")
    Reported-by: Andreas Karis <[email protected]>
    Debugged-by: Hannes Frederic Sowa <[email protected]>
    Signed-off-by: Florian Westphal <[email protected]>
    Acked-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Florian Westphal authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    56f9b95 View commit details
    Browse the repository at this point in the history
  20. dccp/tcp: fix routing redirect race

    [ Upstream commit 45caeaa ]
    
    As Eric Dumazet pointed out this also needs to be fixed in IPv6.
    v2: Contains the IPv6 tcp/Ipv6 dccp patches as well.
    
    We have seen a few incidents lately where a dst_enty has been freed
    with a dangling TCP socket reference (sk->sk_dst_cache) pointing to that
    dst_entry. If the conditions/timings are right a crash then ensues when the
    freed dst_entry is referenced later on. A Common crashing back trace is:
    
     Freescale#8 [] page_fault at ffffffff8163e648
        [exception RIP: __tcp_ack_snd_check+74]
    .
    .
     Freescale#9 [] tcp_rcv_established at ffffffff81580b64
    Freescale#10 [] tcp_v4_do_rcv at ffffffff8158b54a
    Freescale#11 [] tcp_v4_rcv at ffffffff8158cd02
    Freescale#12 [] ip_local_deliver_finish at ffffffff815668f4
    Freescale#13 [] ip_local_deliver at ffffffff81566bd9
    Freescale#14 [] ip_rcv_finish at ffffffff8156656d
    Freescale#15 [] ip_rcv at ffffffff81566f06
    Freescale#16 [] __netif_receive_skb_core at ffffffff8152b3a2
    Freescale#17 [] __netif_receive_skb at ffffffff8152b608
    Freescale#18 [] netif_receive_skb at ffffffff8152b690
    Freescale#19 [] vmxnet3_rq_rx_complete at ffffffffa015eeaf [vmxnet3]
    Freescale#20 [] vmxnet3_poll_rx_only at ffffffffa015f32a [vmxnet3]
    Freescale#21 [] net_rx_action at ffffffff8152bac2
    Freescale#22 [] __do_softirq at ffffffff81084b4f
    Freescale#23 [] call_softirq at ffffffff8164845c
    Freescale#24 [] do_softirq at ffffffff81016fc5
    Freescale#25 [] irq_exit at ffffffff81084ee5
    Freescale#26 [] do_IRQ at ffffffff81648ff8
    
    Of course it may happen with other NIC drivers as well.
    
    It's found the freed dst_entry here:
    
     224 static bool tcp_in_quickack_mode(struct sock *sk)↩
     225 {↩
     226 ▹       const struct inet_connection_sock *icsk = inet_csk(sk);↩
     227 ▹       const struct dst_entry *dst = __sk_dst_get(sk);↩
     228 ↩
     229 ▹       return (dst && dst_metric(dst, RTAX_QUICKACK)) ||↩
     230 ▹       ▹       (icsk->icsk_ack.quick && !icsk->icsk_ack.pingpong);↩
     231 }↩
    
    But there are other backtraces attributed to the same freed dst_entry in
    netfilter code as well.
    
    All the vmcores showed 2 significant clues:
    
    - Remote hosts behind the default gateway had always been redirected to a
    different gateway. A rtable/dst_entry will be added for that host. Making
    more dst_entrys with lower reference counts. Making this more probable.
    
    - All vmcores showed a postitive LockDroppedIcmps value, e.g:
    
    LockDroppedIcmps                  267
    
    A closer look at the tcp_v4_err() handler revealed that do_redirect() will run
    regardless of whether user space has the socket locked. This can result in a
    race condition where the same dst_entry cached in sk->sk_dst_entry can be
    decremented twice for the same socket via:
    
    do_redirect()->__sk_dst_check()-> dst_release().
    
    Which leads to the dst_entry being prematurely freed with another socket
    pointing to it via sk->sk_dst_cache and a subsequent crash.
    
    To fix this skip do_redirect() if usespace has the socket locked. Instead let
    the redirect take place later when user space does not have the socket
    locked.
    
    The dccp/IPv6 code is very similar in this respect, so fixing it there too.
    
    As Eric Garver pointed out the following commit now invalidates routes. Which
    can set the dst->obsolete flag so that ipv4_dst_check() returns null and
    triggers the dst_release().
    
    Fixes: ceb3320 ("ipv4: Kill routes during PMTU/redirect updates.")
    Cc: Eric Garver <[email protected]>
    Cc: Hannes Sowa <[email protected]>
    Signed-off-by: Jon Maxwell <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Jon Maxwell authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    4ab956b View commit details
    Browse the repository at this point in the history
  21. dccp: fix memory leak during tear-down of unsuccessful connection req…

    …uest
    
    [ Upstream commit 72ef9c4 ]
    
    This patch fixes a memory leak, which happens if the connection request
    is not fulfilled between parsing the DCCP options and handling the SYN
    (because e.g. the backlog is full), because we forgot to free the
    list of ack vectors.
    
    Reported-by: Jianwen Ji <[email protected]>
    Signed-off-by: Hannes Frederic Sowa <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    strssndktn authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    676fe97 View commit details
    Browse the repository at this point in the history
  22. net sched actions: decrement module reference count after table flush.

    [ Upstream commit edb9d1b ]
    
    When tc actions are loaded as a module and no actions have been installed,
    flushing them would result in actions removed from the memory, but modules
    reference count not being decremented, so that the modules would not be
    unloaded.
    
    Following is example with GACT action:
    
    % sudo modprobe act_gact
    % lsmod
    Module                  Size  Used by
    act_gact               16384  0
    %
    % sudo tc actions ls action gact
    %
    % sudo tc actions flush action gact
    % lsmod
    Module                  Size  Used by
    act_gact               16384  1
    % sudo tc actions flush action gact
    % lsmod
    Module                  Size  Used by
    act_gact               16384  2
    % sudo rmmod act_gact
    rmmod: ERROR: Module act_gact is in use
    ....
    
    After the fix:
    % lsmod
    Module                  Size  Used by
    act_gact               16384  0
    %
    % sudo tc actions add action pass index 1
    % sudo tc actions add action pass index 2
    % sudo tc actions add action pass index 3
    % lsmod
    Module                  Size  Used by
    act_gact               16384  3
    %
    % sudo tc actions flush action gact
    % lsmod
    Module                  Size  Used by
    act_gact               16384  0
    %
    % sudo tc actions flush action gact
    % lsmod
    Module                  Size  Used by
    act_gact               16384  0
    % sudo rmmod act_gact
    % lsmod
    Module                  Size  Used by
    %
    
    Fixes: f97017c ("net-sched: Fix actions flushing")
    Signed-off-by: Roman Mashak <[email protected]>
    Signed-off-by: Jamal Hadi Salim <[email protected]>
    Acked-by: Cong Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Roman Mashak authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    c10ffe9 View commit details
    Browse the repository at this point in the history
  23. fscrypt: fix renaming and linking special files

    commit 42d97eb upstream.
    
    Attempting to link a device node, named pipe, or socket file into an
    encrypted directory through rename(2) or link(2) always failed with
    EPERM.  This happened because fscrypt_has_permitted_context() saw that
    the file was unencrypted and forbid creating the link.  This behavior
    was unexpected because such files are never encrypted; only regular
    files, directories, and symlinks can be encrypted.
    
    To fix this, make fscrypt_has_permitted_context() always return true on
    special files.
    
    This will be covered by a test in my encryption xfstests patchset.
    
    Fixes: 9bd8212 ("ext4 crypto: add encryption policy and password salt support")
    Signed-off-by: Eric Biggers <[email protected]>
    Reviewed-by: Richard Weinberger <[email protected]>
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ebiggers authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    fd74e8d View commit details
    Browse the repository at this point in the history
  24. fscrypto: lock inode while setting encryption policy

    commit 8906a82 upstream.
    
    i_rwsem needs to be acquired while setting an encryption policy so that
    concurrent calls to FS_IOC_SET_ENCRYPTION_POLICY are correctly
    serialized (especially the ->get_context() + ->set_context() pair), and
    so that new files cannot be created in the directory during or after the
    ->empty_dir() check.
    
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Theodore Ts'o <[email protected]>
    Reviewed-by: Richard Weinberger <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ebiggers authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    3a19419 View commit details
    Browse the repository at this point in the history
  25. x86/kasan: Fix boot with KASAN=y and PROFILE_ANNOTATED_BRANCHES=y

    commit be3606f upstream.
    
    The kernel doesn't boot with both PROFILE_ANNOTATED_BRANCHES=y and KASAN=y
    options selected. With branch profiling enabled we end up calling
    ftrace_likely_update() before kasan_early_init(). ftrace_likely_update() is
    built with KASAN instrumentation, so calling it before kasan has been
    initialized leads to crash.
    
    Use DISABLE_BRANCH_PROFILING define to make sure that we don't call
    ftrace_likely_update() from early code before kasan_early_init().
    
    Fixes: ef7f0d6 ("x86_64: add KASan support")
    Reported-by: Fengguang Wu <[email protected]>
    Signed-off-by: Andrey Ryabinin <[email protected]>
    Cc: [email protected]
    Cc: Alexander Potapenko <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: [email protected]
    Cc: Dmitry Vyukov <[email protected]>
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Thomas Gleixner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    aryabinin authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    8e0ec20 View commit details
    Browse the repository at this point in the history
  26. x86/perf: Fix CR4.PCE propagation to use active_mm instead of mm

    commit 5dc855d upstream.
    
    If one thread mmaps a perf event while another thread in the same mm
    is in some context where active_mm != mm (which can happen in the
    scheduler, for example), refresh_pce() would write the wrong value
    to CR4.PCE.  This broke some PAPI tests.
    
    Reported-and-tested-by: Vince Weaver <[email protected]>
    Signed-off-by: Andy Lutomirski <[email protected]>
    Cc: Alexander Shishkin <[email protected]>
    Cc: Arnaldo Carvalho de Melo <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: H. Peter Anvin <[email protected]>
    Cc: Jiri Olsa <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Stephane Eranian <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Fixes: 7911d3f ("perf/x86: Only allow rdpmc if a perf_event is mapped")
    Link: http://lkml.kernel.org/r/0c5b38a76ea50e405f9abe07a13dfaef87c173a1.1489694270.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    62f5704 View commit details
    Browse the repository at this point in the history
  27. futex: Fix potential use-after-free in FUTEX_REQUEUE_PI

    commit c236c8e upstream.
    
    While working on the futex code, I stumbled over this potential
    use-after-free scenario. Dmitry triggered it later with syzkaller.
    
    pi_mutex is a pointer into pi_state, which we drop the reference on in
    unqueue_me_pi(). So any access to that pointer after that is bad.
    
    Since other sites already do rt_mutex_unlock() with hb->lock held, see
    for example futex_lock_pi(), simply move the unlock before
    unqueue_me_pi().
    
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Reviewed-by: Darren Hart <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Thomas Gleixner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Peter Zijlstra authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    44854c1 View commit details
    Browse the repository at this point in the history
  28. futex: Add missing error handling to FUTEX_REQUEUE_PI

    commit 9bbb25a upstream.
    
    Thomas spotted that fixup_pi_state_owner() can return errors and we
    fail to unlock the rt_mutex in that case.
    
    Reported-by: Thomas Gleixner <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Reviewed-by: Darren Hart <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Thomas Gleixner <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Peter Zijlstra authored and gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    99d403f View commit details
    Browse the repository at this point in the history
  29. Linux 4.4.56

    gregkh committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    0136bca View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2017

  1. Merge tag 'v4.4.56' into 4.4.x

    This is the 4.4.56 stable release
    redbrain17 committed Mar 28, 2017
    Configuration menu
    Copy the full SHA
    f5ecad2 View commit details
    Browse the repository at this point in the history