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.9 1.0.x imx stable merge #22

Merged
merged 731 commits into from
Jan 24, 2018
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Dec 25, 2017

  1. netfilter: nfnl_cthelper: fix runtime expectation policy updates

    [ Upstream commit 2c42225 ]
    
    We only allow runtime updates of expectation policies for timeout and
    maximum number of expectations, otherwise reject the update.
    
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Acked-by: Liping Zhang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ummakynes authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    ec38fb4 View commit details
    Browse the repository at this point in the history
  2. netfilter: nfnl_cthelper: Fix memory leak

    [ Upstream commit f83bf8d ]
    
    We have memory leaks of nf_conntrack_helper & expect_policy.
    
    Signed-off-by: Jeffy Chen <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    JeffyCN authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    0f0ac21 View commit details
    Browse the repository at this point in the history
  3. iommu/exynos: Workaround FLPD cache flush issues for SYSMMU v5

    [ Upstream commit cd37a29 ]
    
    For some unknown reasons, in some cases, FLPD cache invalidation doesn't
    work properly with SYSMMU v5 controllers found in Exynos5433 SoCs. This
    can be observed by a firmware crash during initialization phase of MFC
    video decoder available in the mentioned SoCs when IOMMU support is
    enabled. To workaround this issue perform a full TLB/FLPD invalidation
    in case of replacing any first level page descriptors in case of SYSMMU v5.
    
    Fixes: 740a01e ("iommu/exynos: Add support for v5 SYSMMU")
    CC: [email protected] # v4.10+
    Signed-off-by: Marek Szyprowski <[email protected]>
    Tested-by: Andrzej Hajda <[email protected]>
    Signed-off-by: Joerg Roedel <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mszyprow authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    7171aa2 View commit details
    Browse the repository at this point in the history
  4. r8152: fix the rx early size of RTL8153

    [ Upstream commit b20cb60 ]
    
    revert commit a59e6d8 ("r8152: correct the rx early size") and
    fix the rx early size as
    
    	(rx buffer size - rx packet size - rx desc size - alignment) / 4
    
    Signed-off-by: Hayes Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hayesorz authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    bfb38fb View commit details
    Browse the repository at this point in the history
  5. tipc: fix nametbl deadlock at tipc_nametbl_unsubscribe

    [ Upstream commit 557d054 ]
    
    Until now, tipc_nametbl_unsubscribe() is called at subscriptions
    reference count cleanup. Usually the subscriptions cleanup is
    called at subscription timeout or at subscription cancel or at
    subscriber delete.
    
    We have ignored the possibility of this being called from other
    locations, which causes deadlock as we try to grab the
    tn->nametbl_lock while holding it already.
    
       CPU1:                             CPU2:
    ----------                     ----------------
    tipc_nametbl_publish
    spin_lock_bh(&tn->nametbl_lock)
    tipc_nametbl_insert_publ
    tipc_nameseq_insert_publ
    tipc_subscrp_report_overlap
    tipc_subscrp_get
    tipc_subscrp_send_event
                                 tipc_close_conn
                                 tipc_subscrb_release_cb
                                 tipc_subscrb_delete
                                 tipc_subscrp_put
    tipc_subscrp_put
    tipc_subscrp_kref_release
    tipc_nametbl_unsubscribe
    spin_lock_bh(&tn->nametbl_lock)
    <<grab nametbl_lock again>>
    
       CPU1:                              CPU2:
    ----------                     ----------------
    tipc_nametbl_stop
    spin_lock_bh(&tn->nametbl_lock)
    tipc_purge_publications
    tipc_nameseq_remove_publ
    tipc_subscrp_report_overlap
    tipc_subscrp_get
    tipc_subscrp_send_event
                                 tipc_close_conn
                                 tipc_subscrb_release_cb
                                 tipc_subscrb_delete
                                 tipc_subscrp_put
    tipc_subscrp_put
    tipc_subscrp_kref_release
    tipc_nametbl_unsubscribe
    spin_lock_bh(&tn->nametbl_lock)
    <<grab nametbl_lock again>>
    
    In this commit, we advance the calling of tipc_nametbl_unsubscribe()
    from the refcount cleanup to the intended callers.
    
    Fixes: d094c4d ("tipc: add subscription refcount to avoid invalid delete")
    Reported-by: John Thompson <[email protected]>
    Acked-by: Jon Maloy <[email protected]>
    Signed-off-by: Ying Xue <[email protected]>
    Signed-off-by: Parthasarathy Bhuvaragan <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ying-xue authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    e6e8067 View commit details
    Browse the repository at this point in the history
  6. inet: frag: release spinlock before calling icmp_send()

    [ Upstream commit ec4fbd6 ]
    
    Dmitry reported a lockdep splat [1] (false positive) that we can fix
    by releasing the spinlock before calling icmp_send() from ip_expire()
    
    This is a false positive because sending an ICMP message can not
    possibly re-enter the IP frag engine.
    
    [1]
    [ INFO: possible circular locking dependency detected ]
    4.10.0+ Freescale#29 Not tainted
    -------------------------------------------------------
    modprobe/12392 is trying to acquire lock:
     (_xmit_ETHER#2){+.-...}, at: [<ffffffff837a8182>] spin_lock
    include/linux/spinlock.h:299 [inline]
     (_xmit_ETHER#2){+.-...}, at: [<ffffffff837a8182>] __netif_tx_lock
    include/linux/netdevice.h:3486 [inline]
     (_xmit_ETHER#2){+.-...}, at: [<ffffffff837a8182>]
    sch_direct_xmit+0x282/0x6d0 net/sched/sch_generic.c:180
    
    but task is already holding lock:
     (&(&q->lock)->rlock){+.-...}, at: [<ffffffff8389a4d1>] spin_lock
    include/linux/spinlock.h:299 [inline]
     (&(&q->lock)->rlock){+.-...}, at: [<ffffffff8389a4d1>]
    ip_expire+0x51/0x6c0 net/ipv4/ip_fragment.c:201
    
    which lock already depends on the new lock.
    
    the existing dependency chain (in reverse order) is:
    
    -> Freescale#1 (&(&q->lock)->rlock){+.-...}:
           validate_chain kernel/locking/lockdep.c:2267 [inline]
           __lock_acquire+0x2149/0x3430 kernel/locking/lockdep.c:3340
           lock_acquire+0x2a1/0x630 kernel/locking/lockdep.c:3755
           __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
           _raw_spin_lock+0x33/0x50 kernel/locking/spinlock.c:151
           spin_lock include/linux/spinlock.h:299 [inline]
           ip_defrag+0x3a2/0x4130 net/ipv4/ip_fragment.c:669
           ip_check_defrag+0x4e3/0x8b0 net/ipv4/ip_fragment.c:713
           packet_rcv_fanout+0x282/0x800 net/packet/af_packet.c:1459
           deliver_skb net/core/dev.c:1834 [inline]
           dev_queue_xmit_nit+0x294/0xa90 net/core/dev.c:1890
           xmit_one net/core/dev.c:2903 [inline]
           dev_hard_start_xmit+0x16b/0xab0 net/core/dev.c:2923
           sch_direct_xmit+0x31f/0x6d0 net/sched/sch_generic.c:182
           __dev_xmit_skb net/core/dev.c:3092 [inline]
           __dev_queue_xmit+0x13e5/0x1e60 net/core/dev.c:3358
           dev_queue_xmit+0x17/0x20 net/core/dev.c:3423
           neigh_resolve_output+0x6b9/0xb10 net/core/neighbour.c:1308
           neigh_output include/net/neighbour.h:478 [inline]
           ip_finish_output2+0x8b8/0x15a0 net/ipv4/ip_output.c:228
           ip_do_fragment+0x1d93/0x2720 net/ipv4/ip_output.c:672
           ip_fragment.constprop.54+0x145/0x200 net/ipv4/ip_output.c:545
           ip_finish_output+0x82d/0xe10 net/ipv4/ip_output.c:314
           NF_HOOK_COND include/linux/netfilter.h:246 [inline]
           ip_output+0x1f0/0x7a0 net/ipv4/ip_output.c:404
           dst_output include/net/dst.h:486 [inline]
           ip_local_out+0x95/0x170 net/ipv4/ip_output.c:124
           ip_send_skb+0x3c/0xc0 net/ipv4/ip_output.c:1492
           ip_push_pending_frames+0x64/0x80 net/ipv4/ip_output.c:1512
           raw_sendmsg+0x26de/0x3a00 net/ipv4/raw.c:655
           inet_sendmsg+0x164/0x5b0 net/ipv4/af_inet.c:761
           sock_sendmsg_nosec net/socket.c:633 [inline]
           sock_sendmsg+0xca/0x110 net/socket.c:643
           ___sys_sendmsg+0x4a3/0x9f0 net/socket.c:1985
           __sys_sendmmsg+0x25c/0x750 net/socket.c:2075
           SYSC_sendmmsg net/socket.c:2106 [inline]
           SyS_sendmmsg+0x35/0x60 net/socket.c:2101
           do_syscall_64+0x2e8/0x930 arch/x86/entry/common.c:281
           return_from_SYSCALL_64+0x0/0x7a
    
    -> #0 (_xmit_ETHER#2){+.-...}:
           check_prev_add kernel/locking/lockdep.c:1830 [inline]
           check_prevs_add+0xa8f/0x19f0 kernel/locking/lockdep.c:1940
           validate_chain kernel/locking/lockdep.c:2267 [inline]
           __lock_acquire+0x2149/0x3430 kernel/locking/lockdep.c:3340
           lock_acquire+0x2a1/0x630 kernel/locking/lockdep.c:3755
           __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
           _raw_spin_lock+0x33/0x50 kernel/locking/spinlock.c:151
           spin_lock include/linux/spinlock.h:299 [inline]
           __netif_tx_lock include/linux/netdevice.h:3486 [inline]
           sch_direct_xmit+0x282/0x6d0 net/sched/sch_generic.c:180
           __dev_xmit_skb net/core/dev.c:3092 [inline]
           __dev_queue_xmit+0x13e5/0x1e60 net/core/dev.c:3358
           dev_queue_xmit+0x17/0x20 net/core/dev.c:3423
           neigh_hh_output include/net/neighbour.h:468 [inline]
           neigh_output include/net/neighbour.h:476 [inline]
           ip_finish_output2+0xf6c/0x15a0 net/ipv4/ip_output.c:228
           ip_finish_output+0xa29/0xe10 net/ipv4/ip_output.c:316
           NF_HOOK_COND include/linux/netfilter.h:246 [inline]
           ip_output+0x1f0/0x7a0 net/ipv4/ip_output.c:404
           dst_output include/net/dst.h:486 [inline]
           ip_local_out+0x95/0x170 net/ipv4/ip_output.c:124
           ip_send_skb+0x3c/0xc0 net/ipv4/ip_output.c:1492
           ip_push_pending_frames+0x64/0x80 net/ipv4/ip_output.c:1512
           icmp_push_reply+0x372/0x4d0 net/ipv4/icmp.c:394
           icmp_send+0x156c/0x1c80 net/ipv4/icmp.c:754
           ip_expire+0x40e/0x6c0 net/ipv4/ip_fragment.c:239
           call_timer_fn+0x241/0x820 kernel/time/timer.c:1268
           expire_timers kernel/time/timer.c:1307 [inline]
           __run_timers+0x960/0xcf0 kernel/time/timer.c:1601
           run_timer_softirq+0x21/0x80 kernel/time/timer.c:1614
           __do_softirq+0x31f/0xbe7 kernel/softirq.c:284
           invoke_softirq kernel/softirq.c:364 [inline]
           irq_exit+0x1cc/0x200 kernel/softirq.c:405
           exiting_irq arch/x86/include/asm/apic.h:657 [inline]
           smp_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:962
           apic_timer_interrupt+0x93/0xa0 arch/x86/entry/entry_64.S:707
           __read_once_size include/linux/compiler.h:254 [inline]
           atomic_read arch/x86/include/asm/atomic.h:26 [inline]
           rcu_dynticks_curr_cpu_in_eqs kernel/rcu/tree.c:350 [inline]
           __rcu_is_watching kernel/rcu/tree.c:1133 [inline]
           rcu_is_watching+0x83/0x110 kernel/rcu/tree.c:1147
           rcu_read_lock_held+0x87/0xc0 kernel/rcu/update.c:293
           radix_tree_deref_slot include/linux/radix-tree.h:238 [inline]
           filemap_map_pages+0x6d4/0x1570 mm/filemap.c:2335
           do_fault_around mm/memory.c:3231 [inline]
           do_read_fault mm/memory.c:3265 [inline]
           do_fault+0xbd5/0x2080 mm/memory.c:3370
           handle_pte_fault mm/memory.c:3600 [inline]
           __handle_mm_fault+0x1062/0x2cb0 mm/memory.c:3714
           handle_mm_fault+0x1e2/0x480 mm/memory.c:3751
           __do_page_fault+0x4f6/0xb60 arch/x86/mm/fault.c:1397
           do_page_fault+0x54/0x70 arch/x86/mm/fault.c:1460
           page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1011
    
    other info that might help us debug this:
    
     Possible unsafe locking scenario:
    
           CPU0                    CPU1
           ----                    ----
      lock(&(&q->lock)->rlock);
                                   lock(_xmit_ETHER#2);
                                   lock(&(&q->lock)->rlock);
      lock(_xmit_ETHER#2);
    
     *** DEADLOCK ***
    
    10 locks held by modprobe/12392:
     #0:  (&mm->mmap_sem){++++++}, at: [<ffffffff81329758>]
    __do_page_fault+0x2b8/0xb60 arch/x86/mm/fault.c:1336
     Freescale#1:  (rcu_read_lock){......}, at: [<ffffffff8188cab6>]
    filemap_map_pages+0x1e6/0x1570 mm/filemap.c:2324
     Freescale#2:  (&(ptlock_ptr(page))->rlock#2){+.+...}, at: [<ffffffff81984a78>]
    spin_lock include/linux/spinlock.h:299 [inline]
     Freescale#2:  (&(ptlock_ptr(page))->rlock#2){+.+...}, at: [<ffffffff81984a78>]
    pte_alloc_one_map mm/memory.c:2944 [inline]
     Freescale#2:  (&(ptlock_ptr(page))->rlock#2){+.+...}, at: [<ffffffff81984a78>]
    alloc_set_pte+0x13b8/0x1b90 mm/memory.c:3072
     Freescale#3:  (((&q->timer))){+.-...}, at: [<ffffffff81627e72>]
    lockdep_copy_map include/linux/lockdep.h:175 [inline]
     Freescale#3:  (((&q->timer))){+.-...}, at: [<ffffffff81627e72>]
    call_timer_fn+0x1c2/0x820 kernel/time/timer.c:1258
     Freescale#4:  (&(&q->lock)->rlock){+.-...}, at: [<ffffffff8389a4d1>] spin_lock
    include/linux/spinlock.h:299 [inline]
     Freescale#4:  (&(&q->lock)->rlock){+.-...}, at: [<ffffffff8389a4d1>]
    ip_expire+0x51/0x6c0 net/ipv4/ip_fragment.c:201
     Freescale#5:  (rcu_read_lock){......}, at: [<ffffffff8389a633>]
    ip_expire+0x1b3/0x6c0 net/ipv4/ip_fragment.c:216
     Freescale#6:  (slock-AF_INET){+.-...}, at: [<ffffffff839b3313>] spin_trylock
    include/linux/spinlock.h:309 [inline]
     Freescale#6:  (slock-AF_INET){+.-...}, at: [<ffffffff839b3313>] icmp_xmit_lock
    net/ipv4/icmp.c:219 [inline]
     Freescale#6:  (slock-AF_INET){+.-...}, at: [<ffffffff839b3313>]
    icmp_send+0x803/0x1c80 net/ipv4/icmp.c:681
     Freescale#7:  (rcu_read_lock_bh){......}, at: [<ffffffff838ab9a1>]
    ip_finish_output2+0x2c1/0x15a0 net/ipv4/ip_output.c:198
     Freescale#8:  (rcu_read_lock_bh){......}, at: [<ffffffff836d1dee>]
    __dev_queue_xmit+0x23e/0x1e60 net/core/dev.c:3324
     Freescale#9:  (dev->qdisc_running_key ?: &qdisc_running_key){+.....}, at:
    [<ffffffff836d3a27>] dev_queue_xmit+0x17/0x20 net/core/dev.c:3423
    
    stack backtrace:
    CPU: 0 PID: 12392 Comm: modprobe Not tainted 4.10.0+ Freescale#29
    Hardware name: Google Google Compute Engine/Google Compute Engine,
    BIOS Google 01/01/2011
    Call Trace:
     <IRQ>
     __dump_stack lib/dump_stack.c:16 [inline]
     dump_stack+0x2ee/0x3ef lib/dump_stack.c:52
     print_circular_bug+0x307/0x3b0 kernel/locking/lockdep.c:1204
     check_prev_add kernel/locking/lockdep.c:1830 [inline]
     check_prevs_add+0xa8f/0x19f0 kernel/locking/lockdep.c:1940
     validate_chain kernel/locking/lockdep.c:2267 [inline]
     __lock_acquire+0x2149/0x3430 kernel/locking/lockdep.c:3340
     lock_acquire+0x2a1/0x630 kernel/locking/lockdep.c:3755
     __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
     _raw_spin_lock+0x33/0x50 kernel/locking/spinlock.c:151
     spin_lock include/linux/spinlock.h:299 [inline]
     __netif_tx_lock include/linux/netdevice.h:3486 [inline]
     sch_direct_xmit+0x282/0x6d0 net/sched/sch_generic.c:180
     __dev_xmit_skb net/core/dev.c:3092 [inline]
     __dev_queue_xmit+0x13e5/0x1e60 net/core/dev.c:3358
     dev_queue_xmit+0x17/0x20 net/core/dev.c:3423
     neigh_hh_output include/net/neighbour.h:468 [inline]
     neigh_output include/net/neighbour.h:476 [inline]
     ip_finish_output2+0xf6c/0x15a0 net/ipv4/ip_output.c:228
     ip_finish_output+0xa29/0xe10 net/ipv4/ip_output.c:316
     NF_HOOK_COND include/linux/netfilter.h:246 [inline]
     ip_output+0x1f0/0x7a0 net/ipv4/ip_output.c:404
     dst_output include/net/dst.h:486 [inline]
     ip_local_out+0x95/0x170 net/ipv4/ip_output.c:124
     ip_send_skb+0x3c/0xc0 net/ipv4/ip_output.c:1492
     ip_push_pending_frames+0x64/0x80 net/ipv4/ip_output.c:1512
     icmp_push_reply+0x372/0x4d0 net/ipv4/icmp.c:394
     icmp_send+0x156c/0x1c80 net/ipv4/icmp.c:754
     ip_expire+0x40e/0x6c0 net/ipv4/ip_fragment.c:239
     call_timer_fn+0x241/0x820 kernel/time/timer.c:1268
     expire_timers kernel/time/timer.c:1307 [inline]
     __run_timers+0x960/0xcf0 kernel/time/timer.c:1601
     run_timer_softirq+0x21/0x80 kernel/time/timer.c:1614
     __do_softirq+0x31f/0xbe7 kernel/softirq.c:284
     invoke_softirq kernel/softirq.c:364 [inline]
     irq_exit+0x1cc/0x200 kernel/softirq.c:405
     exiting_irq arch/x86/include/asm/apic.h:657 [inline]
     smp_apic_timer_interrupt+0x76/0xa0 arch/x86/kernel/apic/apic.c:962
     apic_timer_interrupt+0x93/0xa0 arch/x86/entry/entry_64.S:707
    RIP: 0010:__read_once_size include/linux/compiler.h:254 [inline]
    RIP: 0010:atomic_read arch/x86/include/asm/atomic.h:26 [inline]
    RIP: 0010:rcu_dynticks_curr_cpu_in_eqs kernel/rcu/tree.c:350 [inline]
    RIP: 0010:__rcu_is_watching kernel/rcu/tree.c:1133 [inline]
    RIP: 0010:rcu_is_watching+0x83/0x110 kernel/rcu/tree.c:1147
    RSP: 0000:ffff8801c391f120 EFLAGS: 00000a03 ORIG_RAX: ffffffffffffff10
    RAX: dffffc0000000000 RBX: ffff8801c391f148 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: 000055edd4374000 RDI: ffff8801dbe1ae0c
    RBP: ffff8801c391f1a0 R08: 0000000000000002 R09: 0000000000000000
    R10: dffffc0000000000 R11: 0000000000000002 R12: 1ffff10038723e25
    R13: ffff8801dbe1ae00 R14: ffff8801c391f680 R15: dffffc0000000000
     </IRQ>
     rcu_read_lock_held+0x87/0xc0 kernel/rcu/update.c:293
     radix_tree_deref_slot include/linux/radix-tree.h:238 [inline]
     filemap_map_pages+0x6d4/0x1570 mm/filemap.c:2335
     do_fault_around mm/memory.c:3231 [inline]
     do_read_fault mm/memory.c:3265 [inline]
     do_fault+0xbd5/0x2080 mm/memory.c:3370
     handle_pte_fault mm/memory.c:3600 [inline]
     __handle_mm_fault+0x1062/0x2cb0 mm/memory.c:3714
     handle_mm_fault+0x1e2/0x480 mm/memory.c:3751
     __do_page_fault+0x4f6/0xb60 arch/x86/mm/fault.c:1397
     do_page_fault+0x54/0x70 arch/x86/mm/fault.c:1460
     page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1011
    RIP: 0033:0x7f83172f2786
    RSP: 002b:00007fffe859ae80 EFLAGS: 00010293
    RAX: 000055edd4373040 RBX: 00007f83175111c8 RCX: 000055edd4373238
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007f8317510970
    RBP: 00007fffe859afd0 R08: 0000000000000009 R09: 0000000000000000
    R10: 0000000000000064 R11: 0000000000000000 R12: 000055edd4373040
    R13: 0000000000000000 R14: 00007fffe859afe8 R15: 0000000000000000
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    7656871 View commit details
    Browse the repository at this point in the history
  7. pinctrl: st: add irq_request/release_resources callbacks

    [ Upstream commit e855fa9 ]
    
    When using GPIO as IRQ source, the GPIO must be configured
    in INPUT. Callbacks dedicated for this was missing in
    pinctrl-st driver.
    
    This fix the following kernel error when trying to lock a gpio
    as IRQ:
    
    [    7.521095] gpio gpiochip7: (PIO11): gpiochip_lock_as_irq: tried to flag a GPIO set as output for IRQ
    [    7.526018] gpio gpiochip7: (PIO11): unable to lock HW IRQ 6 for IRQ
    [    7.529405] genirq: Failed to request resources for 0-0053 (irq 81) on irqchip GPIO
    
    Signed-off-by: Patrice Chotard <[email protected]>
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    pchotard authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    0f4aa1f View commit details
    Browse the repository at this point in the history
  8. scsi: lpfc: Fix PT2PT PRLI reject

    [ Upstream commit a71e3cd ]
    
    lpfc cannot establish connection with targets that send PRLI in P2P
    configurations.
    
    If lpfc rejects a PRLI that is sent from a target the target will not
    resend and will reject the PRLI send from the initiator.
    
    [mkp: applied by hand]
    
    Signed-off-by: Dick Kennedy <[email protected]>
    Signed-off-by: James Smart <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Dick Kennedy authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    3bd2017 View commit details
    Browse the repository at this point in the history
  9. kvm: vmx: Flush TLB when the APIC-access address changes

    [ Upstream commit fb6c819 ]
    
    Quoting from the Intel SDM, volume 3, section 28.3.3.4: Guidelines for
    Use of the INVEPT Instruction:
    
    If EPT was in use on a logical processor at one time with EPTP X, it
    is recommended that software use the INVEPT instruction with the
    "single-context" INVEPT type and with EPTP X in the INVEPT descriptor
    before a VM entry on the same logical processor that enables EPT with
    EPTP X and either (a) the "virtualize APIC accesses" VM-execution
    control was changed from 0 to 1; or (b) the value of the APIC-access
    address was changed.
    
    In the nested case, the burden falls on L1, unless L0 enables EPT in
    vmcs02 when L1 doesn't enable EPT in vmcs12.
    
    Signed-off-by: Jim Mattson <[email protected]>
    Signed-off-by: Radim Krčmář <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jsmattsonjr authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    8386ff5 View commit details
    Browse the repository at this point in the history
  10. KVM: x86: correct async page present tracepoint

    [ Upstream commit 24dccf8 ]
    
    After async pf setup successfully, there is a broadcast wakeup w/ special
    token 0xffffffff which tells vCPU that it should wake up all processes
    waiting for APFs though there is no real process waiting at the moment.
    
    The async page present tracepoint print prematurely and fails to catch the
    special token setup. This patch fixes it by moving the async page present
    tracepoint after the special token setup.
    
    Before patch:
    
    qemu-system-x86-8499  [006] ...1  5973.473292: kvm_async_pf_ready: token 0x0 gva 0x0
    
    After patch:
    
    qemu-system-x86-8499  [006] ...1  5973.473292: kvm_async_pf_ready: token 0xffffffff gva 0x0
    
    Cc: Paolo Bonzini <[email protected]>
    Cc: Radim Krčmář <[email protected]>
    Signed-off-by: Wanpeng Li <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Wanpeng Li authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    e0249c0 View commit details
    Browse the repository at this point in the history
  11. KVM: VMX: Fix enable VPID conditions

    [ Upstream commit 08d839c ]
    
    This can be reproduced by running L2 on L1, and disable VPID on L0
    if w/o commit "KVM: nVMX: Fix nested VPID vmx exec control", the L2
    crash as below:
    
    KVM: entry failed, hardware error 0x7
    EAX=00000000 EBX=00000000 ECX=00000000 EDX=000306c3
    ESI=00000000 EDI=00000000 EBP=00000000 ESP=00000000
    EIP=0000fff0 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
    ES =0000 00000000 0000ffff 00009300
    CS =f000 ffff0000 0000ffff 00009b00
    SS =0000 00000000 0000ffff 00009300
    DS =0000 00000000 0000ffff 00009300
    FS =0000 00000000 0000ffff 00009300
    GS =0000 00000000 0000ffff 00009300
    LDT=0000 00000000 0000ffff 00008200
    TR =0000 00000000 0000ffff 00008b00
    GDT=     00000000 0000ffff
    IDT=     00000000 0000ffff
    CR0=60000010 CR2=00000000 CR3=00000000 CR4=00000000
    DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
    DR6=00000000ffff0ff0 DR7=0000000000000400
    EFER=0000000000000000
    
    Reference SDM 30.3 INVVPID:
    
    Protected Mode Exceptions
    - #UD
      - If not in VMX operation.
      - If the logical processor does not support VPIDs (IA32_VMX_PROCBASED_CTLS2[37]=0).
      - If the logical processor supports VPIDs (IA32_VMX_PROCBASED_CTLS2[37]=1) but does
        not support the INVVPID instruction (IA32_VMX_EPT_VPID_CAP[32]=0).
    
    So we should check both VPID enable bit in vmx exec control and INVVPID support bit
    in vmx capability MSRs to enable VPID. This patch adds the guarantee to not enable
    VPID if either INVVPID or single-context/all-context invalidation is not exposed in
    vmx capability MSRs.
    
    Reviewed-by: David Hildenbrand <[email protected]>
    Reviewed-by: Jim Mattson <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Cc: Radim Krčmář <[email protected]>
    Signed-off-by: Wanpeng Li <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Wanpeng Li authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    2df1969 View commit details
    Browse the repository at this point in the history
  12. ARM: dts: ti: fix PCI bus dtc warnings

    [ Upstream commit 7d79f60 ]
    
    dtc recently added PCI bus checks. Fix these warnings.
    
    Signed-off-by: Rob Herring <[email protected]>
    Cc: "Benoît Cousson" <[email protected]>
    Cc: Tony Lindgren <[email protected]>
    Cc: [email protected]
    Signed-off-by: Tony Lindgren <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    robherring authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    5700ffc View commit details
    Browse the repository at this point in the history
  13. hwmon: (asus_atk0110) fix uninitialized data access

    [ Upstream commit a2125d0 ]
    
    The latest gcc-7 snapshot adds a warning to point out that when
    atk_read_value_old or atk_read_value_new fails, we copy
    uninitialized data into sensor->cached_value:
    
    drivers/hwmon/asus_atk0110.c: In function 'atk_input_show':
    drivers/hwmon/asus_atk0110.c:651:26: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    
    Adding an error check avoids this. All versions of the driver
    are affected.
    
    Fixes: 2c03d07 ("hwmon: Add Asus ATK0110 support")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Reviewed-by: Luca Tettamanti <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    afa055f View commit details
    Browse the repository at this point in the history
  14. HID: xinmo: fix for out of range for THT 2P arcade controller.

    [ Upstream commit 9257821 ]
    
    There is a new clone of the XIN MO arcade controller which has same issue with
    out of range like the original.  This fix will solve the issue where 2
    directions on the joystick are not recognized by the new THT 2P arcade
    controller with device ID 0x75e1.  In details the new device ID is added the
    hid-id list and the hid-xinmo source code.
    
    Signed-off-by: Peter Stein <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    stuntstein authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    347848e View commit details
    Browse the repository at this point in the history
  15. ASoC: STI: Fix reader substream pointer set

    [ Upstream commit 3c9d3f1 ]
    
    reader->substream is used in IRQ handler for error case but is never set.
    Set value to pcm substream on DAI startup and clean it on dai shutdown.
    
    Signed-off-by: Arnaud Pouliquen <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arnopo authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    b89e229 View commit details
    Browse the repository at this point in the history
  16. r8152: prevent the driver from transmitting packets with carrier off

    [ Upstream commit 2f25abe ]
    
    The linking status may be changed when autosuspend. And, after
    autoresume, the driver may try to transmit packets when the device
    is carrier off, because the interrupt transfer doesn't update the
    linking status, yet. And, if the device is in ALDPS mode, the device
    would stop working.
    
    The another similar case is
     1. unplug the cable.
     2. interrupt transfer queue a work_queue for linking change.
     3. device enters the ALDPS mode.
     4. a tx occurs before the work_queue is called.
    
    Signed-off-by: Hayes Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hayesorz authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    60d5982 View commit details
    Browse the repository at this point in the history
  17. s390/qeth: size calculation outbound buffers

    [ Upstream commit 7d969d2 ]
    
    Depending on the device type, hard_start_xmit() builds different output
    buffer formats. For instance with HiperSockets, on both L2 and L3 we
    strip the ETH header from the skb - L3 doesn't need it, and L2 carries
    it in the buffer's header element.
    For this, we pass data_offset = ETH_HLEN all the way down to
    __qeth_fill_buffer(), where skb->data is then adjusted accordingly.
    But the initial size calculation still considers the *full* skb length
    (including the ETH header). So qeth_get_elements_no() can erroneously
    reject a skb as too big, even though it would actually fit into an
    output buffer once the ETH header has been trimmed off later.
    
    Fix this by passing an additional offset to qeth_get_elements_no(),
    that indicates where in the skb the on-wire data actually begins.
    Since the current code uses data_offset=-1 for some special handling
    on OSA, we need to clamp data_offset to 0...
    
    On HiperSockets this helps when sending ~MTU-size skbs with weird page
    alignment. No change for OSA or AF_IUCV.
    
    Signed-off-by: Julian Wiedmann <[email protected]>
    Signed-off-by: Ursula Braun <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    julianwiedmann authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    118b040 View commit details
    Browse the repository at this point in the history
  18. s390/qeth: no ETH header for outbound AF_IUCV

    [ Upstream commit acd9776 ]
    
    With AF_IUCV traffic, the skb passed to hard_start_xmit() has a 14 byte
    slot at skb->data, intended for an ETH header. qeth_l3_fill_af_iucv_hdr()
    fills this ETH header... and then immediately moves it to the
    skb's headroom, where it disappears and is never seen again.
    
    But it's still possible for us to return NETDEV_TX_BUSY after the skb has
    been modified. Since we didn't get a private copy of the skb, the next
    time the skb is delivered to hard_start_xmit() it no longer has the
    expected layout (we moved the ETH header to the headroom, so skb->data
    now starts at the IUCV_TRANS header). So when qeth_l3_fill_af_iucv_hdr()
    does another round of rebuilding, the resulting qeth header ends up
    all wrong. On transmission, the buffer is then rejected by
    the HiperSockets device with SBALF15 = x'04'.
    When this error is passed back to af_iucv as TX_NOTIFY_UNREACHABLE, it
    tears down the offending socket.
    
    As the ETH header for AF_IUCV serves no purpose, just align the code to
    what we do for IP traffic on L3 HiperSockets: keep the ETH header at
    skb->data, and pass down data_offset = ETH_HLEN to qeth_fill_buffer().
    When mapping the payload into the SBAL elements, the ETH header is then
    stripped off. This avoids the skb manipulations in
    qeth_l3_fill_af_iucv_hdr(), and any buffer re-entering hard_start_xmit()
    after NETDEV_TX_BUSY is now processed properly.
    
    Signed-off-by: Julian Wiedmann <[email protected]>
    Signed-off-by: Ursula Braun <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    julianwiedmann authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    51533c4 View commit details
    Browse the repository at this point in the history
  19. bna: avoid writing uninitialized data into hw registers

    [ Upstream commit a5af839 ]
    
    The latest gcc-7 snapshot warns about bfa_ioc_send_enable/bfa_ioc_send_disable
    writing undefined values into the hardware registers:
    
    drivers/net/ethernet/brocade/bna/bfa_ioc.c: In function 'bfa_iocpf_sm_disabling_entry':
    arch/arm/include/asm/io.h:109:22: error: '*((void *)&disable_req+4)' is used uninitialized in this function [-Werror=uninitialized]
    arch/arm/include/asm/io.h:109:22: error: '*((void *)&disable_req+8)' is used uninitialized in this function [-Werror=uninitialized]
    
    The two functions look like they should do the same thing, but only one
    of them initializes the time stamp and clscode field. The fact that we
    only get a warning for one of the two functions seems to be arbitrary,
    based on the inlining decisions in the compiler.
    
    To address this, I'm making both functions do the same thing:
    
    - set the clscode from the ioc structure in both
    - set the time stamp from ktime_get_real_seconds (which also
      avoids the signed-integer overflow in 2038 and extends the
      well-defined behavior until 2106).
    - zero-fill the reserved field
    
    Fixes: 8b230ed ("bna: Brocade 10Gb Ethernet device driver")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    102a8a1 View commit details
    Browse the repository at this point in the history
  20. i40iw: Receive netdev events post INET_NOTIFIER state

    [ Upstream commit 871a862 ]
    
    Netdev notification events are de-registered only when all
    client iwdev instances are removed. If a single client is closed
    and re-opened, netdev events could arrive even before the Control
    Queue-Pair (CQP) is created, causing a NULL pointer dereference crash
    in i40iw_get_cqp_request. Fix this by allowing netdev event
    notification only after we have reached the INET_NOTIFIER state with
    respect to device initialization.
    
    Reported-by: Stefan Assmann <[email protected]>
    Signed-off-by: Shiraz Saleem <[email protected]>
    Reviewed-by: Yuval Shaia <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    shirazsaleem authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    26452a5 View commit details
    Browse the repository at this point in the history
  21. IB/core: Protect against self-requeue of a cq work item

    [ Upstream commit 86f46ab ]
    
    We need to make sure that the cq work item does not
    run when we are destroying the cq. Unlike flush_work,
    cancel_work_sync protects against self-requeue of the
    work item (which we can do in ib_cq_poll_work).
    
    Signed-off-by: Sagi Grimberg <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Bart Van Assche <[email protected]>
    Reviewed-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sagigrimberg authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    cd083d5 View commit details
    Browse the repository at this point in the history
  22. infiniband: Fix alignment of mmap cookies to support VIPT caching

    [ Upstream commit cb88645 ]
    
    When vmalloc_user is used to create memory that is supposed to be mmap'd
    to user space, it is necessary for the mmap cookie (eg the offset) to be
    aligned to SHMLBA.
    
    This creates a situation where all virtual mappings of the same physical
    page share the same virtual cache index and guarantees VIPT coherence.
    Otherwise the cache is non-coherent and the kernel will not see writes
    by userspace when reading the shared page (or vice-versa).
    
    Reported-by: Josh Beavers <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jgunthorpe authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    f4fcc56 View commit details
    Browse the repository at this point in the history
  23. nbd: set queue timeout properly

    [ Upstream commit f858685 ]
    
    We can't just set the timeout on the tagset, we have to set it on the
    queue as it would have been setup already at this point.
    
    Signed-off-by: Josef Bacik <[email protected]>
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Josef Bacik authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    521a7e3 View commit details
    Browse the repository at this point in the history
  24. net: Do not allow negative values for busy_read and busy_poll sysctl …

    …interfaces
    
    [ Upstream commit 95f2552 ]
    
    This change basically codifies what I think was already the limitations on
    the busy_poll and busy_read sysctl interfaces.  We weren't checking the
    lower bounds and as such could input negative values. The behavior when
    that was used was dependent on the architecture. In order to prevent any
    issues with that I am just disabling support for values less than 0 since
    this way we don't have to worry about any odd behaviors.
    
    By limiting the sysctl values this way it also makes it consistent with how
    we handle the SO_BUSY_POLL socket option since the value appears to be
    reported as a signed integer value and negative values are rejected.
    
    Signed-off-by: Alexander Duyck <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Alexander Duyck authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    7f077af View commit details
    Browse the repository at this point in the history
  25. IB/rxe: double free on error

    [ Upstream commit ded2602 ]
    
    "goto err;" has it's own kfree_skb() call so it's a double free.  We
    only need to free on the "goto exit;" path.
    
    Fixes: 8700e3e ("Soft RoCE driver")
    Signed-off-by: Dan Carpenter <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Dan Carpenter authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    2f0e39f View commit details
    Browse the repository at this point in the history
  26. IB/rxe: increment msn only when completing a request

    [ Upstream commit 9fcd67d ]
    
    According to C9-147, MSN should only be incremented when the last packet of
    a multi packet request has been received.
    
    "Logically, the requester associates a sequential Send Sequence Number
    (SSN) with each WQE posted to the send queue. The SSN bears a one-
    to-one relationship to the MSN returned by the responder in each re-
    sponse packet. Therefore, when the requester receives a response, it in-
    terprets the MSN as representing the SSN of the most recent request
    completed by the responder to determine which send WQE(s) can be
    completed."
    
    Fixes: 8700e3e ("Soft RoCE driver")
    
    Signed-off-by: David Marchand <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    David Marchand authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    2eb783a View commit details
    Browse the repository at this point in the history
  27. i40e: Do not enable NAPI on q_vectors that have no rings

    [ Upstream commit 13a8cd1 ]
    
    When testing the epoll w/ busy poll code I found that I could get into a
    state where the i40e driver had q_vectors w/ active NAPI that had no rings.
    This was resulting in a divide by zero error.  To correct it I am updating
    the driver code so that we only support NAPI on q_vectors that have 1 or
    more rings allocated to them.
    
    Signed-off-by: Alexander Duyck <[email protected]>
    Tested-by: Andrew Bowers <[email protected]>
    Signed-off-by: Jeff Kirsher <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Alexander Duyck authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    661f534 View commit details
    Browse the repository at this point in the history
  28. RDMA/iser: Fix possible mr leak on device removal event

    [ Upstream commit ea174c9 ]
    
    When the rdma device is removed, we must cleanup all
    the rdma resources within the DEVICE_REMOVAL event
    handler to let the device teardown gracefully. When
    this happens with live I/O, some memory regions are
    occupied. Thus, track them too and dereg all the mr's.
    
    We are safe with mr access by iscsi_iser_cleanup_task.
    
    Reported-by: Raju Rangoju <[email protected]>
    Signed-off-by: Sagi Grimberg <[email protected]>
    Reviewed-by: Max Gurtovoy <[email protected]>
    Reviewed-by: Max Gurtovoy <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sagigrimberg authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    37f41da View commit details
    Browse the repository at this point in the history
  29. irda: vlsi_ir: fix check for DMA mapping errors

    [ Upstream commit 6ac3b77 ]
    
    vlsi_alloc_ring() checks for DMA mapping errors by comparing
    returned address with zero, while pci_dma_mapping_error() should be used.
    
    Found by Linux Driver Verification project (linuxtesting.org).
    
    Signed-off-by: Alexey Khoroshilov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    khoroshilov authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    9e63981 View commit details
    Browse the repository at this point in the history
  30. netfilter: nfnl_cthelper: fix a race when walk the nf_ct_helper_hash …

    …table
    
    [ Upstream commit 83d9021 ]
    
    The nf_ct_helper_hash table is protected by nf_ct_helper_mutex, while
    nfct_helper operation is protected by nfnl_lock(NFNL_SUBSYS_CTHELPER).
    So it's possible that one CPU is walking the nf_ct_helper_hash for
    cthelper add/get/del, another cpu is doing nf_conntrack_helpers_unregister
    at the same time. This is dangrous, and may cause use after free error.
    
    Note, delete operation will flush all cthelpers added via nfnetlink, so
    using rcu to do protect is not easy.
    
    Now introduce a dummy list to record all the cthelpers added via
    nfnetlink, then we can walk the dummy list instead of walking the
    nf_ct_helper_hash. Also, keep nfnl_cthelper_dump_table unchanged, it
    may be invoked without nfnl_lock(NFNL_SUBSYS_CTHELPER) held.
    
    Signed-off-by: Liping Zhang <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Liping Zhang authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    01060ac View commit details
    Browse the repository at this point in the history
  31. netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to regi…

    …ster
    
    [ Upstream commit 75c689d ]
    
    In the commit 93557f5 ("netfilter: nf_conntrack: nf_conntrack snmp
    helper"), the snmp_helper is replaced by nf_nat_snmp_hook. So the
    snmp_helper is never registered. But it still tries to unregister the
    snmp_helper, it could cause the panic.
    
    Now remove the useless snmp_helper and the unregister call in the
    error handler.
    
    Fixes: 93557f5 ("netfilter: nf_conntrack: nf_conntrack snmp helper")
    Signed-off-by: Gao Feng <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    gfreewind authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    b5ed572 View commit details
    Browse the repository at this point in the history
  32. ARM: dts: am335x-evmsk: adjust mmc2 param to allow suspend

    [ Upstream commit 9bcf53f ]
    
    mmc2 used for wl12xx was missing the keep-power-in suspend
    parameter. As a result the board couldn't reach suspend state.
    
    Signed-off-by: Eyal Reizer <[email protected]>
    Signed-off-by: Tony Lindgren <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    eyalreizer authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    e0d1315 View commit details
    Browse the repository at this point in the history
  33. cpufreq: Fix creation of symbolic links to policy directories

    [ Upstream commit 2f0ba79 ]
    
    The cpufreq core only tries to create symbolic links from CPU
    directories in sysfs to policy directories in cpufreq_add_dev(),
    either when a given CPU is registered or when the cpufreq driver
    is registered, whichever happens first.  That is not sufficient,
    however, because cpufreq_add_dev() may be called for an offline CPU
    whose policy object has not been created yet and, quite obviously,
    the symbolic cannot be added in that case.
    
    Fix that by making cpufreq_online() attempt to add symbolic links to
    policy objects for the CPUs in the related_cpus mask of every new
    policy object created by it.
    
    The cpufreq_driver_lock locking around the for_each_cpu() loop
    in cpufreq_online() is dropped, because it is not necessary and the
    code is somewhat simpler without it.  Moreover, failures to create
    a symbolic link will not be regarded as hard errors any more and
    the CPUs without those links will not be taken offline automatically,
    but that should not be problematic in practice.
    
    Reported-and-tested-by: Prashanth Prakash <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rafaeljw authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    e9a1ba2 View commit details
    Browse the repository at this point in the history
  34. net: ipconfig: fix ic_close_devs() use-after-free

    [ Upstream commit ffefb6f ]
    
    Our chosen ic_dev may be anywhere in our list of ic_devs, and we may
    free it before attempting to close others. When we compare d->dev and
    ic_dev->dev, we're potentially dereferencing memory returned to the
    allocator. This causes KASAN to scream for each subsequent ic_dev we
    check.
    
    As there's a 1-1 mapping between ic_devs and netdevs, we can instead
    compare d and ic_dev directly, which implicitly handles the !ic_dev
    case, and avoids the use-after-free. The ic_dev pointer may be stale,
    but we will not dereference it.
    
    Original splat:
    
    [    6.487446] ==================================================================
    [    6.494693] BUG: KASAN: use-after-free in ic_close_devs+0xc4/0x154 at addr ffff800367efa708
    [    6.503013] Read of size 8 by task swapper/0/1
    [    6.507452] CPU: 5 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc3-00002-gda42158 Freescale#8
    [    6.514993] Hardware name: AppliedMicro Mustang/Mustang, BIOS 3.05.05-beta_rc Jan 27 2016
    [    6.523138] Call trace:
    [    6.525590] [<ffff200008094778>] dump_backtrace+0x0/0x570
    [    6.530976] [<ffff200008094d08>] show_stack+0x20/0x30
    [    6.536017] [<ffff200008bee928>] dump_stack+0x120/0x188
    [    6.541231] [<ffff20000856d5e4>] kasan_object_err+0x24/0xa0
    [    6.546790] [<ffff20000856d924>] kasan_report_error+0x244/0x738
    [    6.552695] [<ffff20000856dfec>] __asan_report_load8_noabort+0x54/0x80
    [    6.559204] [<ffff20000aae86ac>] ic_close_devs+0xc4/0x154
    [    6.564590] [<ffff20000aaedbac>] ip_auto_config+0x2ed4/0x2f1c
    [    6.570321] [<ffff200008084b04>] do_one_initcall+0xcc/0x370
    [    6.575882] [<ffff20000aa31de8>] kernel_init_freeable+0x5f8/0x6c4
    [    6.581959] [<ffff20000a16df00>] kernel_init+0x18/0x190
    [    6.587171] [<ffff200008084710>] ret_from_fork+0x10/0x40
    [    6.592468] Object at ffff800367efa700, in cache kmalloc-128 size: 128
    [    6.598969] Allocated:
    [    6.601324] PID = 1
    [    6.603427]  save_stack_trace_tsk+0x0/0x418
    [    6.607603]  save_stack_trace+0x20/0x30
    [    6.611430]  kasan_kmalloc+0xd8/0x188
    [    6.615087]  ip_auto_config+0x8c4/0x2f1c
    [    6.619002]  do_one_initcall+0xcc/0x370
    [    6.622832]  kernel_init_freeable+0x5f8/0x6c4
    [    6.627178]  kernel_init+0x18/0x190
    [    6.630660]  ret_from_fork+0x10/0x40
    [    6.634223] Freed:
    [    6.636233] PID = 1
    [    6.638334]  save_stack_trace_tsk+0x0/0x418
    [    6.642510]  save_stack_trace+0x20/0x30
    [    6.646337]  kasan_slab_free+0x88/0x178
    [    6.650167]  kfree+0xb8/0x478
    [    6.653131]  ic_close_devs+0x130/0x154
    [    6.656875]  ip_auto_config+0x2ed4/0x2f1c
    [    6.660875]  do_one_initcall+0xcc/0x370
    [    6.664705]  kernel_init_freeable+0x5f8/0x6c4
    [    6.669051]  kernel_init+0x18/0x190
    [    6.672534]  ret_from_fork+0x10/0x40
    [    6.676098] Memory state around the buggy address:
    [    6.680880]  ffff800367efa600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    [    6.688078]  ffff800367efa680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    [    6.695276] >ffff800367efa700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    [    6.702469]                       ^
    [    6.705952]  ffff800367efa780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    [    6.713149]  ffff800367efa800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    [    6.720343] ==================================================================
    [    6.727536] Disabling lock debugging due to kernel taint
    
    Signed-off-by: Mark Rutland <[email protected]>
    Cc: Alexey Kuznetsov <[email protected]>
    Cc: David S. Miller <[email protected]>
    Cc: Hideaki YOSHIFUJI <[email protected]>
    Cc: James Morris <[email protected]>
    Cc: Patrick McHardy <[email protected]>
    Cc: [email protected]
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Mark Rutland authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    29c4f51 View commit details
    Browse the repository at this point in the history
  35. KVM: pci-assign: do not map smm memory slot pages in vt-d page tables

    [ Upstream commit 0292e16 ]
    
    or VM memory are not put thus leaked in kvm_iommu_unmap_memslots() when
    destroy VM.
    
    This is consistent with current vfio implementation.
    
    Signed-off-by: herongguang <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Herongguang (Stephen) authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    808ed3b View commit details
    Browse the repository at this point in the history
  36. virtio-balloon: use actual number of stats for stats queue buffers

    [ Upstream commit 9646b26 ]
    
    The virtio balloon driver contained a not-so-obvious invariant that
    update_balloon_stats has to update exactly VIRTIO_BALLOON_S_NR counters
    in order to send valid stats to the host. This commit fixes it by having
    update_balloon_stats return the actual number of counters, and its
    callers use it when pushing buffers to the stats virtqueue.
    
    Note that it is still out of spec to change the number of counters
    at run-time. "Driver MUST supply the same subset of statistics in all
    buffers submitted to the statsq."
    
    Suggested-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Ladi Prosek <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ladipro authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    c6f9090 View commit details
    Browse the repository at this point in the history
  37. virtio_balloon: prevent uninitialized variable use

    [ Upstream commit f0bb2d5 ]
    
    The latest gcc-7.0.1 snapshot reports a new warning:
    
    virtio/virtio_balloon.c: In function 'update_balloon_stats':
    virtio/virtio_balloon.c:258:26: error: 'events[2]' is used uninitialized in this function [-Werror=uninitialized]
    virtio/virtio_balloon.c:260:26: error: 'events[3]' is used uninitialized in this function [-Werror=uninitialized]
    virtio/virtio_balloon.c:261:56: error: 'events[18]' is used uninitialized in this function [-Werror=uninitialized]
    virtio/virtio_balloon.c:262:56: error: 'events[17]' is used uninitialized in this function [-Werror=uninitialized]
    
    This seems absolutely right, so we should add an extra check to
    prevent copying uninitialized stack data into the statistics.
    >From all I can tell, this has been broken since the statistics code
    was originally added in 2.6.34.
    
    Fixes: 9564e13 ("virtio: Add memory statistics reporting to the balloon driver (V4)")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: Ladi Prosek <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    bb011a4 View commit details
    Browse the repository at this point in the history
  38. isdn: kcapi: avoid uninitialized data

    [ Upstream commit af109a2 ]
    
    gcc-7 points out that the AVMB1_ADDCARD ioctl results in an unintialized
    value ending up in the cardnr parameter:
    
    drivers/isdn/capi/kcapi.c: In function 'old_capi_manufacturer':
    drivers/isdn/capi/kcapi.c:1042:24: error: 'cdef.cardnr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       cparams.cardnr = cdef.cardnr;
    
    This has been broken since before the start of the git history, so
    either the value is not used for anything important, or the ioctl
    command doesn't get called in practice.
    
    Setting the cardnr to zero avoids the warning and makes sure
    we have consistent behavior.
    
    Signed-off-by: Arnd Bergmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    arndb authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    ce19146 View commit details
    Browse the repository at this point in the history
  39. net: moxa: fix TX overrun memory leak

    [ Upstream commit c2b341a ]
    
    moxart_mac_start_xmit() doesn't care where tx_tail is, tx_head can
    catch and pass tx_tail, which is bad because moxart_tx_finished()
    isn't guaranteed to catch up on freeing resources from tx_tail.
    
    Add a check in moxart_mac_start_xmit() stopping the queue at the
    end of the circular buffer. Also add a check in moxart_tx_finished()
    waking the queue if the buffer has TX_WAKE_THRESHOLD or more
    free descriptors.
    
    While we're at it, move spin_lock_irq() to happen before our
    descriptor pointer is assigned in moxart_mac_start_xmit().
    
    Addresses https://bugzilla.kernel.org/show_bug.cgi?id=99451
    
    Signed-off-by: Jonas Jensen <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Kasreyn authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    55b6a5d View commit details
    Browse the repository at this point in the history
  40. xhci: plat: Register shutdown for xhci_plat

    [ Upstream commit b07c125 ]
    
    Shutdown should be called for xhci_plat devices especially for
    situations where kexec might be used by stopping DMA
    transactions.
    
    Signed-off-by: Adam Wallis <[email protected]>
    Signed-off-by: Mathias Nyman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Adam Wallis authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    54420c1 View commit details
    Browse the repository at this point in the history
  41. netfilter: nfnetlink_queue: fix secctx memory leak

    [ Upstream commit 77c1c03 ]
    
    We must call security_release_secctx to free the memory returned by
    security_secid_to_secctx, otherwise memory may be leaked forever.
    
    Fixes: ef493bd ("netfilter: nfnetlink_queue: add security context information")
    Signed-off-by: Liping Zhang <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Liping Zhang authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    0708a47 View commit details
    Browse the repository at this point in the history
  42. Btrfs: fix an integer overflow check

    [ Upstream commit 457ae72 ]
    
    This isn't super serious because you need CAP_ADMIN to run this code.
    
    I added this integer overflow check last year but apparently I am
    rubbish at writing integer overflow checks...  There are two issues.
    First, access_ok() works on unsigned long type and not u64 so on 32 bit
    systems the access_ok() could be checking a truncated size.  The other
    issue is that we should be using a stricter limit so we don't overflow
    the kzalloc() setting ctx->clone_roots later in the function after the
    access_ok():
    
    	alloc_size = sizeof(struct clone_root) * (arg->clone_sources_count + 1);
    	sctx->clone_roots = kzalloc(alloc_size, GFP_KERNEL | __GFP_NOWARN);
    
    Fixes: f5ecec3 ("btrfs: send: silence an integer overflow warning")
    Signed-off-by: Dan Carpenter <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    [ added comment ]
    Signed-off-by: David Sterba <[email protected]>
    
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Dan Carpenter authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    9c1433b View commit details
    Browse the repository at this point in the history
  43. ARM: dma-mapping: disallow dma_get_sgtable() for non-kernel managed m…

    …emory
    
    [ Upstream commit 916a008 ]
    
    dma_get_sgtable() tries to create a scatterlist table containing valid
    struct page pointers for the coherent memory allocation passed in to it.
    
    However, memory can be declared via dma_declare_coherent_memory(), or
    via other reservation schemes which means that coherent memory is not
    guaranteed to be backed by struct pages.  In such cases, the resulting
    scatterlist table contains pointers to invalid pages, which causes
    kernel oops later.
    
    This patch adds detection of such memory, and refuses to create a
    scatterlist table for such memory.
    
    Reported-by: Shuah Khan <[email protected]>
    Signed-off-by: Russell King <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Russell King authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    5460e46 View commit details
    Browse the repository at this point in the history
  44. cpuidle: powernv: Pass correct drv->cpumask for registration

    [ Upstream commit 293d264 ]
    
    drv->cpumask defaults to cpu_possible_mask in __cpuidle_driver_init().
    On PowerNV platform cpu_present could be less than cpu_possible in cases
    where firmware detects the cpu, but it is not available to the OS.  When
    CONFIG_HOTPLUG_CPU=n, such cpus are not hotplugable at runtime and hence
    we skip creating cpu_device.
    
    This breaks cpuidle on powernv where register_cpu() is not called for
    cpus in cpu_possible_mask that cannot be hot-added at runtime.
    
    Trying cpuidle_register_device() on cpu without cpu_device will cause
    crash like this:
    
    cpu 0xf: Vector: 380 (Data SLB Access) at [c000000ff1503490]
        pc: c00000000022c8bc: string+0x34/0x60
        lr: c00000000022ed78: vsnprintf+0x284/0x42c
        sp: c000000ff1503710
       msr: 9000000000009033
       dar: 6000000060000000
      current = 0xc000000ff1480000
      paca    = 0xc00000000fe82d00   softe: 0        irq_happened: 0x01
        pid   = 1, comm = swapper/8
    Linux version 4.11.0-rc2 (sv@sagarika) (gcc version 4.9.4
    (Buildroot 2017.02-00004-gc28573e) ) Freescale#15 SMP Fri Mar 17 19:32:02 IST 2017
    enter ? for help
    [link register   ] c00000000022ed78 vsnprintf+0x284/0x42c
    [c000000ff1503710] c00000000022ebb8 vsnprintf+0xc4/0x42c (unreliable)
    [c000000ff1503800] c00000000022ef40 vscnprintf+0x20/0x44
    [c000000ff1503830] c0000000000ab61c vprintk_emit+0x94/0x2cc
    [c000000ff15038a0] c0000000000acc9c vprintk_func+0x60/0x74
    [c000000ff15038c0] c000000000619694 printk+0x38/0x4c
    [c000000ff15038e0] c000000000224950 kobject_get+0x40/0x60
    [c000000ff1503950] c00000000022507c kobject_add_internal+0x60/0x2c4
    [c000000ff15039e0] c000000000225350 kobject_init_and_add+0x70/0x78
    [c000000ff1503a60] c00000000053c288 cpuidle_add_sysfs+0x9c/0xe0
    [c000000ff1503ae0] c00000000053aeac cpuidle_register_device+0xd4/0x12c
    [c000000ff1503b30] c00000000053b108 cpuidle_register+0x98/0xcc
    [c000000ff1503bc0] c00000000085eaf0 powernv_processor_idle_init+0x140/0x1e0
    [c000000ff1503c60] c00000000000cd60 do_one_initcall+0xc0/0x15c
    [c000000ff1503d20] c000000000833e84 kernel_init_freeable+0x1a0/0x25c
    [c000000ff1503dc0] c00000000000d478 kernel_init+0x24/0x12c
    [c000000ff1503e30] c00000000000b564 ret_from_kernel_thread+0x5c/0x78
    
    This patch fixes the bug by passing correct cpumask from
    powernv-cpuidle driver.
    
    Signed-off-by: Vaidyanathan Srinivasan <[email protected]>
    Reviewed-by: Gautham R. Shenoy <[email protected]>
    Acked-by: Michael Ellerman <[email protected]>
    [ rjw: Comment massage ]
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    svaidy authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    9e17713 View commit details
    Browse the repository at this point in the history
  45. bnxt_en: Fix NULL pointer dereference in reopen failure path

    [ Upstream commit 2247925 ]
    
    Net device reset can fail when the h/w or f/w is in a bad state.
    Subsequent netdevice open fails in bnxt_hwrm_stat_ctx_alloc().
    The cleanup invokes bnxt_hwrm_resource_free() which inturn
    calls bnxt_disable_int().  In this routine, the code segment
    
    if (ring->fw_ring_id != INVALID_HW_RING_ID)
       BNXT_CP_DB(cpr->cp_doorbell, cpr->cp_raw_cons);
    
    results in NULL pointer dereference as cpr->cp_doorbell is not yet
    initialized, and fw_ring_id is zero.
    
    The fix is to initialize cpr fw_ring_id to INVALID_HW_RING_ID before
    bnxt_init_chip() is invoked.
    
    Signed-off-by: Sankar Patchineelam <[email protected]>
    Signed-off-by: Michael Chan <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Sankar Patchineelam authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    d14718c View commit details
    Browse the repository at this point in the history
  46. backlight: pwm_bl: Fix overflow condition

    [ Upstream commit 5d0c49a ]
    
    This fixes an overflow condition that can happen with high max
    brightness and period values in compute_duty_cycle. This fixes it by
    using a 64 bit variable for computing the duty cycle.
    
    Signed-off-by: Derek Basehore <[email protected]>
    Acked-by: Thierry Reding <[email protected]>
    Reviewed-by: Brian Norris <[email protected]>
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dbasehore authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    291c7e4 View commit details
    Browse the repository at this point in the history
  47. crypto: crypto4xx - increase context and scatter ring buffer elements

    [ Upstream commit 778f81d ]
    
    If crypto4xx is used in conjunction with dm-crypt, the available
    ring buffer elements are not enough to handle the load properly.
    
    On an aes-cbc-essiv:sha256 encrypted swap partition the read
    performance is abyssal: (tested with hdparm -t)
    
    /dev/mapper/swap_crypt:
     Timing buffered disk reads:  14 MB in  3.68 seconds =   3.81 MB/sec
    
    The patch increases both PPC4XX_NUM_SD and PPC4XX_NUM_PD to 256.
    This improves the performance considerably:
    
    /dev/mapper/swap_crypt:
     Timing buffered disk reads: 104 MB in  3.03 seconds =  34.31 MB/sec
    
    Furthermore, PPC4XX_LAST_SD, PPC4XX_LAST_GD and PPC4XX_LAST_PD
    can be easily calculated from their respective PPC4XX_NUM_*
    constant.
    
    Signed-off-by: Christian Lamparter <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    chunkeey authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    1525e33 View commit details
    Browse the repository at this point in the history
  48. rtc: pl031: make interrupt optional

    [ Upstream commit 5b64a29 ]
    
    On some platforms, the interrupt for the PL031 is optional.  Avoid
    trying to claim the interrupt if it's not specified.
    
    Reviewed-by: Linus Walleij <[email protected]>
    Signed-off-by: Russell King <[email protected]>
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Russell King authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    bdb33bb View commit details
    Browse the repository at this point in the history
  49. kvm, mm: account kvm related kmem slabs to kmemcg

    [ Upstream commit 46bea48 ]
    
    The kvm slabs can consume a significant amount of system memory
    and indeed in our production environment we have observed that
    a lot of machines are spending significant amount of memory that
    can not be left as system memory overhead. Also the allocations
    from these slabs can be triggered directly by user space applications
    which has access to kvm and thus a buggy application can leak
    such memory. So, these caches should be accounted to kmemcg.
    
    Signed-off-by: Shakeel Butt <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    shakeelb authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    206e162 View commit details
    Browse the repository at this point in the history
  50. net: phy: at803x: Change error to EINVAL for invalid MAC

    [ Upstream commit fc75568 ]
    
    Change the return error code to EINVAL if the MAC
    address is not valid in the set_wol function.
    
    Signed-off-by: Dan Murphy <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Dan Murphy authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    d3469e6 View commit details
    Browse the repository at this point in the history
  51. PCI: Avoid bus reset if bridge itself is broken

    [ Upstream commit 3570277 ]
    
    When checking to see if a PCI bus can safely be reset, we previously
    checked to see if any of the children had their PCI_DEV_FLAGS_NO_BUS_RESET
    flag set.  Children marked with that flag are known not to behave well
    after a bus reset.
    
    Some PCIe root port bridges also do not behave well after a bus reset,
    sometimes causing the devices behind the bridge to become unusable.
    
    Add a check for PCI_DEV_FLAGS_NO_BUS_RESET being set in the bridge device
    to allow these bridges to be flagged, and prevent their secondary buses
    from being reset.
    
    Signed-off-by: David Daney <[email protected]>
    [[email protected]: fixed typo]
    Signed-off-by: Jan Glauber <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Reviewed-by: Alex Williamson <[email protected]>
    
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    daviddaney authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    241833a View commit details
    Browse the repository at this point in the history
  52. scsi: cxgb4i: fix Tx skb leak

    [ Upstream commit 9b3a081 ]
    
    In case of connection reset Tx skb queue can have some skbs which are
    not transmitted so purge Tx skb queue in release_offload_resources() to
    avoid skb leak.
    
    Signed-off-by: Varun Prakash <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Varun Prakash authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    fd1d9dc View commit details
    Browse the repository at this point in the history
  53. scsi: mpt3sas: Fix IO error occurs on pulling out a drive from RAID1 …

    …volume created on two SATA drive
    
    [ Upstream commit 2ce9a36 ]
    
    Whenever an I/O for a RAID volume fails with IOCStatus
    MPI2_IOCSTATUS_SCSI_IOC_TERMINATED and SCSIStatus equal to
    (MPI2_SCSI_STATE_TERMINATED | MPI2_SCSI_STATE_NO_SCSI_STATUS) then
    return the I/O to SCSI midlayer with "DID_RESET" (i.e. retry the IO
    infinite times) set in the host byte.
    
    Previously, the driver was completing the I/O with "DID_SOFT_ERROR"
    which causes the I/O to be quickly retried. However, firmware needed
    more time and hence I/Os were failing.
    
    Signed-off-by: Sreekanth Reddy <[email protected]>
    Reviewed-by: Tomas Henzl <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    sreekanthbrcm authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    b40eeea View commit details
    Browse the repository at this point in the history
  54. PCI: Create SR-IOV virtfn/physfn links before attaching driver

    [ Upstream commit 27d6162 ]
    
    When creating virtual functions, create the "virtfn%u" and "physfn" links
    in sysfs *before* attaching the driver instead of after.  When we attach
    the driver to the new virtual network interface first, there is a race when
    the driver attaches to the new sends out an "add" udev event, and the
    network interface naming software (biosdevname or systemd, for example)
    tries to look at these links.
    
    Signed-off-by: Stuart Hayes <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Stuart Hayes authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    164a941 View commit details
    Browse the repository at this point in the history
  55. PM / OPP: Move error message to debug level

    [ Upstream commit 035ed07 ]
    
    On some i.MX6 platforms which do not have speed grading
    check, opp table will not be created in platform code,
    so cpufreq driver prints the following error message:
    
    cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
    
    However, this is not really an error in this case because the
    imx6q-cpufreq driver first calls dev_pm_opp_get_opp_count()
    and if it fails, it means that platform code does not provide
    OPP and then dev_pm_opp_of_add_table() will be called.
    
    In order to avoid such confusing error message, move it to
    debug level.
    
    It is up to the caller of dev_pm_opp_get_opp_count() to check its
    return value and decide if it will print an error or not.
    
    Signed-off-by: Fabio Estevam <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Fabio Estevam authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    c236525 View commit details
    Browse the repository at this point in the history
  56. igb: check memory allocation failure

    [ Upstream commit 18eb863 ]
    
    Check memory allocation failures and return -ENOMEM in such cases, as
    already done for other memory allocations in this function.
    
    This avoids NULL pointers dereference.
    
    Signed-off-by: Christophe JAILLET <[email protected]>
    Tested-by: Aaron Brown <[email protected]>
    Acked-by: PJ Waskiewicz <[email protected]>
    Signed-off-by: Jeff Kirsher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tititiou36 authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    700053c View commit details
    Browse the repository at this point in the history
  57. ixgbe: fix use of uninitialized padding

    [ Upstream commit dcfd6b8 ]
    
    This patch is resolving Coverity hits where padding in a structure could
    be used uninitialized.
    
    - Initialize fwd_cmd.pad/2 before ixgbe_calculate_checksum()
    
    - Initialize buffer.pad2/3 before ixgbe_hic_unlocked()
    
    Signed-off-by: Emil Tantilov <[email protected]>
    Tested-by: Andrew Bowers <[email protected]>
    Signed-off-by: Jeff Kirsher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    etantilov authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    2141182 View commit details
    Browse the repository at this point in the history
  58. IB/rxe: check for allocation failure on elem

    [ Upstream commit 4831ca9 ]
    
    The allocation for elem may fail (especially because we're using
    GFP_ATOMIC) so best to check for a null return.  This fixes a potential
    null pointer dereference when assigning elem->pool.
    
    Detected by CoverityScan CID#1357507 ("Dereference null return value")
    
    Fixes: 8700e3e ("Soft RoCE driver")
    Signed-off-by: Colin Ian King <[email protected]>
    Signed-off-by: Doug Ledford <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Colin Ian King authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    1d4b32b View commit details
    Browse the repository at this point in the history
  59. PCI/AER: Report non-fatal errors only to the affected endpoint

    [ Upstream commit 86acc79 ]
    
    Previously, if an non-fatal error was reported by an endpoint, we
    called report_error_detected() for the endpoint, every sibling on the
    bus, and their descendents.  If any of them did not implement the
    .error_detected() method, do_recovery() failed, leaving all these
    devices unrecovered.
    
    For example, the system described in the bugzilla below has two devices:
    
      0000:74:02.0 [19e5:a230] SAS controller, driver has .error_detected()
      0000:74:03.0 [19e5:a235] SATA controller, driver lacks .error_detected()
    
    When a device such as 74:02.0 reported a non-fatal error, do_recovery()
    failed because 74:03.0 lacked an .error_detected() method.  But per PCIe
    r3.1, sec 6.2.2.2.2, such an error does not compromise the Link and
    does not affect 74:03.0:
    
      Non-fatal errors are uncorrectable errors which cause a particular
      transaction to be unreliable but the Link is otherwise fully functional.
      Isolating Non-fatal from Fatal errors provides Requester/Receiver logic
      in a device or system management software the opportunity to recover from
      the error without resetting the components on the Link and disturbing
      other transactions in progress.  Devices not associated with the
      transaction in error are not impacted by the error.
    
    Report non-fatal errors only to the endpoint that reported them.  We really
    want to check for AER_NONFATAL here, but the current code structure doesn't
    allow that.  Looking for pci_channel_io_normal is the best we can do now.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=197055
    Fixes: 6c2b374 ("PCI-Express AER implemetation: AER core and aerdriver")
    Signed-off-by: Gabriele Paoloni <[email protected]>
    Signed-off-by: Dongdong Liu <[email protected]>
    [bhelgaas: changelog]
    Signed-off-by: Bjorn Helgaas <[email protected]>
    
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    g00308965 authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    fbb2d72 View commit details
    Browse the repository at this point in the history
  60. tracing: Exclude 'generic fields' from histograms

    [ Upstream commit a15f7fc ]
    
    There are a small number of 'generic fields' (comm/COMM/cpu/CPU) that
    are found by trace_find_event_field() but are only meant for
    filtering.  Specifically, they unlike normal fields, they have a size
    of 0 and thus wreak havoc when used as a histogram key.
    
    Exclude these (return -EINVAL) when used as histogram keys.
    
    Link: http://lkml.kernel.org/r/956154cbc3e8a4f0633d619b886c97f0f0edf7b4.1506105045.git.tom.zanussi@linux.intel.com
    
    Signed-off-by: Tom Zanussi <[email protected]>
    Signed-off-by: Steven Rostedt (VMware) <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tzanussi authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    6af9b18 View commit details
    Browse the repository at this point in the history
  61. ASoC: img-parallel-out: Add pm_runtime_get/put to set_fmt callback

    [ Upstream commit c704588 ]
    
    Add pm_runtime_get_sync and pm_runtime_put calls to set_fmt callback
    function. This fixes a bus error during boot when CONFIG_SUSPEND is
    defined when this function gets called while the device is runtime
    disabled and device registers are accessed while the clock is disabled.
    
    Signed-off-by: Ed Blake <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ed-blake1 authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    bd0feaa View commit details
    Browse the repository at this point in the history
  62. fm10k: fix mis-ordered parameters in declaration for .ndo_set_vf_bw

    [ Upstream commit 3e256ac ]
    
    We've had support for setting both a minimum and maximum bandwidth via
    .ndo_set_vf_bw since commit 883a9cc ("fm10k: Add support for SR-IOV
    to driver", 2014-09-20).
    
    Likely because we do not support minimum rates, the declaration
    mis-ordered the "unused" parameter, which causes warnings when analyzed
    with cppcheck.
    
    Fix this warning by properly declaring the min_rate and max_rate
    variables in the declaration and definition (rather than using
    "unused"). Also rename "rate" to max_rate so as to clarify that we only
    support setting the maximum rate.
    
    Signed-off-by: Jacob Keller <[email protected]>
    Tested-by: Krishneil Singh <[email protected]>
    Signed-off-by: Jeff Kirsher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jacob-keller authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    fc9d638 View commit details
    Browse the repository at this point in the history
  63. scsi: lpfc: Fix secure firmware updates

    [ Upstream commit 184fc2b ]
    
    Firmware update fails with: status x17 add_status x56 on the final write
    
    If multiple DMA buffers are used for the download, some firmware revs
    have difficulty with signatures and crcs split across the dma buffer
    boundaries.  Resolve by making all writes be a single 4k page in length.
    
    Signed-off-by: Dick Kennedy <[email protected]>
    Signed-off-by: James Smart <[email protected]>
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Dick Kennedy authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    b438d2f View commit details
    Browse the repository at this point in the history
  64. scsi: lpfc: PLOGI failures during NPIV testing

    [ Upstream commit e8bcf0a ]
    
    Local Reject/Invalid RPI errors seen during discovery.
    
    Temporary RPI cleanup was occurring regardless of SLI rev. It's only
    necessary on SLI-4.
    
    Adjust the test for whether cleanup is necessary.
    
    Signed-off-by: Dick Kennedy <[email protected]>
    Signed-off-by: James Smart <[email protected]>
    Reviewed-by: Johannes Thumshirn <[email protected]>
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Dick Kennedy authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    de5a4c8 View commit details
    Browse the repository at this point in the history
  65. vfio/pci: Virtualize Maximum Payload Size

    [ Upstream commit 5231849 ]
    
    With virtual PCI-Express chipsets, we now see userspace/guest drivers
    trying to match the physical MPS setting to a virtual downstream port.
    Of course a lone physical device surrounded by virtual interconnects
    cannot make a correct decision for a proper MPS setting.  Instead,
    let's virtualize the MPS control register so that writes through to
    hardware are disallowed.  Userspace drivers like QEMU assume they can
    write anything to the device and we'll filter out anything dangerous.
    Since mismatched MPS can lead to AER and other faults, let's add it
    to the kernel side rather than relying on userspace virtualization to
    handle it.
    
    Signed-off-by: Alex Williamson <[email protected]>
    Reviewed-by: Eric Auger <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    awilliam authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    76d83bf View commit details
    Browse the repository at this point in the history
  66. fm10k: ensure we process SM mbx when processing VF mbx

    [ Upstream commit 17a9180 ]
    
    When we process VF mailboxes, the driver is likely going to also queue
    up messages to the switch manager. This process merely queues up the
    FIFO, but doesn't actually begin the transmission process. Because we
    hold the mailbox lock during this VF processing, the PF<->SM mailbox is
    not getting processed at this time. Ensure that we actually process the
    PF<->SM mailbox in between each PF<->VF mailbox.
    
    This should ensure prompt transmission of the messages queued up after
    each VF message is received and handled.
    
    Signed-off-by: Jacob Keller <[email protected]>
    Tested-by: Krishneil Singh <[email protected]>
    Signed-off-by: Jeff Kirsher <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jacob-keller authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    52d0a60 View commit details
    Browse the repository at this point in the history
  67. net: ipv6: send NS for DAD when link operationally up

    [ Upstream commit 1f372c7 ]
    
    The NS for DAD are sent on admin up as long as a valid qdisc is found.
    A race condition exists by which these packets will not egress the
    interface if the operational state of the lower device is not yet up.
    The solution is to delay DAD until the link is operationally up
    according to RFC2863. Rather than only doing this, follow the existing
    code checks by deferring IPv6 device initialization altogether. The fix
    allows DAD on devices like tunnels that are controlled by userspace
    control plane. The fix has no impact on regular deployments, but means
    that there is no IPv6 connectivity until the port has been opened in
    the case of port-based network access control, which should be
    desirable.
    
    Signed-off-by: Mike Manning <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Mike Manning authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    4bf42a2 View commit details
    Browse the repository at this point in the history
  68. staging: greybus: light: Release memory obtained by kasprintf

    [ Upstream commit 04820da ]
    
    Free memory region, if gb_lights_channel_config is not successful.
    
    Signed-off-by: Arvind Yadav <[email protected]>
    Reviewed-by: Rui Miguel Silva <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ArvindYadavCs authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    bb0618a View commit details
    Browse the repository at this point in the history
  69. clk: sunxi-ng: sun6i: Rename HDMI DDC clock to avoid name collision

    [ Upstream commit 7f3ed79 ]
    
    The HDMI DDC clock found in the CCU is the parent of the actual DDC
    clock within the HDMI controller. That clock is also named "hdmi-ddc".
    
    Rename the one in the CCU to "ddc". This makes more sense than renaming
    the one in the HDMI controller to something else.
    
    Fixes: c6e6c96 ("clk: sunxi-ng: Add A31/A31s clocks")
    Signed-off-by: Chen-Yu Tsai <[email protected]>
    Signed-off-by: Maxime Ripard <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wens authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    5859027 View commit details
    Browse the repository at this point in the history
  70. tcp: fix under-evaluated ssthresh in TCP Vegas

    [ Upstream commit cf5d74b ]
    
    With the commit 7617400 (tcp: do not slow start when cwnd equals
    ssthresh), the comparison to the reduced cwnd in tcp_vegas_ssthresh() would
    under-evaluate the ssthresh.
    
    Signed-off-by: Hoang Tran <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hoang-tranviet authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    acc9672 View commit details
    Browse the repository at this point in the history
  71. rtc: set the alarm to the next expiring timer

    [ Upstream commit 74717b2 ]
    
    If there is any non expired timer in the queue, the RTC alarm is never set.
    This is an issue when adding a timer that expires before the next non
    expired timer.
    
    Ensure the RTC alarm is set in that case.
    
    Fixes: 2b2f5ff ("rtc: interface: ignore expired timers when enqueuing new timers")
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    alexandrebelloni authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    15319d2 View commit details
    Browse the repository at this point in the history
  72. cpuidle: fix broadcast control when broadcast can not be entered

    [ Upstream commit f187851 ]
    
    When failing to enter broadcast timer mode for an idle state that
    requires it, a new state is selected that does not require broadcast,
    but the broadcast variable remains set. This causes
    tick_broadcast_exit to be called despite not having entered broadcast
    mode.
    
    This causes the WARN_ON_ONCE(!irqs_disabled()) to trigger in some
    cases. It does not appear to cause problems for code today, but seems
    to violate the interface so should be fixed.
    
    Signed-off-by: Nicholas Piggin <[email protected]>
    Reviewed-by: Thomas Gleixner <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    npiggin authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    b86c7b8 View commit details
    Browse the repository at this point in the history
  73. thermal: hisilicon: Handle return value of clk_prepare_enable

    commit 919054f upstream.
    
    clk_prepare_enable() can fail here and we must check its return value.
    
    Signed-off-by: Arvind Yadav <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Signed-off-by: Kevin Wangtao <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ArvindYadavCs authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    82bf76a View commit details
    Browse the repository at this point in the history
  74. thermal/drivers/hisi: Fix missing interrupt enablement

    commit c176b10 upstream.
    
    The interrupt for the temperature threshold is not enabled at the end of the
    probe function, enable it after the setup is complete.
    
    On the other side, the irq_enabled is not correctly set as we are checking if
    the interrupt is masked where 'yes' means irq_enabled=false.
    
    	irq_get_irqchip_state(data->irq, IRQCHIP_STATE_MASKED,
    				&data->irq_enabled);
    
    As we are always enabling the interrupt, it is pointless to check if
    the interrupt is masked or not, just set irq_enabled to 'true'.
    
    Signed-off-by: Daniel Lezcano <[email protected]>
    Reviewed-by: Leo Yan <[email protected]>
    Tested-by: Leo Yan <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Signed-off-by: Kevin Wangtao <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dlezcano authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    b679b8d View commit details
    Browse the repository at this point in the history
  75. thermal/drivers/hisi: Fix kernel panic on alarm interrupt

    commit 2cb4de7 upstream.
    
    The threaded interrupt for the alarm interrupt is requested before the
    temperature controller is setup. This one can fire an interrupt immediately
    leading to a kernel panic as the sensor data is not initialized.
    
    In order to prevent that, move the threaded irq after the Tsensor is setup.
    
    Signed-off-by: Daniel Lezcano <[email protected]>
    Reviewed-by: Leo Yan <[email protected]>
    Tested-by: Leo Yan <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Signed-off-by: Kevin Wangtao <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dlezcano authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    2dac559 View commit details
    Browse the repository at this point in the history
  76. thermal/drivers/hisi: Simplify the temperature/step computation

    commit 48880b9 upstream.
    
    The step and the base temperature are fixed values, we can simplify the
    computation by converting the base temperature to milli celsius and use a
    pre-computed step value. That saves us a lot of mult + div for nothing at
    runtime.
    
    Take also the opportunity to change the function names to be consistent with
    the rest of the code.
    
    Signed-off-by: Daniel Lezcano <[email protected]>
    Reviewed-by: Leo Yan <[email protected]>
    Tested-by: Leo Yan <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Signed-off-by: Kevin Wangtao <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dlezcano authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    1b2c46a View commit details
    Browse the repository at this point in the history
  77. thermal/drivers/hisi: Fix multiple alarm interrupts firing

    commit db2b033 upstream.
    
    The DT specifies a threshold of 65000, we setup the register with a value in
    the temperature resolution for the controller, 64656.
    
    When we reach 64656, the interrupt fires, the interrupt is disabled. Then the
    irq thread runs and calls thermal_zone_device_update() which will call in turn
    hisi_thermal_get_temp().
    
    The function will look if the temperature decreased, assuming it was more than
    65000, but that is not the case because the current temperature is 64656
    (because of the rounding when setting the threshold). This condition being
    true, we re-enable the interrupt which fires immediately after exiting the irq
    thread. That happens again and again until the temperature goes to more than
    65000.
    
    Potentially, there is here an interrupt storm if the temperature stabilizes at
    this temperature. A very unlikely case but possible.
    
    In any case, it does not make sense to handle dozens of alarm interrupt for
    nothing.
    
    Fix this by rounding the threshold value to the controller resolution so the
    check against the threshold is consistent with the one set in the controller.
    
    Signed-off-by: Daniel Lezcano <[email protected]>
    Reviewed-by: Leo Yan <[email protected]>
    Tested-by: Leo Yan <[email protected]>
    Signed-off-by: Eduardo Valentin <[email protected]>
    Signed-off-by: Kevin Wangtao <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dlezcano authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    3cff907 View commit details
    Browse the repository at this point in the history
  78. MIPS: math-emu: Fix final emulation phase for certain instructions

    commit 409fcac upstream.
    
    Fix final phase of <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S>
    emulation. Provide proper generation of SIGFPE signal and updating
    debugfs FP exception stats in cases of any exception flags set in
    preceding phases of emulation.
    
    CLASS.<D|S> instruction may generate "Unimplemented Operation" FP
    exception. <MADDF|MSUBF>.<D|S> instructions may generate "Inexact",
    "Unimplemented Operation", "Invalid Operation", "Overflow", and
    "Underflow" FP exceptions. <MAX|MIN|MAXA|MINA>.<D|S> instructions
    can generate "Unimplemented Operation" and "Invalid Operation" FP
    exceptions.
    
    The proper final processing of the cases when any FP exception
    flag is set is achieved by replacing "break" statement with "goto
    copcsr" statement. With such solution, this patch brings the final
    phase of emulation of the above instructions consistent with the
    one corresponding to the previously implemented emulation of other
    related FPU instructions (ADD, SUB, etc.).
    
    Fixes: 38db37b ("MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction")
    Fixes: e24c3be ("MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction")
    Fixes: 83d4330 ("MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction")
    Fixes: a79f5f9 ("MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction")
    Fixes: 4e9561b ("MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction")
    Signed-off-by: Aleksandar Markovic <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Cc: Douglas Leung <[email protected]>
    Cc: Goran Ferenc <[email protected]>
    Cc: "Maciej W. Rozycki" <[email protected]>
    Cc: Miodrag Dinic <[email protected]>
    Cc: Paul Burton <[email protected]>
    Cc: Petar Jovanovic <[email protected]>
    Cc: Raghu Gandham <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/17581/
    Signed-off-by: James Hogan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    AMarkovic authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    00ecb4b View commit details
    Browse the repository at this point in the history
  79. platform/x86: asus-wireless: send an EV_SYN/SYN_REPORT between state …

    …changes
    
    commit bff5bf9 upstream.
    
    Sending the switch state change twice within the same frame is invalid
    evdev protocol and only works if the client handles keys immediately as
    well. Processing events immediately is incorrect, it forces a fake
    order of events that does not exist on the device.
    
    Recent versions of libinput changed to only process the device state and
    SYN_REPORT time, so now the key event is lost.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=104041
    
    Signed-off-by: Peter Hutterer <[email protected]>
    Signed-off-by: Darren Hart (VMware) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    whot authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    dbeb719 View commit details
    Browse the repository at this point in the history
  80. Revert "Bluetooth: btusb: driver to enable the usb-wakeup feature"

    This reverts commit 7336f54 which is
    commit a0085f2 upstream.
    
    It causes problems with working systems, as noted by a number of the
    ChromeOS developers.
    
    Cc: Sukumar Ghorai <[email protected]>
    Cc: Amit K Bag <[email protected]>
    Cc: Oliver Neukum <[email protected]>
    Cc: Marcel Holtmann <[email protected]>
    Cc: Matthias Kaehlcke <[email protected]>
    Reported-by: Guenter Roeck <[email protected]>
    Reported-by: Brian Norris <[email protected]>
    Acked-by: Brian Norris <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    3b6c84b View commit details
    Browse the repository at this point in the history
  81. bpf: adjust insn_aux_data when patching insns

    From: Alexei Starovoitov <[email protected]>
    
    [ Upstream commit 8041902 ]
    
    convert_ctx_accesses() replaces single bpf instruction with a set of
    instructions. Adjust corresponding insn_aux_data while patching.
    It's needed to make sure subsequent 'for(all insn)' loops
    have matching insn and insn_aux_data.
    
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    borkmann authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    565f012 View commit details
    Browse the repository at this point in the history
  82. bpf: fix branch pruning logic

    From: Alexei Starovoitov <[email protected]>
    
    [ Upstream commit c131187 ]
    
    when the verifier detects that register contains a runtime constant
    and it's compared with another constant it will prune exploration
    of the branch that is guaranteed not to be taken at runtime.
    This is all correct, but malicious program may be constructed
    in such a way that it always has a constant comparison and
    the other branch is never taken under any conditions.
    In this case such path through the program will not be explored
    by the verifier. It won't be taken at run-time either, but since
    all instructions are JITed the malicious program may cause JITs
    to complain about using reserved fields, etc.
    To fix the issue we have to track the instructions explored by
    the verifier and sanitize instructions that are dead at run time
    with NOPs. We cannot reject such dead code, since llvm generates
    it for valid C code, since it doesn't do as much data flow
    analysis as the verifier does.
    
    Fixes: 17a5267 ("bpf: verifier (add verifier core)")
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    borkmann authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    7b5b73e View commit details
    Browse the repository at this point in the history
  83. bpf: reject out-of-bounds stack pointer calculation

    From: Jann Horn <[email protected]>
    
    Reject programs that compute wildly out-of-bounds stack pointers.
    Otherwise, pointers can be computed with an offset that doesn't fit into an
    `int`, causing security issues in the stack memory access check (as well as
    signed integer overflow during offset addition).
    
    This is a fix specifically for the v4.9 stable tree because the mainline
    code looks very different at this point.
    
    Fixes: 7bca0a9 ("bpf: enhance verifier to understand stack pointer arithmetic")
    Signed-off-by: Jann Horn <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    borkmann authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    d75d3ee View commit details
    Browse the repository at this point in the history
  84. bpf: fix incorrect sign extension in check_alu_op()

    From: Jann Horn <[email protected]>
    
    [ Upstream commit 95a762e ]
    
    Distinguish between
    BPF_ALU64|BPF_MOV|BPF_K (load 32-bit immediate, sign-extended to 64-bit)
    and BPF_ALU|BPF_MOV|BPF_K (load 32-bit immediate, zero-padded to 64-bit);
    only perform sign extension in the first case.
    
    Starting with v4.14, this is exploitable by unprivileged users as long as
    the unprivileged_bpf_disabled sysctl isn't set.
    
    Debian assigned CVE-2017-16995 for this issue.
    
    v3:
     - add CVE number (Ben Hutchings)
    
    Fixes: 4846113 ("bpf: allow access into map value arrays")
    Signed-off-by: Jann Horn <[email protected]>
    Acked-by: Edward Cree <[email protected]>
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    borkmann authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    3695b3b View commit details
    Browse the repository at this point in the history
  85. sparc32: Export vac_cache_size to fix build error

    commit 9d262d9 upstream.
    
    sparc32:allmodconfig fails to build with the following error.
    
    ERROR: "vac_cache_size" [drivers/infiniband/sw/rxe/rdma_rxe.ko] undefined!
    
    Fixes: cb88645 ("infiniband: Fix alignment of mmap cookies ...")
    Cc: Jason Gunthorpe <[email protected]>
    Cc: Doug Ledford <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    groeck authored and gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    6430e16 View commit details
    Browse the repository at this point in the history
  86. Linux 4.9.72

    gregkh committed Dec 25, 2017
    Configuration menu
    Copy the full SHA
    2df3979 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2017

  1. ACPI: APEI / ERST: Fix missing error handling in erst_reader()

    commit bb82e0b upstream.
    
    The commit f6f8285 ("pstore: pass allocated memory region back to
    caller") changed the check of the return value from erst_read() in
    erst_reader() in the following way:
    
            if (len == -ENOENT)
                    goto skip;
    -       else if (len < 0) {
    -               rc = -1;
    +       else if (len < sizeof(*rcd)) {
    +               rc = -EIO;
                    goto out;
    
    This introduced another bug: since the comparison with sizeof() is
    cast to unsigned, a negative len value doesn't hit any longer.
    As a result, when an error is returned from erst_read(), the code
    falls through, and it may eventually lead to some weird thing like
    memory corruption.
    
    This patch adds the negative error value check more explicitly for
    addressing the issue.
    
    Fixes: f6f8285 (pstore: pass allocated memory region back to caller)
    Tested-by: Jerry Tang <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Acked-by: Kees Cook <[email protected]>
    Reviewed-by: Borislav Petkov <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    54c74d3 View commit details
    Browse the repository at this point in the history
  2. acpi, nfit: fix health event notification

    commit adf6895 upstream.
    
    Integration testing with a BIOS that generates injected health event
    notifications fails to communicate those events to userspace. The nfit
    driver neglects to link the ACPI DIMM device with the necessary driver
    data so acpi_nvdimm_notify() fails this lookup:
    
            nfit_mem = dev_get_drvdata(dev);
            if (nfit_mem && nfit_mem->flags_attr)
                    sysfs_notify_dirent(nfit_mem->flags_attr);
    
    Add the necessary linkage when installing the notification handler and
    clean it up when the nfit driver instance is torn down.
    
    Cc: Toshi Kani <[email protected]>
    Cc: Vishal Verma <[email protected]>
    Fixes: ba9c8dd ("acpi, nfit: add dimm device notification support")
    Reported-by: Daniel Osawa <[email protected]>
    Tested-by: Daniel Osawa <[email protected]>
    Signed-off-by: Dan Williams <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    djbw authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    d31a207 View commit details
    Browse the repository at this point in the history
  3. crypto: mcryptd - protect the per-CPU queue with a lock

    commit 9abffc6 upstream.
    
    mcryptd_enqueue_request() grabs the per-CPU queue struct and protects
    access to it with disabled preemption. Then it schedules a worker on the
    same CPU. The worker in mcryptd_queue_worker() guards access to the same
    per-CPU variable with disabled preemption.
    
    If we take CPU-hotplug into account then it is possible that between
    queue_work_on() and the actual invocation of the worker the CPU goes
    down and the worker will be scheduled on _another_ CPU. And here the
    preempt_disable() protection does not work anymore. The easiest thing is
    to add a spin_lock() to guard access to the list.
    
    Another detail: mcryptd_queue_worker() is not processing more than
    MCRYPTD_BATCH invocation in a row. If there are still items left, then
    it will invoke queue_work() to proceed with more later. *I* would
    suggest to simply drop that check because it does not use a system
    workqueue and the workqueue is already marked as "CPU_INTENSIVE". And if
    preemption is required then the scheduler should do it.
    However if queue_work() is used then the work item is marked as CPU
    unbound. That means it will try to run on the local CPU but it may run
    on another CPU as well. Especially with CONFIG_DEBUG_WQ_FORCE_RR_CPU=y.
    Again, the preempt_disable() won't work here but lock which was
    introduced will help.
    In order to keep work-item on the local CPU (and avoid RR) I changed it
    to queue_work_on().
    
    Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Sebastian Andrzej Siewior authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    e81cff1 View commit details
    Browse the repository at this point in the history
  4. mfd: cros ec: spi: Don't send first message too soon

    commit 15d8374 upstream.
    
    On the Tegra124 Nyan-Big chromebook the very first SPI message sent to
    the EC is failing.
    
    The Tegra SPI driver configures the SPI chip-selects to be active-high
    by default (and always has for many years). The EC SPI requires an
    active-low chip-select and so the Tegra chip-select is reconfigured to
    be active-low when the EC SPI driver calls spi_setup(). The problem is
    that if the first SPI message to the EC is sent too soon after
    reconfiguring the SPI chip-select, it fails.
    
    The EC SPI driver prevents back-to-back SPI messages being sent too
    soon by keeping track of the time the last transfer was sent via the
    variable 'last_transfer_ns'. To prevent the very first transfer being
    sent too soon, initialise the 'last_transfer_ns' variable after calling
    spi_setup() and before sending the first SPI message.
    
    Signed-off-by: Jon Hunter <[email protected]>
    Reviewed-by: Brian Norris <[email protected]>
    Reviewed-by: Douglas Anderson <[email protected]>
    Acked-by: Benson Leung <[email protected]>
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jonhunter authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    2db85cb View commit details
    Browse the repository at this point in the history
  5. mfd: twl4030-audio: Fix sibling-node lookup

    commit 0a42377 upstream.
    
    A helper purported to look up a child node based on its name was using
    the wrong of-helper and ended up prematurely freeing the parent of-node
    while leaking any matching node.
    
    To make things worse, any matching node would not even necessarily be a
    child node as the whole device tree was searched depth-first starting at
    the parent.
    
    Fixes: 019a7e6 ("mfd: twl4030-audio: Add DT support")
    Signed-off-by: Johan Hovold <[email protected]>
    Acked-by: Peter Ujfalusi <[email protected]>
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    f4c0796 View commit details
    Browse the repository at this point in the history
  6. mfd: twl6040: Fix child-node lookup

    commit 85e9b13 upstream.
    
    Fix child-node lookup during probe, which ended up searching the whole
    device tree depth-first starting at the parent rather than just matching
    on its children.
    
    To make things worse, the parent node was prematurely freed, while the
    child node was leaked.
    
    Note that the CONFIG_OF compile guard can be removed as
    of_get_child_by_name() provides a !CONFIG_OF implementation which always
    fails.
    
    Fixes: 37e13ce ("mfd: Add support for Device Tree to twl6040")
    Fixes: ca2cad6 ("mfd: Fix twl6040 build failure")
    Signed-off-by: Johan Hovold <[email protected]>
    Acked-by: Peter Ujfalusi <[email protected]>
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    becf7d8 View commit details
    Browse the repository at this point in the history
  7. ALSA: rawmidi: Avoid racy info ioctl via ctl device

    commit c1cfd90 upstream.
    
    The rawmidi also allows to obtaining the information via ioctl of ctl
    API.  It means that user can issue an ioctl to the rawmidi device even
    when it's being removed as long as the control device is present.
    Although the code has some protection via the global register_mutex,
    its range is limited to the search of the corresponding rawmidi
    object, and the mutex is already unlocked at accessing the rawmidi
    object.  This may lead to a use-after-free.
    
    For avoiding it, this patch widens the application of register_mutex
    to the whole snd_rawmidi_info_select() function.  We have another
    mutex per rawmidi object, but this operation isn't very hot path, so
    it shouldn't matter from the performance POV.
    
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    cec9244 View commit details
    Browse the repository at this point in the history
  8. ALSA: usb-audio: Add native DSD support for Esoteric D-05X

    commit 866f7ed upstream.
    
    Adds VID:PID of Esoteric D-05X to the TEAC device id's.
    Renames the is_teac_50X_dac() function to is_teac_dsd_dac() to cover
    broader device family from the same corporation sharing the same USB
    audio implementation.
    
    Signed-off-by: Jussi Laako <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jlaako authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    beab14a View commit details
    Browse the repository at this point in the history
  9. ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU

    commit 5a15f28 upstream.
    
    The commit 89b89d1 ("ALSA: usb-audio: Add check return value for
    usb_string()") added the check of the return value from
    snd_usb_copy_string_desc(), which is correct per se, but it introduced
    a regression.  In the original code, either the "Clock Source",
    "Playback Source" or "Capture Source" suffix is added after the
    terminal string, while the commit changed it to add the suffix only
    when get_term_name() is failing.  It ended up with an incorrect ctl
    name like "PCM" instead of "PCM Capture Source".
    
    Also, even the original code has a similar bug: when the ctl name is
    generated from snd_usb_copy_string_desc() for the given iSelector, it
    also doesn't put the suffix.
    
    This patch addresses these issues: the suffix is added always when no
    static mapping is found.  Also the patch tries to put more comments
    and cleans up the if/else block for better readability in order to
    avoid the same pitfall again.
    
    Fixes: 89b89d1 ("ALSA: usb-audio: Add check return value for usb_string()")
    Reported-and-tested-by: Mauro Santos <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    3176065 View commit details
    Browse the repository at this point in the history
  10. PCI / PM: Force devices to D0 in pci_pm_thaw_noirq()

    commit 5839ee7 upstream.
    
    It is incorrect to call pci_restore_state() for devices in low-power
    states (D1-D3), as that involves the restoration of MSI setup which
    requires MMIO to be operational and that is only the case in D0.
    
    However, pci_pm_thaw_noirq() may do that if the driver's "freeze"
    callbacks put the device into a low-power state, so fix it by making
    it force devices into D0 via pci_set_power_state() instead of trying
    to "update" their power state which is pointless.
    
    Fixes: e60514b (PCI/PM: Restore the status of PCI devices across hibernation)
    Reported-by: Thomas Gleixner <[email protected]>
    Reported-by: Maarten Lankhorst <[email protected]>
    Tested-by: Thomas Gleixner <[email protected]>
    Tested-by: Maarten Lankhorst <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Acked-by: Bjorn Helgaas <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rafaeljw authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    10b4a62 View commit details
    Browse the repository at this point in the history
  11. parisc: Hide Diva-built-in serial aux and graphics card

    commit bcf3f17 upstream.
    
    Diva GSP card has built-in serial AUX port and ATI graphic card which simply
    don't work and which both don't have external connectors.  User Guides even
    mention that those devices shouldn't be used.
    So, prevent that Linux drivers try to enable those devices.
    
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hdeller authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    373386e View commit details
    Browse the repository at this point in the history
  12. spi: xilinx: Detect stall with Unknown commands

    commit 5a1314f upstream.
    
    When the core is configured in C_SPI_MODE > 0, it integrates a
    lookup table that automatically configures the core in dual or quad mode
    based on the command (first byte on the tx fifo).
    
    Unfortunately, that list mode_?_memoy_*.mif does not contain all the
    supported commands by the flash.
    
    Since 4.14 spi-nor automatically tries to probe the flash using SFDP
    (command 0x5a), and that command is not part of the list_mode table.
    
    Whit the right combination of C_SPI_MODE and C_SPI_MEMORY this leads
    into a stall that can only be recovered with a soft rest.
    
    This patch detects this kind of stall and returns -EIO to the caller on
    those commands. spi-nor can handle this error properly:
    
    m25p80 spi0.0: Detected stall. Check C_SPI_MODE and C_SPI_MEMORY. 0x21 0x2404
    m25p80 spi0.0: SPI transfer failed: -5
    spi_master spi0: failed to transfer one message from queue
    m25p80 spi0.0: s25sl064p (8192 Kbytes)
    
    Signed-off-by: Ricardo Ribalda Delgado <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ribalda authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    cb8b2fd View commit details
    Browse the repository at this point in the history
  13. pinctrl: cherryview: Mask all interrupts on Intel_Strago based systems

    commit d2b3c35 upstream.
    
    Guenter Roeck reported an interrupt storm on a prototype system which is
    based on Cyan Chromebook. The root cause turned out to be a incorrectly
    configured pin that triggers spurious interrupts. This will be fixed in
    coreboot but currently we need to prevent the interrupt storm from
    happening by masking all interrupts (but not GPEs) on those systems.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=197953
    Fixes: bcb48cc ("pinctrl: cherryview: Do not mask all interrupts in probe")
    Reported-and-tested-by: Guenter Roeck <[email protected]>
    Reported-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Mika Westerberg <[email protected]>
    Signed-off-by: Linus Walleij <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    westeri authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    418dfce View commit details
    Browse the repository at this point in the history
  14. KVM: X86: Fix load RFLAGS w/o the fixed bit

    commit d73235d upstream.
    
     *** Guest State ***
     CR0: actual=0x0000000000000030, shadow=0x0000000060000010, gh_mask=fffffffffffffff7
     CR4: actual=0x0000000000002050, shadow=0x0000000000000000, gh_mask=ffffffffffffe871
     CR3 = 0x00000000fffbc000
     RSP = 0x0000000000000000  RIP = 0x0000000000000000
     RFLAGS=0x00000000         DR7 = 0x0000000000000400
            ^^^^^^^^^^
    
    The failed vmentry is triggered by the following testcase when ept=Y:
    
        #include <unistd.h>
        #include <sys/syscall.h>
        #include <string.h>
        #include <stdint.h>
        #include <linux/kvm.h>
        #include <fcntl.h>
        #include <sys/ioctl.h>
    
        long r[5];
        int main()
        {
        	r[2] = open("/dev/kvm", O_RDONLY);
        	r[3] = ioctl(r[2], KVM_CREATE_VM, 0);
        	r[4] = ioctl(r[3], KVM_CREATE_VCPU, 7);
        	struct kvm_regs regs = {
        		.rflags = 0,
        	};
        	ioctl(r[4], KVM_SET_REGS, &regs);
        	ioctl(r[4], KVM_RUN, 0);
        }
    
    X86 RFLAGS bit 1 is fixed set, userspace can simply clearing bit 1
    of RFLAGS with KVM_SET_REGS ioctl which results in vmentry fails.
    This patch fixes it by oring X86_EFLAGS_FIXED during ioctl.
    
    Suggested-by: Jim Mattson <[email protected]>
    Reviewed-by: David Hildenbrand <[email protected]>
    Reviewed-by: Quan Xu <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Cc: Radim Krčmář <[email protected]>
    Cc: Jim Mattson <[email protected]>
    Signed-off-by: Wanpeng Li <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Wanpeng Li authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    e5c73b3 View commit details
    Browse the repository at this point in the history
  15. kvm: x86: fix RSM when PCID is non-zero

    commit fae1a3e upstream.
    
    rsm_load_state_64() and rsm_enter_protected_mode() load CR3, then
    CR4 & ~PCIDE, then CR0, then CR4.
    
    However, setting CR4.PCIDE fails if CR3[11:0] != 0.  It's probably easier
    in the long run to replace rsm_enter_protected_mode() with an emulator
    callback that sets all the special registers (like KVM_SET_SREGS would
    do).  For now, set the PCID field of CR3 only after CR4.PCIDE is 1.
    
    Reported-by: Laszlo Ersek <[email protected]>
    Tested-by: Laszlo Ersek <[email protected]>
    Fixes: 660a5d5
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    bonzini authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    18276e9 View commit details
    Browse the repository at this point in the history
  16. clk: sunxi: sun9i-mmc: Implement reset callback for reset controls

    commit 61d2f2a upstream.
    
    Our MMC host driver now issues a reset, instead of just deasserting
    the reset control, since commit c34eda6 ("mmc: sunxi: Reset the
    device at probe time"). The sun9i-mmc clock driver does not support
    this, and will fail, which results in MMC not probing.
    
    This patch implements the reset callback by asserting the reset control,
    then deasserting it after a small delay.
    
    Fixes: 7a6fca8 ("clk: sunxi: Add driver for A80 MMC config clocks/resets")
    Signed-off-by: Chen-Yu Tsai <[email protected]>
    Acked-by: Philipp Zabel <[email protected]>
    Acked-by: Maxime Ripard <[email protected]>
    Signed-off-by: Michael Turquette <[email protected]>
    Link: lkml.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    wens authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    2635a64 View commit details
    Browse the repository at this point in the history
  17. powerpc/perf: Dereference BHRB entries safely

    commit f41d84d upstream.
    
    It's theoretically possible that branch instructions recorded in
    BHRB (Branch History Rolling Buffer) entries have already been
    unmapped before they are processed by the kernel. Hence, trying to
    dereference such memory location will result in a crash. eg:
    
        Unable to handle kernel paging request for data at address 0xd000000019c41764
        Faulting instruction address: 0xc000000000084a14
        NIP [c000000000084a14] branch_target+0x4/0x70
        LR [c0000000000eb828] record_and_restart+0x568/0x5c0
        Call Trace:
        [c0000000000eb3b4] record_and_restart+0xf4/0x5c0 (unreliable)
        [c0000000000ec378] perf_event_interrupt+0x298/0x460
        [c000000000027964] performance_monitor_exception+0x54/0x70
        [c000000000009ba4] performance_monitor_common+0x114/0x120
    
    Fix it by deferefencing the addresses safely.
    
    Fixes: 6912318 ("powerpc/perf: Fix setting of "to" addresses for BHRB")
    Suggested-by: Naveen N. Rao <[email protected]>
    Signed-off-by: Ravi Bangoria <[email protected]>
    Reviewed-by: Naveen N. Rao <[email protected]>
    [mpe: Use probe_kernel_read() which is clearer, tweak change log]
    Signed-off-by: Michael Ellerman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Ravi Bangoria authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    77b318a View commit details
    Browse the repository at this point in the history
  18. libnvdimm, pfn: fix start_pad handling for aligned namespaces

    commit 19deaa2 upstream.
    
    The alignment checks at pfn driver startup fail to properly account for
    the 'start_pad' in the case where the namespace is misaligned relative
    to its internal alignment. This is typically triggered in 1G aligned
    namespace, but could theoretically trigger with small namespace
    alignments. When this triggers the kernel reports messages of the form:
    
        dax2.1: bad offset: 0x3c000000 dax disabled align: 0x40000000
    
    Fixes: 1ee6667 ("libnvdimm, pfn, dax: fix initialization vs autodetect...")
    Reported-by: Jane Chu <[email protected]>
    Signed-off-by: Dan Williams <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    djbw authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    423716c View commit details
    Browse the repository at this point in the history
  19. net: mvneta: clear interface link status on port disable

    commit 4423c18 upstream.
    
    When port connect to PHY in polling mode (with poll interval 1 sec),
    port and phy link status must be synchronize in order don't loss link
    change event.
    
    [[email protected]: add fixes tag]
    Fixes: c5aff18 ("net: mvneta: driver for Marvell Armada 370/XP network unit")
    Signed-off-by: Yelena Krivosheev <[email protected]>
    Tested-by: Dmitri Epshtein <[email protected]>
    Signed-off-by: Gregory CLEMENT <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    yelenaKr authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    405f3d7 View commit details
    Browse the repository at this point in the history
  20. net: mvneta: use proper rxq_number in loop on rx queues

    commit ca5902a upstream.
    
    When adding the RX queue association with each CPU, a typo was made in
    the mvneta_cleanup_rxqs() function. This patch fixes it.
    
    [[email protected]: add commit log and fixes tag]
    Fixes: 2dcf75e ("net: mvneta: Associate RX queues with each CPU")
    Signed-off-by: Yelena Krivosheev <[email protected]>
    Tested-by: Dmitri Epshtein <[email protected]>
    Signed-off-by: Gregory CLEMENT <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    yelenaKr authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    a57f99f View commit details
    Browse the repository at this point in the history
  21. net: mvneta: eliminate wrong call to handle rx descriptor error

    commit 2eecb2e upstream.
    
    There are few reasons in mvneta_rx_swbm() function when received packet
    is dropped. mvneta_rx_error() should be called only if error bit [16]
    is set in rx descriptor.
    
    [[email protected]: add fixes tag]
    Fixes: dc35a10 ("net: mvneta: bm: add support for hardware buffer management")
    Signed-off-by: Yelena Krivosheev <[email protected]>
    Tested-by: Dmitri Epshtein <[email protected]>
    Signed-off-by: Gregory CLEMENT <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    yelenaKr authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    69cf72b View commit details
    Browse the repository at this point in the history
  22. bpf/verifier: Fix states_equal() comparison of pointer and UNKNOWN

    An UNKNOWN_VALUE is not supposed to be derived from a pointer, unless
    pointer leaks are allowed.  Therefore, states_equal() must not treat
    a state with a pointer in a register as "equal" to a state with an
    UNKNOWN_VALUE in that register.
    
    This was fixed differently upstream, but the code around here was
    largely rewritten in 4.14 by commit f1174f7 "bpf/verifier: rework
    value tracking".  The bug can be detected by the bpf/verifier sub-test
    "pointer/scalar confusion in state equality check (way 1)".
    
    Signed-off-by: Ben Hutchings <[email protected]>
    Cc: Edward Cree <[email protected]>
    Cc: Jann Horn <[email protected]>
    Cc: Alexei Starovoitov <[email protected]>
    Cc: Daniel Borkmann <[email protected]>
    bwhacks authored and gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    37435f7 View commit details
    Browse the repository at this point in the history
  23. Linux 4.9.73

    gregkh committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    b3e8821 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2018

  1. sync objtool's copy of x86-opcode-map.txt

    When building objtool, we get the warning:
    	warning: objtool: x86 instruction decoder differs from kernel
    
    That's due to commit 2816c04 which was
    commit 12a78d4 upstream that modified
    arch/x86/lib/x86-opcode-map.txt without also updating the objtool copy.
    The objtool copy was updated in a much larger patch upstream, but we
    don't need all of that here, so just update the single file.
    
    If this gets too annoying, I'll just end up doing what we did for 4.14
    and backport the whole series to keep this from happening again, but as
    this seems to be rare in the 4.9-stable series, this single patch should
    be fine.
    
    Cc: Masami Hiramatsu <[email protected]>
    Cc: H. Peter Anvin <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Cc: Ingo Molnar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    3d16a13 View commit details
    Browse the repository at this point in the history
  2. tracing: Remove extra zeroing out of the ring buffer page

    commit 6b7e633 upstream.
    
    The ring_buffer_read_page() takes care of zeroing out any extra data in the
    page that it returns. There's no need to zero it out again from the
    consumer. It was removed from one consumer of this function, but
    read_buffers_splice_read() did not remove it, and worse, it contained a
    nasty bug because of it.
    
    Fixes: 2711ca2 ("ring-buffer: Move zeroing out excess in page to ring buffer code")
    Signed-off-by: Steven Rostedt (VMware) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rostedt authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    6edea15 View commit details
    Browse the repository at this point in the history
  3. tracing: Fix possible double free on failure of allocating trace buffer

    commit 4397f04 upstream.
    
    Jing Xia and Chunyan Zhang reported that on failing to allocate part of the
    tracing buffer, memory is freed, but the pointers that point to them are not
    initialized back to NULL, and later paths may try to free the freed memory
    again. Jing and Chunyan fixed one of the locations that does this, but
    missed a spot.
    
    Link: http://lkml.kernel.org/r/[email protected]
    
    Fixes: 737223f ("tracing: Consolidate buffer allocation code")
    Reported-by: Jing Xia <[email protected]>
    Reported-by: Chunyan Zhang <[email protected]>
    Signed-off-by: Steven Rostedt (VMware) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rostedt authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    5dc4cd2 View commit details
    Browse the repository at this point in the history
  4. tracing: Fix crash when it fails to alloc ring buffer

    commit 24f2aaf upstream.
    
    Double free of the ring buffer happens when it fails to alloc new
    ring buffer instance for max_buffer if TRACER_MAX_TRACE is configured.
    The root cause is that the pointer is not set to NULL after the buffer
    is freed in allocate_trace_buffers(), and the freeing of the ring
    buffer is invoked again later if the pointer is not equal to Null,
    as:
    
    instance_mkdir()
        |-allocate_trace_buffers()
            |-allocate_trace_buffer(tr, &tr->trace_buffer...)
    	|-allocate_trace_buffer(tr, &tr->max_buffer...)
    
              // allocate fail(-ENOMEM),first free
              // and the buffer pointer is not set to null
            |-ring_buffer_free(tr->trace_buffer.buffer)
    
           // out_free_tr
        |-free_trace_buffers()
            |-free_trace_buffer(&tr->trace_buffer);
    
    	      //if trace_buffer is not null, free again
    	    |-ring_buffer_free(buf->buffer)
                    |-rb_free_cpu_buffer(buffer->buffers[cpu])
                        // ring_buffer_per_cpu is null, and
                        // crash in ring_buffer_per_cpu->pages
    
    Link: http://lkml.kernel.org/r/[email protected]
    
    Fixes: 737223f ("tracing: Consolidate buffer allocation code")
    Signed-off-by: Jing Xia <[email protected]>
    Signed-off-by: Chunyan Zhang <[email protected]>
    Signed-off-by: Steven Rostedt (VMware) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Jing Xia authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    81e155e View commit details
    Browse the repository at this point in the history
  5. ring-buffer: Mask out the info bits when returning buffer page length

    commit 45d8b80 upstream.
    
    Two info bits were added to the "commit" part of the ring buffer data page
    when returned to be consumed. This was to inform the user space readers that
    events have been missed, and that the count may be stored at the end of the
    page.
    
    What wasn't handled, was the splice code that actually called a function to
    return the length of the data in order to zero out the rest of the page
    before sending it up to user space. These data bits were returned with the
    length making the value negative, and that negative value was not checked.
    It was compared to PAGE_SIZE, and only used if the size was less than
    PAGE_SIZE. Luckily PAGE_SIZE is unsigned long which made the compare an
    unsigned compare, meaning the negative size value did not end up causing a
    large portion of memory to be randomly zeroed out.
    
    Fixes: 66a8cb9 ("ring-buffer: Add place holder recording of dropped events")
    Signed-off-by: Steven Rostedt (VMware) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rostedt authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    2e0d458 View commit details
    Browse the repository at this point in the history
  6. iw_cxgb4: Only validate the MSN for successful completions

    commit f55688c upstream.
    
    If the RECV CQE is in error, ignore the MSN check.  This was causing
    recvs that were flushed into the sw cq to be completed with the wrong
    status (BAD_MSN instead of FLUSHED).
    
    Signed-off-by: Steve Wise <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Steve Wise authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    72d5e02 View commit details
    Browse the repository at this point in the history
  7. ASoC: wm_adsp: Fix validation of firmware and coeff lengths

    commit 50dd2ea upstream.
    
    The checks for whether another region/block header could be present
    are subtracting the size from the current offset.  Obviously we should
    instead subtract the offset from the size.
    
    The checks for whether the region/block data fit in the file are
    adding the data size to the current offset and header size, without
    checking for integer overflow.  Rearrange these so that overflow is
    impossible.
    
    Signed-off-by: Ben Hutchings <[email protected]>
    Acked-by: Charles Keepax <[email protected]>
    Tested-by: Charles Keepax <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    bwh-ct authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    125e81b View commit details
    Browse the repository at this point in the history
  8. ASoC: da7218: fix fix child-node lookup

    commit bc6476d upstream.
    
    Fix child-node lookup during probe, which ended up searching the whole
    device tree depth-first starting at the parent rather than just matching
    on its children.
    
    To make things worse, the parent codec node was also prematurely freed.
    
    Fixes: 4d50934 ("ASoC: da7218: Add da7218 codec driver")
    Signed-off-by: Johan Hovold <[email protected]>
    Acked-by: Adam Thomson <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    35f87d4 View commit details
    Browse the repository at this point in the history
  9. ASoC: fsl_ssi: AC'97 ops need regmap, clock and cleaning up on failure

    commit 695b78b upstream.
    
    AC'97 ops (register read / write) need SSI regmap and clock, so they have
    to be set after them.
    
    We also need to set these ops back to NULL if we fail the probe.
    
    Signed-off-by: Maciej S. Szmigiero <[email protected]>
    Acked-by: Nicolin Chen <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    maciejsszmigiero authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    00add00 View commit details
    Browse the repository at this point in the history
  10. ASoC: twl4030: fix child-node lookup

    commit 15f8c5f upstream.
    
    Fix child-node lookup during probe, which ended up searching the whole
    device tree depth-first starting at the parent rather than just matching
    on its children.
    
    To make things worse, the parent codec node was also prematurely freed,
    while the child node was leaked.
    
    Fixes: 2d6d649 ("ASoC: twl4030: Support for DT booted kernel")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    b04640a View commit details
    Browse the repository at this point in the history
  11. ASoC: tlv320aic31xx: Fix GPIO1 register definition

    commit 737e0b7 upstream.
    
    GPIO1 control register is number 51, fix this here.
    
    Fixes: bafcbfe ("ASoC: tlv320aic31xx: Make the register values human readable")
    Signed-off-by: Andrew F. Davis <[email protected]>
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    glneo authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    d30d176 View commit details
    Browse the repository at this point in the history
  12. ALSA: hda: Drop useless WARN_ON()

    commit a36c263 upstream.
    
    Since the commit 97cc2ed ("ALSA: hda - Fix yet another i915
    pointer leftover in error path") cleared hdac_acomp pointer, the
    WARN_ON() non-NULL check in snd_hdac_i915_register_notifier() may give
    a false-positive warning, as the function gets called no matter
    whether the component is registered or not.  For fixing it, let's get
    rid of the spurious WARN_ON().
    
    Fixes: 97cc2ed ("ALSA: hda - Fix yet another i915 pointer leftover in error path")
    Reported-by: Kouta Okamoto <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tiwai authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    a1dbcd8 View commit details
    Browse the repository at this point in the history
  13. ALSA: hda - fix headset mic detection issue on a Dell machine

    commit 285d5dd upstream.
    
    It has the codec alc256, and add its pin definition to pin quirk
    table to let it apply ALC255_FIXUP_DELL1_MIC_NO_PRESENCE.
    
    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 Jan 2, 2018
    Configuration menu
    Copy the full SHA
    65ca46e View commit details
    Browse the repository at this point in the history
  14. x86/vm86/32: Switch to flush_tlb_mm_range() in mark_screen_rdonly()

    commit 9ccee23 upstream.
    
    mark_screen_rdonly() is the last remaining caller of flush_tlb().
    flush_tlb_mm_range() is potentially faster and isn't obsolete.
    
    Compile-tested only because I don't know whether software that uses
    this mechanism even exists.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Brian Gerst <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Denys Vlasenko <[email protected]>
    Cc: H. Peter Anvin <[email protected]>
    Cc: Josh Poimboeuf <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Nadav Amit <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Sasha Levin <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Link: http://lkml.kernel.org/r/791a644076fc3577ba7f7b7cafd643cc089baa7d.1492844372.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    72b812d View commit details
    Browse the repository at this point in the history
  15. x86/mm: Remove flush_tlb() and flush_tlb_current_task()

    commit 29961b5 upstream.
    
    I was trying to figure out what how flush_tlb_current_task() would
    possibly work correctly if current->mm != current->active_mm, but I
    realized I could spare myself the effort: it has no callers except
    the unused flush_tlb() macro.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Brian Gerst <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Denys Vlasenko <[email protected]>
    Cc: H. Peter Anvin <[email protected]>
    Cc: Josh Poimboeuf <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Nadav Amit <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Link: http://lkml.kernel.org/r/e52d64c11690f85e9f1d69d7b48cc2269cd2e94b.1492844372.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    219aced View commit details
    Browse the repository at this point in the history
  16. x86/mm: Make flush_tlb_mm_range() more predictable

    commit ce27374 upstream.
    
    I'm about to rewrite the function almost completely, but first I
    want to get a functional change out of the way.  Currently, if
    flush_tlb_mm_range() does not flush the local TLB at all, it will
    never do individual page flushes on remote CPUs.  This seems to be
    an accident, and preserving it will be awkward.  Let's change it
    first so that any regressions in the rewrite will be easier to
    bisect and so that the rewrite can attempt to change no visible
    behavior at all.
    
    The fix is simple: we can simply avoid short-circuiting the
    calculation of base_pages_to_flush.
    
    As a side effect, this also eliminates a potential corner case: if
    tlb_single_page_flush_ceiling == TLB_FLUSH_ALL, flush_tlb_mm_range()
    could have ended up flushing the entire address space one page at a
    time.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Acked-by: Dave Hansen <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Brian Gerst <[email protected]>
    Cc: Denys Vlasenko <[email protected]>
    Cc: H. Peter Anvin <[email protected]>
    Cc: Josh Poimboeuf <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Nadav Amit <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Link: http://lkml.kernel.org/r/4b29b771d9975aad7154c314534fec235618175a.1492844372.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    113980c View commit details
    Browse the repository at this point in the history
  17. x86/mm: Reimplement flush_tlb_page() using flush_tlb_mm_range()

    commit ca6c99c upstream.
    
    flush_tlb_page() was very similar to flush_tlb_mm_range() except that
    it had a couple of issues:
    
     - It was missing an smp_mb() in the case where
       current->active_mm != mm.  (This is a longstanding bug reported by Nadav Amit)
    
     - It was missing tracepoints and vm counter updates.
    
    The only reason that I can see for keeping it at as a separate
    function is that it could avoid a few branches that
    flush_tlb_mm_range() needs to decide to flush just one page.  This
    hardly seems worthwhile.  If we decide we want to get rid of those
    branches again, a better way would be to introduce an
    __flush_tlb_mm_range() helper and make both flush_tlb_page() and
    flush_tlb_mm_range() use it.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Acked-by: Kees Cook <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Mel Gorman <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Nadav Amit <[email protected]>
    Cc: Nadav Amit <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Link: http://lkml.kernel.org/r/3cc3847cf888d8907577569b8bac3f01992ef8f9.1495492063.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    a94af05 View commit details
    Browse the repository at this point in the history
  18. x86/mm: Remove the UP asm/tlbflush.h code, always use the (formerly) …

    …SMP code
    
    commit ce4a4e5 upstream.
    
    The UP asm/tlbflush.h generates somewhat nicer code than the SMP version.
    Aside from that, it's fallen quite a bit behind the SMP code:
    
     - flush_tlb_mm_range() didn't flush individual pages if the range
       was small.
    
     - The lazy TLB code was much weaker.  This usually wouldn't matter,
       but, if a kernel thread flushed its lazy "active_mm" more than
       once (due to reclaim or similar), it wouldn't be unlazied and
       would instead pointlessly flush repeatedly.
    
     - Tracepoints were missing.
    
    Aside from that, simply having the UP code around was a maintanence
    burden, since it means that any change to the TLB flush code had to
    make sure not to break it.
    
    Simplify everything by deleting the UP code.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Arjan van de Ven <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Mel Gorman <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Nadav Amit <[email protected]>
    Cc: Nadav Amit <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    3e5daac View commit details
    Browse the repository at this point in the history
  19. x86/mm: Disable PCID on 32-bit kernels

    commit cba4671 upstream.
    
    32-bit kernels on new hardware will see PCID in CPUID, but PCID can
    only be used in 64-bit mode.  Rather than making all PCID code
    conditional, just disable the feature on 32-bit builds.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Reviewed-by: Nadav Amit <[email protected]>
    Reviewed-by: Borislav Petkov <[email protected]>
    Reviewed-by: Thomas Gleixner <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Arjan van de Ven <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Mel Gorman <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: [email protected]
    Link: http://lkml.kernel.org/r/2e391769192a4d31b808410c383c6bf0734bc6ea.1498751203.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    1e7f3d8 View commit details
    Browse the repository at this point in the history
  20. x86/mm: Add the 'nopcid' boot option to turn off PCID

    commit 0790c9a upstream.
    
    The parameter is only present on x86_64 systems to save a few bytes,
    as PCID is always disabled on x86_32.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Reviewed-by: Nadav Amit <[email protected]>
    Reviewed-by: Borislav Petkov <[email protected]>
    Reviewed-by: Thomas Gleixner <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Arjan van de Ven <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Mel Gorman <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: [email protected]
    Link: http://lkml.kernel.org/r/8bbb2e65bcd249a5f18bfb8128b4689f08ac2b60.1498751203.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    e6a2932 View commit details
    Browse the repository at this point in the history
  21. x86/mm: Enable CR4.PCIDE on supported systems

    commit 660da7c upstream.
    
    We can use PCID if the CPU has PCID and PGE and we're not on Xen.
    
    By itself, this has no effect. A followup patch will start using PCID.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Reviewed-by: Nadav Amit <[email protected]>
    Reviewed-by: Boris Ostrovsky <[email protected]>
    Reviewed-by: Thomas Gleixner <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: Arjan van de Ven <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Juergen Gross <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Mel Gorman <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: [email protected]
    Link: http://lkml.kernel.org/r/6327ecd907b32f79d5aa0d466f04503bbec5df88.1498751203.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    b52f937 View commit details
    Browse the repository at this point in the history
  22. x86/mm/64: Fix reboot interaction with CR4.PCIDE

    commit 924c6b9 upstream.
    
    Trying to reboot via real mode fails with PCID on: long mode cannot
    be exited while CR4.PCIDE is set.  (No, I have no idea why, but the
    SDM and actual CPUs are in agreement here.)  The result is a GPF and
    a hang instead of a reboot.
    
    I didn't catch this in testing because neither my computer nor my VM
    reboots this way.  I can trigger it with reboot=bios, though.
    
    Fixes: 660da7c ("x86/mm: Enable CR4.PCIDE on supported systems")
    Reported-and-tested-by: Steven Rostedt (VMware) <[email protected]>
    Signed-off-by: Andy Lutomirski <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Link: https://lkml.kernel.org/r/f1e7d965998018450a7a70c2823873686a8b21c0.1507524746.git.luto@kernel.org
    Cc: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    04bdf71 View commit details
    Browse the repository at this point in the history
  23. kbuild: add '-fno-stack-check' to kernel build options

    commit 3ce120b upstream.
    
    It appears that hardened gentoo enables "-fstack-check" by default for
    gcc.
    
    That doesn't work _at_all_ for the kernel, because the kernel stack
    doesn't act like a user stack at all: it's much smaller, and it doesn't
    auto-expand on use.  So the extra "probe one page below the stack" code
    generated by -fstack-check just breaks the kernel in horrible ways,
    causing infinite double faults etc.
    
    [ I have to say, that the particular code gcc generates looks very
      stupid even for user space where it works, but that's a separate
      issue.  ]
    
    Reported-and-tested-by: Alexander Tsoy <[email protected]>
    Reported-and-tested-by: Toralf Förster <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Jiri Kosina <[email protected]>
    Cc: Andy Lutomirski <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    torvalds authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    b929ccc View commit details
    Browse the repository at this point in the history
  24. ipv4: igmp: guard against silly MTU values

    [ Upstream commit b547602 ]
    
    IPv4 stack reacts to changes to small MTU, by disabling itself under
    RTNL.
    
    But there is a window where threads not using RTNL can see a wrong
    device mtu. This can lead to surprises, in igmp code where it is
    assumed the mtu is suitable.
    
    Fix this by reading device mtu once and checking IPv4 minimal MTU.
    
    This patch adds missing IPV4_MIN_MTU define, to not abuse
    ETH_MIN_MTU anymore.
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    c2f78bf View commit details
    Browse the repository at this point in the history
  25. ipv6: mcast: better catch silly mtu values

    [ Upstream commit b9b312a ]
    
    syzkaller reported crashes in IPv6 stack [1]
    
    Xin Long found that lo MTU was set to silly values.
    
    IPv6 stack reacts to changes to small MTU, by disabling itself under
    RTNL.
    
    But there is a window where threads not using RTNL can see a wrong
    device mtu. This can lead to surprises, in mld code where it is assumed
    the mtu is suitable.
    
    Fix this by reading device mtu once and checking IPv6 minimal MTU.
    
    [1]
     skbuff: skb_over_panic: text:0000000010b86b8d len:196 put:20
     head:000000003b477e60 data:000000000e85441e tail:0xd4 end:0xc0 dev:lo
     ------------[ cut here ]------------
     kernel BUG at net/core/skbuff.c:104!
     invalid opcode: 0000 [Freescale#1] SMP KASAN
     Dumping ftrace buffer:
        (ftrace buffer empty)
     Modules linked in:
     CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.15.0-rc2-mm1+ Freescale#39
     Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
     Google 01/01/2011
     RIP: 0010:skb_panic+0x15c/0x1f0 net/core/skbuff.c:100
     RSP: 0018:ffff8801db307508 EFLAGS: 00010286
     RAX: 0000000000000082 RBX: ffff8801c517e840 RCX: 0000000000000000
     RDX: 0000000000000082 RSI: 1ffff1003b660e61 RDI: ffffed003b660e95
     RBP: ffff8801db307570 R08: 1ffff1003b660e23 R09: 0000000000000000
     R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff85bd4020
     R13: ffffffff84754ed2 R14: 0000000000000014 R15: ffff8801c4e26540
     FS:  0000000000000000(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 0000000000463610 CR3: 00000001c6698000 CR4: 00000000001406e0
     DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
     DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
     Call Trace:
      <IRQ>
      skb_over_panic net/core/skbuff.c:109 [inline]
      skb_put+0x181/0x1c0 net/core/skbuff.c:1694
      add_grhead.isra.24+0x42/0x3b0 net/ipv6/mcast.c:1695
      add_grec+0xa55/0x1060 net/ipv6/mcast.c:1817
      mld_send_cr net/ipv6/mcast.c:1903 [inline]
      mld_ifc_timer_expire+0x4d2/0x770 net/ipv6/mcast.c:2448
      call_timer_fn+0x23b/0x840 kernel/time/timer.c:1320
      expire_timers kernel/time/timer.c:1357 [inline]
      __run_timers+0x7e1/0xb60 kernel/time/timer.c:1660
      run_timer_softirq+0x4c/0xb0 kernel/time/timer.c:1686
      __do_softirq+0x29d/0xbb2 kernel/softirq.c:285
      invoke_softirq kernel/softirq.c:365 [inline]
      irq_exit+0x1d3/0x210 kernel/softirq.c:405
      exiting_irq arch/x86/include/asm/apic.h:540 [inline]
      smp_apic_timer_interrupt+0x16b/0x700 arch/x86/kernel/apic/apic.c:1052
      apic_timer_interrupt+0xa9/0xb0 arch/x86/entry/entry_64.S:920
    
    Signed-off-by: Eric Dumazet <[email protected]>
    Reported-by: syzbot <[email protected]>
    Tested-by: Xin Long <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eric Dumazet authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    f6d7cdb View commit details
    Browse the repository at this point in the history
  26. net: fec: unmap the xmit buffer that are not transferred by DMA

    [ Upstream commit 178e5f5 ]
    
    The enet IP only support 32 bit, it will use swiotlb buffer to do dma
    mapping when xmit buffer DMA memory address is bigger than 4G in i.MX
    platform. After stress suspend/resume test, it will print out:
    
    log:
    [12826.352864] fec 5b040000.ethernet: swiotlb buffer is full (sz: 191 bytes)
    [12826.359676] DMA: Out of SW-IOMMU space for 191 bytes at device 5b040000.ethernet
    [12826.367110] fec 5b040000.ethernet eth0: Tx DMA memory map failed
    
    The issue is that the ready xmit buffers that are dma mapped but DMA still
    don't copy them into fifo, once MAC restart, these DMA buffers are not unmapped.
    So it should check the dma mapping buffer and unmap them.
    
    Signed-off-by: Fugang Duan <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    fugangduan authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    930882f View commit details
    Browse the repository at this point in the history
  27. net: igmp: Use correct source address on IGMPv3 reports

    [ Upstream commit a46182b ]
    
    Closing a multicast socket after the final IPv4 address is deleted
    from an interface can generate a membership report that uses the
    source IP from a different interface.  The following test script, run
    from an isolated netns, reproduces the issue:
    
        #!/bin/bash
    
        ip link add dummy0 type dummy
        ip link add dummy1 type dummy
        ip link set dummy0 up
        ip link set dummy1 up
        ip addr add 10.1.1.1/24 dev dummy0
        ip addr add 192.168.99.99/24 dev dummy1
    
        tcpdump -U -i dummy0 &
        socat EXEC:"sleep 2" \
            UDP4-DATAGRAM:239.101.1.68:8889,ip-add-membership=239.0.1.68:10.1.1.1 &
    
        sleep 1
        ip addr del 10.1.1.1/24 dev dummy0
        sleep 5
        kill %tcpdump
    
    RFC 3376 specifies that the report must be sent with a valid IP source
    address from the destination subnet, or from address 0.0.0.0.  Add an
    extra check to make sure this is the case.
    
    Signed-off-by: Kevin Cernekee <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Kevin Cernekee authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    2c1a0b2 View commit details
    Browse the repository at this point in the history
  28. netlink: Add netns check on taps

    [ Upstream commit 93c6476 ]
    
    Currently, a nlmon link inside a child namespace can observe systemwide
    netlink activity.  Filter the traffic so that nlmon can only sniff
    netlink messages from its own netns.
    
    Test case:
    
        vpnns -- bash -c "ip link add nlmon0 type nlmon; \
                          ip link set nlmon0 up; \
                          tcpdump -i nlmon0 -q -w /tmp/nlmon.pcap -U" &
        sudo ip xfrm state add src 10.1.1.1 dst 10.1.1.2 proto esp \
            spi 0x1 mode transport \
            auth sha1 0x6162633132330000000000000000000000000000 \
            enc aes 0x00000000000000000000000000000000
        grep --binary abc123 /tmp/nlmon.pcap
    
    Signed-off-by: Kevin Cernekee <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Kevin Cernekee authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    0b18782 View commit details
    Browse the repository at this point in the history
  29. net: qmi_wwan: add Sierra EM7565 1199:9091

    [ Upstream commit aceef61 ]
    
    Sierra Wireless EM7565 is an Qualcomm MDM9x50 based M.2 modem.
    The USB id is added to qmi_wwan.c to allow QMI communication
    with the EM7565.
    
    Signed-off-by: Sebastian Sjoholm <[email protected]>
    Acked-by: Bjørn Mork <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ssjoholm authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    8baa58c View commit details
    Browse the repository at this point in the history
  30. net: reevalulate autoflowlabel setting after sysctl setting

    [ Upstream commit 513674b ]
    
    sysctl.ip6.auto_flowlabels is default 1. In our hosts, we set it to 2.
    If sockopt doesn't set autoflowlabel, outcome packets from the hosts are
    supposed to not include flowlabel. This is true for normal packet, but
    not for reset packet.
    
    The reason is ipv6_pinfo.autoflowlabel is set in sock creation. Later if
    we change sysctl.ip6.auto_flowlabels, the ipv6_pinfo.autoflowlabel isn't
    changed, so the sock will keep the old behavior in terms of auto
    flowlabel. Reset packet is suffering from this problem, because reset
    packet is sent from a special control socket, which is created at boot
    time. Since sysctl.ipv6.auto_flowlabels is 1 by default, the control
    socket will always have its ipv6_pinfo.autoflowlabel set, even after
    user set sysctl.ipv6.auto_flowlabels to 1, so reset packset will always
    have flowlabel. Normal sock created before sysctl setting suffers from
    the same issue. We can't even turn off autoflowlabel unless we kill all
    socks in the hosts.
    
    To fix this, if IPV6_AUTOFLOWLABEL sockopt is used, we use the
    autoflowlabel setting from user, otherwise we always call
    ip6_default_np_autolabel() which has the new settings of sysctl.
    
    Note, this changes behavior a little bit. Before commit 4224090
    (ipv6: Implement different admin modes for automatic flow labels), the
    autoflowlabel behavior of a sock isn't sticky, eg, if sysctl changes,
    existing connection will change autoflowlabel behavior. After that
    commit, autoflowlabel behavior is sticky in the whole life of the sock.
    With this patch, the behavior isn't sticky again.
    
    Cc: Martin KaFai Lau <[email protected]>
    Cc: Eric Dumazet <[email protected]>
    Cc: Tom Herbert <[email protected]>
    Signed-off-by: Shaohua Li <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    shligit authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    b3b5603 View commit details
    Browse the repository at this point in the history
  31. ptr_ring: add barriers

    [ Upstream commit a8ceb5d ]
    
    Users of ptr_ring expect that it's safe to give the
    data structure a pointer and have it be available
    to consumers, but that actually requires an smb_wmb
    or a stronger barrier.
    
    In absence of such barriers and on architectures that reorder writes,
    consumer might read an un=initialized value from an skb pointer stored
    in the skb array.  This was observed causing crashes.
    
    To fix, add memory barriers.  The barrier we use is a wmb, the
    assumption being that producers do not need to read the value so we do
    not need to order these reads.
    
    Reported-by: George Cherian <[email protected]>
    Suggested-by: Jason Wang <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    Acked-by: Jason Wang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    mstsirkin authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    8b032bd View commit details
    Browse the repository at this point in the history
  32. RDS: Check cmsg_len before dereferencing CMSG_DATA

    [ Upstream commit 14e138a ]
    
    RDS currently doesn't check if the length of the control message is
    large enough to hold the required data, before dereferencing the control
    message data. This results in following crash:
    
    BUG: KASAN: stack-out-of-bounds in rds_rdma_bytes net/rds/send.c:1013
    [inline]
    BUG: KASAN: stack-out-of-bounds in rds_sendmsg+0x1f02/0x1f90
    net/rds/send.c:1066
    Read of size 8 at addr ffff8801c928fb70 by task syzkaller455006/3157
    
    CPU: 0 PID: 3157 Comm: syzkaller455006 Not tainted 4.15.0-rc3+ Freescale#161
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
    Google 01/01/2011
    Call Trace:
     __dump_stack lib/dump_stack.c:17 [inline]
     dump_stack+0x194/0x257 lib/dump_stack.c:53
     print_address_description+0x73/0x250 mm/kasan/report.c:252
     kasan_report_error mm/kasan/report.c:351 [inline]
     kasan_report+0x25b/0x340 mm/kasan/report.c:409
     __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
     rds_rdma_bytes net/rds/send.c:1013 [inline]
     rds_sendmsg+0x1f02/0x1f90 net/rds/send.c:1066
     sock_sendmsg_nosec net/socket.c:628 [inline]
     sock_sendmsg+0xca/0x110 net/socket.c:638
     ___sys_sendmsg+0x320/0x8b0 net/socket.c:2018
     __sys_sendmmsg+0x1ee/0x620 net/socket.c:2108
     SYSC_sendmmsg net/socket.c:2139 [inline]
     SyS_sendmmsg+0x35/0x60 net/socket.c:2134
     entry_SYSCALL_64_fastpath+0x1f/0x96
    RIP: 0033:0x43fe49
    RSP: 002b:00007fffbe244ad8 EFLAGS: 00000217 ORIG_RAX: 0000000000000133
    RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fe49
    RDX: 0000000000000001 RSI: 000000002020c000 RDI: 0000000000000003
    RBP: 00000000006ca018 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000217 R12: 00000000004017b0
    R13: 0000000000401840 R14: 0000000000000000 R15: 0000000000000000
    
    To fix this, we verify that the cmsg_len is large enough to hold the
    data to be read, before proceeding further.
    
    Reported-by: syzbot <[email protected]>
    Signed-off-by: Avinash Repaka <[email protected]>
    Acked-by: Santosh Shilimkar <[email protected]>
    Reviewed-by: Yuval Shaia <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Avinash Repaka authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    53288d8 View commit details
    Browse the repository at this point in the history
  33. tcp_bbr: record "full bw reached" decision in new full_bw_reached bit

    [ Upstream commit c589e69 ]
    
    This commit records the "full bw reached" decision in a new
    full_bw_reached bit. This is a pure refactor that does not change the
    current behavior, but enables subsequent fixes and improvements.
    
    In particular, this enables simple and clean fixes because the full_bw
    and full_bw_cnt can be unconditionally zeroed without worrying about
    forgetting that we estimated we filled the pipe in Startup. And it
    enables future improvements because multiple code paths can be used
    for estimating that we filled the pipe in Startup; any new code paths
    only need to set this bit when they think the pipe is full.
    
    Note that this fix intentionally reduces the width of the full_bw_cnt
    counter, since we have never used the most significant bit.
    
    Signed-off-by: Neal Cardwell <[email protected]>
    Reviewed-by: Yuchung Cheng <[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]>
    nealcardwell authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    a4bf8ef View commit details
    Browse the repository at this point in the history
  34. tcp md5sig: Use skb's saddr when replying to an incoming segment

    [ Upstream commit 30791ac ]
    
    The MD5-key that belongs to a connection is identified by the peer's
    IP-address. When we are in tcp_v4(6)_reqsk_send_ack(), we are replying
    to an incoming segment from tcp_check_req() that failed the seq-number
    checks.
    
    Thus, to find the correct key, we need to use the skb's saddr and not
    the daddr.
    
    This bug seems to have been there since quite a while, but probably got
    unnoticed because the consequences are not catastrophic. We will call
    tcp_v4_reqsk_send_ack only to send a challenge-ACK back to the peer,
    thus the connection doesn't really fail.
    
    Fixes: 9501f97 ("tcp md5sig: Let the caller pass appropriate key for tcp_v{4,6}_do_calc_md5_hash().")
    Signed-off-by: Christoph Paasch <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    cpaasch authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    7887a70 View commit details
    Browse the repository at this point in the history
  35. tg3: Fix rx hang on MTU change with 5717/5719

    [ Upstream commit 748a240 ]
    
    This fixes a hang issue seen when changing the MTU size from 1500 MTU
    to 9000 MTU on both 5717 and 5719 chips. In discussion with Broadcom,
    they've indicated that these chipsets have the same phy as the 57766
    chipset, so the same workarounds apply. This has been tested by IBM
    on both Power 8 and Power 9 systems as well as by Broadcom on x86
    hardware and has been confirmed to resolve the hang issue.
    
    Signed-off-by: Brian King <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    bjking1 authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    484369f View commit details
    Browse the repository at this point in the history
  36. net: ipv4: fix for a race condition in raw_sendmsg

    [ Upstream commit 8f659a0 ]
    
    inet->hdrincl is racy, and could lead to uninitialized stack pointer
    usage, so its value should be read only once.
    
    Fixes: c008ba5 ("ipv4: Avoid reading user iov twice after raw_probe_proto_opt")
    Signed-off-by: Mohamed Ghannam <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    0x36 authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    f75f910 View commit details
    Browse the repository at this point in the history
  37. net: mvmdio: disable/unprepare clocks in EPROBE_DEFER case

    [ Upstream commit 589bf32 ]
    
    add appropriate calls to clk_disable_unprepare() by jumping to out_mdio
    in case orion_mdio_probe() returns -EPROBE_DEFER.
    
    Found by Linux Driver Verification project (linuxtesting.org).
    
    Fixes: 3d604da ("net: mvmdio: get and enable optional clock")
    Signed-off-by: Tobias Jordan <[email protected]>
    Reviewed-by: Andrew Lunn <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Tobias Jordan authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    99cf2da View commit details
    Browse the repository at this point in the history
  38. sctp: Replace use of sockets_allocated with specified macro.

    [ Upstream commit 8cb38a6 ]
    
    The patch(180d8cd) replaces all uses of struct sock fields'
    memory_pressure, memory_allocated, sockets_allocated, and sysctl_mem
    to accessor macros. But the sockets_allocated field of sctp sock is
    not replaced at all. Then replace it now for unifying the code.
    
    Fixes: 180d8cd ("foundations of per-cgroup memory pressure controlling.")
    Cc: Glauber Costa <[email protected]>
    Signed-off-by: Tonghao Zhang <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    xpu22 authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    ae67e54 View commit details
    Browse the repository at this point in the history
  39. adding missing rcu_read_unlock in ipxip6_rcv

    [ Upstream commit 74c4b65 ]
    
    commit 8d79266 ("ip6_tunnel: add collect_md mode to IPv6 tunnels")
    introduced new exit point in  ipxip6_rcv. however rcu_read_unlock is
    missing there. this diff is fixing this
    
    v1->v2:
     instead of doing rcu_read_unlock in place, we are going to "drop"
     section (to prevent skb leakage)
    
    Fixes: 8d79266 ("ip6_tunnel: add collect_md mode to IPv6 tunnels")
    Signed-off-by: Nikita V. Shirokov <[email protected]>
    Acked-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Nikita V. Shirokov authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    e51abae View commit details
    Browse the repository at this point in the history
  40. ipv4: Fix use-after-free when flushing FIB tables

    [ Upstream commit b4681c2 ]
    
    Since commit 0ddcf43 ("ipv4: FIB Local/MAIN table collapse") the
    local table uses the same trie allocated for the main table when custom
    rules are not in use.
    
    When a net namespace is dismantled, the main table is flushed and freed
    (via an RCU callback) before the local table. In case the callback is
    invoked before the local table is iterated, a use-after-free can occur.
    
    Fix this by iterating over the FIB tables in reverse order, so that the
    main table is always freed after the local table.
    
    v3: Reworded comment according to Alex's suggestion.
    v2: Add a comment to make the fix more explicit per Dave's and Alex's
    feedback.
    
    Fixes: 0ddcf43 ("ipv4: FIB Local/MAIN table collapse")
    Signed-off-by: Ido Schimmel <[email protected]>
    Reported-by: Fengguang Wu <[email protected]>
    Acked-by: Alexander Duyck <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    idosch authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    e4f6698 View commit details
    Browse the repository at this point in the history
  41. net: bridge: fix early call to br_stp_change_bridge_id and plug newli…

    …nk leaks
    
    [ Upstream commit 84aeb43 ]
    
    The early call to br_stp_change_bridge_id in bridge's newlink can cause
    a memory leak if an error occurs during the newlink because the fdb
    entries are not cleaned up if a different lladdr was specified, also
    another minor issue is that it generates fdb notifications with
    ifindex = 0. Another unrelated memory leak is the bridge sysfs entries
    which get added on NETDEV_REGISTER event, but are not cleaned up in the
    newlink error path. To remove this special case the call to
    br_stp_change_bridge_id is done after netdev register and we cleanup the
    bridge on changelink error via br_dev_delete to plug all leaks.
    
    This patch makes netlink bridge destruction on newlink error the same as
    dellink and ioctl del which is necessary since at that point we have a
    fully initialized bridge device.
    
    To reproduce the issue:
    $ ip l add br0 address 00:11:22:33:44:55 type bridge group_fwd_mask 1
    RTNETLINK answers: Invalid argument
    
    $ rmmod bridge
    [ 1822.142525] =============================================================================
    [ 1822.143640] BUG bridge_fdb_cache (Tainted: G           O    ): Objects remaining in bridge_fdb_cache on __kmem_cache_shutdown()
    [ 1822.144821] -----------------------------------------------------------------------------
    
    [ 1822.145990] Disabling lock debugging due to kernel taint
    [ 1822.146732] INFO: Slab 0x0000000092a844b2 objects=32 used=2 fp=0x00000000fef011b0 flags=0x1ffff8000000100
    [ 1822.147700] CPU: 2 PID: 13584 Comm: rmmod Tainted: G    B      O     4.15.0-rc2+ Freescale#87
    [ 1822.148578] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
    [ 1822.150008] Call Trace:
    [ 1822.150510]  dump_stack+0x78/0xa9
    [ 1822.151156]  slab_err+0xb1/0xd3
    [ 1822.151834]  ? __kmalloc+0x1bb/0x1ce
    [ 1822.152546]  __kmem_cache_shutdown+0x151/0x28b
    [ 1822.153395]  shutdown_cache+0x13/0x144
    [ 1822.154126]  kmem_cache_destroy+0x1c0/0x1fb
    [ 1822.154669]  SyS_delete_module+0x194/0x244
    [ 1822.155199]  ? trace_hardirqs_on_thunk+0x1a/0x1c
    [ 1822.155773]  entry_SYSCALL_64_fastpath+0x23/0x9a
    [ 1822.156343] RIP: 0033:0x7f929bd38b17
    [ 1822.156859] RSP: 002b:00007ffd160e9a98 EFLAGS: 00000202 ORIG_RAX: 00000000000000b0
    [ 1822.157728] RAX: ffffffffffffffda RBX: 00005578316ba090 RCX: 00007f929bd38b17
    [ 1822.158422] RDX: 00007f929bd9ec60 RSI: 0000000000000800 RDI: 00005578316ba0f0
    [ 1822.159114] RBP: 0000000000000003 R08: 00007f929bff5f20 R09: 00007ffd160e8a11
    [ 1822.159808] R10: 00007ffd160e9860 R11: 0000000000000202 R12: 00007ffd160e8a80
    [ 1822.160513] R13: 0000000000000000 R14: 0000000000000000 R15: 00005578316ba090
    [ 1822.161278] INFO: Object 0x000000007645de29 @offset=0
    [ 1822.161666] INFO: Object 0x00000000d5df2ab5 @offset=128
    
    Fixes: 30313a3 ("bridge: Handle IFLA_ADDRESS correctly when creating bridge device")
    Fixes: 5b8d542 ("bridge: netlink: register netdevice before executing changelink")
    Signed-off-by: Nikolay Aleksandrov <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Nikolay Aleksandrov authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    243adaa View commit details
    Browse the repository at this point in the history
  42. net: fec: Allow reception of frames bigger than 1522 bytes

    [ Upstream commit fbbeefd ]
    
    The FEC Receive Control Register has a 14 bit field indicating the
    longest frame that may be received. It is being set to 1522. Frames
    longer than this are discarded, but counted as being in error.
    
    When using DSA, frames from the switch has an additional header,
    either 4 or 8 bytes if a Marvell switch is used. Thus a full MTU frame
    of 1522 bytes received by the switch on a port becomes 1530 bytes when
    passed to the host via the FEC interface.
    
    Change the maximum receive size to 2048 - 64, where 64 is the maximum
    rx_alignment applied on the receive buffer for AVB capable FEC
    cores. Use this value also for the maximum receive buffer size. The
    driver is already allocating a receive SKB of 2048 bytes, so this
    change should not have any significant effects.
    
    Tested on imx51, imx6, vf610.
    
    Signed-off-by: Andrew Lunn <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    lunn authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    8c38f31 View commit details
    Browse the repository at this point in the history
  43. net: Fix double free and memory corruption in get_net_ns_by_id()

    [ Upstream commit 21b5944 ]
    
    (I can trivially verify that that idr_remove in cleanup_net happens
     after the network namespace count has dropped to zero --EWB)
    
    Function get_net_ns_by_id() does not check for net::count
    after it has found a peer in netns_ids idr.
    
    It may dereference a peer, after its count has already been
    finaly decremented. This leads to double free and memory
    corruption:
    
    put_net(peer)                                   rtnl_lock()
    atomic_dec_and_test(&peer->count) [count=0]     ...
    __put_net(peer)                                 get_net_ns_by_id(net, id)
      spin_lock(&cleanup_list_lock)
      list_add(&net->cleanup_list, &cleanup_list)
      spin_unlock(&cleanup_list_lock)
    queue_work()                                      peer = idr_find(&net->netns_ids, id)
      |                                               get_net(peer) [count=1]
      |                                               ...
      |                                               (use after final put)
      v                                               ...
      cleanup_net()                                   ...
        spin_lock(&cleanup_list_lock)                 ...
        list_replace_init(&cleanup_list, ..)          ...
        spin_unlock(&cleanup_list_lock)               ...
        ...                                           ...
        ...                                           put_net(peer)
        ...                                             atomic_dec_and_test(&peer->count) [count=0]
        ...                                               spin_lock(&cleanup_list_lock)
        ...                                               list_add(&net->cleanup_list, &cleanup_list)
        ...                                               spin_unlock(&cleanup_list_lock)
        ...                                             queue_work()
        ...                                           rtnl_unlock()
        rtnl_lock()                                   ...
        for_each_net(tmp) {                           ...
          id = __peernet2id(tmp, peer)                ...
          spin_lock_irq(&tmp->nsid_lock)              ...
          idr_remove(&tmp->netns_ids, id)             ...
          ...                                         ...
          net_drop_ns()                               ...
    	net_free(peer)                            ...
        }                                             ...
      |
      v
      cleanup_net()
        ...
        (Second free of peer)
    
    Also, put_net() on the right cpu may reorder with left's cpu
    list_replace_init(&cleanup_list, ..), and then cleanup_list
    will be corrupted.
    
    Since cleanup_net() is executed in worker thread, while
    put_net(peer) can happen everywhere, there should be
    enough time for concurrent get_net_ns_by_id() to pick
    the peer up, and the race does not seem to be unlikely.
    The patch fixes the problem in standard way.
    
    (Also, there is possible problem in peernet2id_alloc(), which requires
    check for net::count under nsid_lock and maybe_get_net(peer), but
    in current stable kernel it's used under rtnl_lock() and it has to be
    safe. Openswitch begun to use peernet2id_alloc(), and possibly it should
    be fixed too. While this is not in stable kernel yet, so I'll send
    a separate message to netdev@ later).
    
    Cc: Nicolas Dichtel <[email protected]>
    Signed-off-by: Kirill Tkhai <[email protected]>
    Fixes: 0c7aecd "netns: add rtnl cmd to add and get peer netns ids"
    Reviewed-by: Andrey Ryabinin <[email protected]>
    Reviewed-by: "Eric W. Biederman" <[email protected]>
    Signed-off-by: Eric W. Biederman <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Acked-by: Nicolas Dichtel <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ebiederm authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    03c9329 View commit details
    Browse the repository at this point in the history
  44. net: phy: micrel: ksz9031: reconfigure autoneg after phy autoneg work…

    …around
    
    [ Upstream commit c1a8d0a ]
    
    Under some circumstances driver will perform PHY reset in
    ksz9031_read_status() to fix autoneg failure case (idle error count =
    0xFF). When this happens ksz9031 will not detect link status change any
    more when connecting to Netgear 1G switch (link can be recovered sometimes by
    restarting netdevice "ifconfig down up"). Reproduced with TI am572x board
    equipped with ksz9031 PHY while connecting to Netgear 1G switch.
    
    Fix the issue by reconfiguring autonegotiation after PHY reset in
    ksz9031_read_status().
    
    Fixes: d2fd719 ("net/phy: micrel: Add workaround for bad autoneg")
    Signed-off-by: Grygorii Strashko <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    grygoriyS authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    a746fad View commit details
    Browse the repository at this point in the history
  45. sock: free skb in skb_complete_tx_timestamp on error

    [ Upstream commit 35b99df ]
    
    skb_complete_tx_timestamp must ingest the skb it is passed. Call
    kfree_skb if the skb cannot be enqueued.
    
    Fixes: b245be1 ("net-timestamp: no-payload only sysctl")
    Fixes: 9ac25fc ("net: fix socket refcounting in skb_complete_tx_timestamp()")
    Reported-by: Richard Cochran <[email protected]>
    Signed-off-by: Willem de Bruijn <[email protected]>
    Reviewed-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 Jan 2, 2018
    Configuration menu
    Copy the full SHA
    58f6ebb View commit details
    Browse the repository at this point in the history
  46. tcp: invalidate rate samples during SACK reneging

    [ Upstream commit d476175 ]
    
    Mark tcp_sock during a SACK reneging event and invalidate rate samples
    while marked. Such rate samples may overestimate bw by including packets
    that were SACKed before reneging.
    
    < ack 6001 win 10000 sack 7001:38001
    < ack 7001 win 0 sack 8001:38001 // Reneg detected
    > seq 7001:8001 // RTO, SACK cleared.
    < ack 38001 win 10000
    
    In above example the rate sample taken after the last ack will count
    7001-38001 as delivered while the actual delivery rate likely could
    be much lower i.e. 7001-8001.
    
    This patch adds a new field tcp_sock.sack_reneg and marks it when we
    declare SACK reneging and entering TCP_CA_Loss, and unmarks it after
    the last rate sample was taken before moving back to TCP_CA_Open. This
    patch also invalidates rate samples taken while tcp_sock.is_sack_reneg
    is set.
    
    Fixes: b9f6482 ("tcp: track data delivery rate for a TCP connection")
    Signed-off-by: Yousuk Seung <[email protected]>
    Signed-off-by: Neal Cardwell <[email protected]>
    Signed-off-by: Yuchung Cheng <[email protected]>
    Acked-by: Soheil Hassas Yeganeh <[email protected]>
    Acked-by: Eric Dumazet <[email protected]>
    Acked-by: Priyaranjan Jha <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    yousukseung authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    e74fe72 View commit details
    Browse the repository at this point in the history
  47. net/mlx5: Fix rate limit packet pacing naming and struct

    [ Upstream commit 37e92a9 ]
    
    In mlx5_ifc, struct size was not complete, and thus driver was sending
    garbage after the last defined field. Fixed it by adding reserved field
    to complete the struct size.
    
    In addition, rename all set_rate_limit to set_pp_rate_limit to be
    compliant with the Firmware <-> Driver definition.
    
    Fixes: 7486216 ("{net,IB}/mlx5: mlx5_ifc updates")
    Fixes: 1466cc5 ("net/mlx5: Rate limit tables support")
    Signed-off-by: Eran Ben Elisha <[email protected]>
    Signed-off-by: Saeed Mahameed <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Eran Ben Elisha authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    1387239 View commit details
    Browse the repository at this point in the history
  48. net/mlx5e: Fix features check of IPv6 traffic

    [ Upstream commit 2989ad1 ]
    
    The assumption that the next header field contains the transport
    protocol is wrong for IPv6 packets with extension headers.
    Instead, we should look the inner-most next header field in the buffer.
    This will fix TSO offload for tunnels over IPv6 with extension headers.
    
    Performance testing: 19.25x improvement, cool!
    Measuring bandwidth of 16 threads TCP traffic over IPv6 GRE tap.
    CPU: Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz
    NIC: Mellanox Technologies MT28800 Family [ConnectX-5 Ex]
    TSO: Enabled
    Before: 4,926.24  Mbps
    Now   : 94,827.91 Mbps
    
    Fixes: b3f63c3 ("net/mlx5e: Add netdev support for VXLAN tunneling")
    Signed-off-by: Gal Pressman <[email protected]>
    Signed-off-by: Saeed Mahameed <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Gal Pressman authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    9424a79 View commit details
    Browse the repository at this point in the history
  49. net/mlx5e: Fix possible deadlock of VXLAN lock

    [ Upstream commit 6323514 ]
    
    mlx5e_vxlan_lookup_port is called both from mlx5e_add_vxlan_port (user
    context) and mlx5e_features_check (softirq), but the lock acquired does
    not disable bottom half and might result in deadlock. Fix it by simply
    replacing spin_lock() with spin_lock_bh().
    While at it, replace all unnecessary spin_lock_irq() to spin_lock_bh().
    
    lockdep's WARNING: inconsistent lock state
    [  654.028136] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
    [  654.028229] swapper/5/0 [HC0[0]:SC1[9]:HE1:SE0] takes:
    [  654.028321]  (&(&vxlan_db->lock)->rlock){+.?.}, at: [<ffffffffa06e7f0e>] mlx5e_vxlan_lookup_port+0x1e/0x50 [mlx5_core]
    [  654.028528] {SOFTIRQ-ON-W} state was registered at:
    [  654.028607]   _raw_spin_lock+0x3c/0x70
    [  654.028689]   mlx5e_vxlan_lookup_port+0x1e/0x50 [mlx5_core]
    [  654.028794]   mlx5e_vxlan_add_port+0x2e/0x120 [mlx5_core]
    [  654.028878]   process_one_work+0x1e9/0x640
    [  654.028942]   worker_thread+0x4a/0x3f0
    [  654.029002]   kthread+0x141/0x180
    [  654.029056]   ret_from_fork+0x24/0x30
    [  654.029114] irq event stamp: 579088
    [  654.029174] hardirqs last  enabled at (579088): [<ffffffff818f475a>] ip6_finish_output2+0x49a/0x8c0
    [  654.029309] hardirqs last disabled at (579087): [<ffffffff818f470e>] ip6_finish_output2+0x44e/0x8c0
    [  654.029446] softirqs last  enabled at (579030): [<ffffffff810b3b3d>] irq_enter+0x6d/0x80
    [  654.029567] softirqs last disabled at (579031): [<ffffffff810b3c05>] irq_exit+0xb5/0xc0
    [  654.029684] other info that might help us debug this:
    [  654.029781]  Possible unsafe locking scenario:
    
    [  654.029868]        CPU0
    [  654.029908]        ----
    [  654.029947]   lock(&(&vxlan_db->lock)->rlock);
    [  654.030045]   <Interrupt>
    [  654.030090]     lock(&(&vxlan_db->lock)->rlock);
    [  654.030162]
     *** DEADLOCK ***
    
    Fixes: b3f63c3 ("net/mlx5e: Add netdev support for VXLAN tunneling")
    Signed-off-by: Gal Pressman <[email protected]>
    Signed-off-by: Saeed Mahameed <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Gal Pressman authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    d1614fd View commit details
    Browse the repository at this point in the history
  50. net/mlx5e: Add refcount to VXLAN structure

    [ Upstream commit 23f4cc2 ]
    
    A refcount mechanism must be implemented in order to prevent unwanted
    scenarios such as:
    - Open an IPv4 VXLAN interface
    - Open an IPv6 VXLAN interface (different socket)
    - Remove one of the interfaces
    
    With current implementation, the UDP port will be removed from our VXLAN
    database and turn off the offloads for the other interface, which is
    still active.
    The reference count mechanism will only allow UDP port removals once all
    consumers are gone.
    
    Fixes: b3f63c3 ("net/mlx5e: Add netdev support for VXLAN tunneling")
    Signed-off-by: Gal Pressman <[email protected]>
    Signed-off-by: Saeed Mahameed <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Gal Pressman authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    6042258 View commit details
    Browse the repository at this point in the history
  51. net/mlx5e: Prevent possible races in VXLAN control flow

    [ Upstream commit 0c1cc8b ]
    
    When calling add/remove VXLAN port, a lock must be held in order to
    prevent race scenarios when more than one add/remove happens at the
    same time.
    Fix by holding our state_lock (mutex) as done by all other parts of the
    driver.
    Note that the spinlock protecting the radix-tree is still needed in
    order to synchronize radix-tree access from softirq context.
    
    Fixes: b3f63c3 ("net/mlx5e: Add netdev support for VXLAN tunneling")
    Signed-off-by: Gal Pressman <[email protected]>
    Signed-off-by: Saeed Mahameed <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Gal Pressman authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    c844a45 View commit details
    Browse the repository at this point in the history
  52. net/mlx5: Fix error flow in CREATE_QP command

    [ Upstream commit dbff26e ]
    
    In error flow, when DESTROY_QP command should be executed, the wrong
    mailbox was set with data, not the one that is written to hardware,
    Fix that.
    
    Fixes: 09a7d9e '{net,IB}/mlx5: QP/XRCD commands via mlx5 ifc'
    Signed-off-by: Moni Shoua <[email protected]>
    Signed-off-by: Saeed Mahameed <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    monis410 authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    7493d98 View commit details
    Browse the repository at this point in the history
  53. s390/qeth: apply takeover changes when mode is toggled

    [ Upstream commit 7fbd949 ]
    
    Just as for an explicit enable/disable, toggling the takeover mode also
    requires that the IP addresses get updated. Otherwise all IPs that were
    added to the table before the mode-toggle, get registered with the old
    settings.
    
    Signed-off-by: Julian Wiedmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    julianwiedmann authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    6ed7c48 View commit details
    Browse the repository at this point in the history
  54. s390/qeth: don't apply takeover changes to RXIP

    [ Upstream commit b22d73d ]
    
    When takeover is switched off, current code clears the 'TAKEOVER' flag on
    all IPs. But the flag is also used for RXIP addresses, and those should
    not be affected by the takeover mode.
    Fix the behaviour by consistenly applying takover logic to NORMAL
    addresses only.
    
    Signed-off-by: Julian Wiedmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    julianwiedmann authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    475018c View commit details
    Browse the repository at this point in the history
  55. s390/qeth: lock IP table while applying takeover changes

    [ Upstream commit 8a03a36 ]
    
    Modifying the flags of an IP addr object needs to be protected against
    eg. concurrent removal of the same object from the IP table.
    
    Fixes: 5f78e29 ("qeth: optimize IP handling in rx_mode callback")
    Signed-off-by: Julian Wiedmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    julianwiedmann authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    476d7d6 View commit details
    Browse the repository at this point in the history
  56. s390/qeth: update takeover IPs after configuration change

    [ Upstream commit 02f510f ]
    
    Any modification to the takeover IP-ranges requires that we re-evaluate
    which IP addresses are takeover-eligible. Otherwise we might do takeover
    for some addresses when we no longer should, or vice-versa.
    
    Signed-off-by: Julian Wiedmann <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    julianwiedmann authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    67b539c View commit details
    Browse the repository at this point in the history
  57. usbip: fix usbip bind writing random string after command in match_busid

    commit 544c460 upstream.
    
    usbip bind writes commands followed by random string when writing to
    match_busid attribute in sysfs, caused by using full variable size
    instead of string length.
    
    Signed-off-by: Juan Zea <[email protected]>
    Acked-by: Shuah Khan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Juan Zea authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    3c579d0 View commit details
    Browse the repository at this point in the history
  58. usbip: prevent leaking socket pointer address in messages

    commit 90120d1 upstream.
    
    usbip driver is leaking socket pointer address in messages. Remove
    the messages that aren't useful and print sockfd in the ones that
    are useful for debugging.
    
    Signed-off-by: Shuah Khan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Shuah Khan authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    1ef5c43 View commit details
    Browse the repository at this point in the history
  59. usbip: stub: stop printing kernel pointer addresses in messages

    commit 248a220 upstream.
    
    Remove and/or change debug, info. and error messages to not print
    kernel pointer addresses.
    
    Signed-off-by: Shuah Khan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Shuah Khan authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    9e9f425 View commit details
    Browse the repository at this point in the history
  60. usbip: vhci: stop printing kernel pointer addresses in messages

    commit 8272d09 upstream.
    
    Remove and/or change debug, info. and error messages to not print
    kernel pointer addresses.
    
    Signed-off-by: Shuah Khan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Shuah Khan authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    03dce05 View commit details
    Browse the repository at this point in the history
  61. USB: serial: ftdi_sio: add id for Airbus DS P8GR

    commit c6a36ad upstream.
    
    Add AIRBUS_DS_P8GR device IDs to ftdi_sio driver.
    
    Signed-off-by: Max Schulze <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Max Schulze authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    0af1aeb View commit details
    Browse the repository at this point in the history
  62. USB: serial: qcserial: add Sierra Wireless EM7565

    commit 92a18a6 upstream.
    
    Sierra Wireless EM7565 devices use the QCSERIAL_SWI layout for their
    serial ports
    
    T:  Bus=01 Lev=03 Prnt=29 Port=01 Cnt=02 Dev#= 31 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1199 ProdID=9091 Rev= 0.06
    S:  Manufacturer=Sierra Wireless, Incorporated
    S:  Product=Sierra Wireless EM7565 Qualcomm Snapdragon X16 LTE-A
    S:  SerialNumber=xxxxxxxx
    C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=qcserial
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=qcserial
    E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=qcserial
    E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 8 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    E:  Ad=86(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    but need sendsetup = true for the NMEA port to make it work properly.
    
    Simplify the patch compared to v1 as suggested by Bjørn Mork by taking
    advantage of the fact that existing devices work with sendsetup = true
    too.
    
    Use sendsetup = true for the NMEA interface of QCSERIAL_SWI and add
    DEVICE_SWI entries for the EM7565 PID 0x9091 and the EM7565 QDL PID
    0x9090.
    
    Tests with several MC73xx/MC74xx/MC77xx devices have been performed in
    order to verify backward compatibility.
    
    Signed-off-by: Reinhard Speyerer <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Reinhard Speyerer authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    6ab3d87 View commit details
    Browse the repository at this point in the history
  63. USB: serial: option: add support for Telit ME910 PID 0x1101

    commit 0893309 upstream.
    
    This patch adds support for PID 0x1101 of Telit ME910.
    
    Signed-off-by: Daniele Palmas <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dnlplm authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    192cdf5 View commit details
    Browse the repository at this point in the history
  64. USB: serial: option: adding support for YUGA CLM920-NC5

    commit 3920bb7 upstream.
    
    This patch adds support for YUGA CLM920-NC5 PID 0x9625 USB modem to option
    driver.
    
    Interface layout:
    0: QCDM/DIAG
    1: ADB
    2: MODEM
    3: AT
    4: RMNET
    
    Signed-off-by: Taiyi Wu <[email protected]>
    Signed-off-by: SZ Lin (林上智) <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    SZ Lin (林上智) authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    d98f4d4 View commit details
    Browse the repository at this point in the history
  65. usb: Add device quirk for Logitech HD Pro Webcam C925e

    commit 7f038d2 upstream.
    
    Commit e042936
    ("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e")
    introduced quirk to workaround an issue with some Logitech webcams.
    
    There is one more model that has the same issue - C925e, so applying
    the same quirk as well.
    
    See aforementioned commit message for detailed explanation of the problem.
    
    Signed-off-by: Dmitry Fleytman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dmitryfleytman authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    0f2e9cb View commit details
    Browse the repository at this point in the history
  66. usb: add RESET_RESUME for ELSA MicroLink 56K

    commit b9096d9 upstream.
    
    This modem needs this quirk to operate. It produces timeouts when
    resumed without reset.
    
    Signed-off-by: Oliver Neukum <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    oneukum authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    425d2f1 View commit details
    Browse the repository at this point in the history
  67. USB: Fix off by one in type-specific length check of BOS SSP capability

    commit 07b9f12 upstream.
    
    USB 3.1 devices are not detected as 3.1 capable since 4.15-rc3 due to a
    off by one in commit 81cf4a4 ("USB: core: Add type-specific length
    check of BOS descriptors")
    
    It uses USB_DT_USB_SSP_CAP_SIZE() to get SSP capability size which takes
    the zero based SSAC as argument, not the actual count of sublink speed
    attributes.
    
    USB3 spec 9.6.2.5 says "The number of Sublink Speed Attributes = SSAC + 1."
    
    The type-specific length check patch was added to stable and needs to be
    fixed there as well
    
    Fixes: 81cf4a4 ("USB: core: Add type-specific length check of BOS descriptors")
    CC: Masakazu Mokuno <[email protected]>
    Signed-off-by: Mathias Nyman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    matnyman authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    ab1fbfe View commit details
    Browse the repository at this point in the history
  68. usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201

    commit da99706 upstream.
    
    When plugging in a USB webcam I see the following message:
    xhci_hcd 0000:04:00.0: WARN Successful completion on short TX: needs
    XHCI_TRUST_TX_LENGTH quirk?
    handle_tx_event: 913 callbacks suppressed
    
    All is quiet again with this patch (and I've done a fair but of soak
    testing with the camera since).
    
    Signed-off-by: Daniel Thompson <[email protected]>
    Acked-by: Ard Biesheuvel <[email protected]>
    Signed-off-by: Mathias Nyman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    daniel-thompson authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    09d3e69 View commit details
    Browse the repository at this point in the history
  69. timers: Use deferrable base independent of base::nohz_active

    commit ced6d5c upstream.
    
    During boot and before base::nohz_active is set in the timer bases, deferrable
    timers are enqueued into the standard timer base. This works correctly as
    long as base::nohz_active is false.
    
    Once it base::nohz_active is set and a timer which was enqueued before that
    is accessed the lock selector code choses the lock of the deferred
    base. This causes unlocked access to the standard base and in case the
    timer is removed it does not clear the pending flag in the standard base
    bitmap which causes get_next_timer_interrupt() to return bogus values.
    
    To prevent that, the deferrable timers must be enqueued in the deferrable
    base, even when base::nohz_active is not set. Those deferrable timers also
    need to be expired unconditional.
    
    Fixes: 500462a ("timers: Switch to a non-cascading wheel")
    Signed-off-by: Anna-Maria Gleixner <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Reviewed-by: Frederic Weisbecker <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Sebastian Siewior <[email protected]>
    Cc: [email protected]
    Cc: Paul McKenney <[email protected]>
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    anna-marialx authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    d840687 View commit details
    Browse the repository at this point in the history
  70. timers: Invoke timer_start_debug() where it makes sense

    commit fd45bb7 upstream.
    
    The timer start debug function is called before the proper timer base is
    set. As a consequence the trace data contains the stale CPU and flags
    values.
    
    Call the debug function after setting the new base and flags.
    
    Fixes: 500462a ("timers: Switch to a non-cascading wheel")
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Frederic Weisbecker <[email protected]>
    Cc: Sebastian Siewior <[email protected]>
    Cc: [email protected]
    Cc: Paul McKenney <[email protected]>
    Cc: Anna-Maria Gleixner <[email protected]>
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    KAGA-KOKO authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    574e543 View commit details
    Browse the repository at this point in the history
  71. timers: Reinitialize per cpu bases on hotplug

    commit 26456f8 upstream.
    
    The timer wheel bases are not (re)initialized on CPU hotplug. That leaves
    them with a potentially stale clk and next_expiry valuem, which can cause
    trouble then the CPU is plugged.
    
    Add a prepare callback which forwards the clock, sets next_expiry to far in
    the future and reset the control flags to a known state.
    
    Set base->must_forward_clk so the first timer which is queued will try to
    forward the clock to current jiffies.
    
    Fixes: 500462a ("timers: Switch to a non-cascading wheel")
    Reported-by: Paul E. McKenney <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Frederic Weisbecker <[email protected]>
    Cc: Sebastian Siewior <[email protected]>
    Cc: Anna-Maria Gleixner <[email protected]>
    Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1712272152200.2431@nanos
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    KAGA-KOKO authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    249d4a9 View commit details
    Browse the repository at this point in the history
  72. nohz: Prevent a timer interrupt storm in tick_nohz_stop_sched_tick()

    commit 5d62c18 upstream.
    
    The conditions in irq_exit() to invoke tick_nohz_irq_exit() which
    subsequently invokes tick_nohz_stop_sched_tick() are:
    
      if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu))
    
    If need_resched() is not set, but a timer softirq is pending then this is
    an indication that the softirq code punted and delegated the execution to
    softirqd. need_resched() is not true because the current interrupted task
    takes precedence over softirqd.
    
    Invoking tick_nohz_irq_exit() in this case can cause an endless loop of
    timer interrupts because the timer wheel contains an expired timer, but
    softirqs are not yet executed. So it returns an immediate expiry request,
    which causes the timer to fire immediately again. Lather, rinse and
    repeat....
    
    Prevent that by adding a check for a pending timer soft interrupt to the
    conditions in tick_nohz_stop_sched_tick() which avoid calling
    get_next_timer_interrupt(). That keeps the tick sched timer on the tick and
    prevents a repetitive programming of an already expired timer.
    
    Reported-by: Sebastian Siewior <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Acked-by: Frederic Weisbecker <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Paul McKenney <[email protected]>
    Cc: Anna-Maria Gleixner <[email protected]>
    Cc: Sebastian Siewior <[email protected]>
    Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1712272156050.2431@nanos
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    KAGA-KOKO authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    e8119ac View commit details
    Browse the repository at this point in the history
  73. x86/smpboot: Remove stale TLB flush invocations

    commit 322f8b8 upstream.
    
    smpboot_setup_warm_reset_vector() and smpboot_restore_warm_reset_vector()
    invoke local_flush_tlb() for no obvious reason.
    
    Digging in history revealed that the original code in the 2.1 era added
    those because the code manipulated a swapper_pg_dir pagetable entry. The
    pagetable manipulation was removed long ago in the 2.3 timeframe, but the
    TLB flush invocations stayed around forever.
    
    Remove them along with the pointless pr_debug()s which come from the same 2.1
    change.
    
    Reported-by: Dominik Brodowski <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: Andy Lutomirski <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Ingo Molnar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    KAGA-KOKO authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    404ae54 View commit details
    Browse the repository at this point in the history
  74. n_tty: fix EXTPROC vs ICANON interaction with TIOCINQ (aka FIONREAD)

    commit 966031f upstream.
    
    We added support for EXTPROC back in 2010 in commit 26df6d1 ("tty:
    Add EXTPROC support for LINEMODE") and the intent was to allow it to
    override some (all?) ICANON behavior.  Quoting from that original commit
    message:
    
             There is a new bit in the termios local flag word, EXTPROC.
             When this bit is set, several aspects of the terminal driver
             are disabled.  Input line editing, character echo, and mapping
             of signals are all disabled.  This allows the telnetd to turn
             off these functions when in linemode, but still keep track of
             what state the user wants the terminal to be in.
    
    but the problem turns out that "several aspects of the terminal driver
    are disabled" is a bit ambiguous, and you can really confuse the n_tty
    layer by setting EXTPROC and then causing some of the ICANON invariants
    to no longer be maintained.
    
    This fixes at least one such case (TIOCINQ) becoming unhappy because of
    the confusion over whether ICANON really means ICANON when EXTPROC is set.
    
    This basically makes TIOCINQ match the case of read: if EXTPROC is set,
    we ignore ICANON.  Also, make sure to reset the ICANON state ie EXTPROC
    changes, not just if ICANON changes.
    
    Fixes: 26df6d1 ("tty: Add EXTPROC support for LINEMODE")
    Reported-by: Tetsuo Handa <[email protected]>
    Reported-by: syzkaller <[email protected]>
    Cc: Jiri Slaby <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    torvalds authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    00fc57a View commit details
    Browse the repository at this point in the history
  75. tty: fix tty_ldisc_receive_buf() documentation

    commit e7e51dc upstream.
    
    The tty_ldisc_receive_buf() helper returns the number of bytes
    processed so drop the bogus "not" from the kernel doc comment.
    
    Fixes: 8d082cd ("tty: Unify receive_buf() code paths")
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jhovold authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    d76dabb View commit details
    Browse the repository at this point in the history
  76. mm/vmstat: Make NR_TLB_REMOTE_FLUSH_RECEIVED available even on UP

    commit 5dd0b16 upstream.
    
    This fixes CONFIG_SMP=n, CONFIG_DEBUG_TLBFLUSH=y without introducing
    further #ifdef soup.  Caught by a Kbuild bot randconfig build.
    
    Signed-off-by: Andy Lutomirski <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Thomas Gleixner <[email protected]>
    Fixes: ce4a4e5 ("x86/mm: Remove the UP asm/tlbflush.h code, always use the (formerly) SMP code")
    Link: http://lkml.kernel.org/r/76da9a3cc4415996f2ad2c905b93414add322021.1496673616.git.luto@kernel.org
    Signed-off-by: Ingo Molnar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    amluto authored and gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    181a832 View commit details
    Browse the repository at this point in the history
  77. Linux 4.9.74

    gregkh committed Jan 2, 2018
    Configuration menu
    Copy the full SHA
    07bcb24 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2018

  1. tcp_bbr: reset full pipe detection on loss recovery undo

    commit 2f6c498 upstream.
    
    Fix BBR so that upon notification of a loss recovery undo BBR resets
    the full pipe detection (STARTUP exit) state machine.
    
    Under high reordering, reordering events can be interpreted as loss.
    If the reordering and spurious loss estimates are high enough, this
    could previously cause BBR to spuriously estimate that the pipe is
    full.
    
    Since spurious loss recovery means that our overall sending will have
    slowed down spuriously, this commit gives a flow more time to probe
    robustly for bandwidth and decide the pipe is really full.
    
    Signed-off-by: Neal Cardwell <[email protected]>
    Reviewed-by: Yuchung Cheng <[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]>
    nealcardwell authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    61c51da View commit details
    Browse the repository at this point in the history
  2. tcp_bbr: reset long-term bandwidth sampling on loss recovery undo

    commit 600647d upstream.
    
    Fix BBR so that upon notification of a loss recovery undo BBR resets
    long-term bandwidth sampling.
    
    Under high reordering, reordering events can be interpreted as loss.
    If the reordering and spurious loss estimates are high enough, this
    can cause BBR to spuriously estimate that we are seeing loss rates
    high enough to trigger long-term bandwidth estimation. To avoid that
    problem, this commit resets long-term bandwidth sampling on loss
    recovery undo events.
    
    Signed-off-by: Neal Cardwell <[email protected]>
    Reviewed-by: Yuchung Cheng <[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]>
    nealcardwell authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    8824b2d View commit details
    Browse the repository at this point in the history
  3. x86/boot: Add early cmdline parsing for options with arguments

    commit e505371 upstream.
    
    Add a cmdline_find_option() function to look for cmdline options that
    take arguments. The argument is returned in a supplied buffer and the
    argument length (regardless of whether it fits in the supplied buffer)
    is returned, with -1 indicating not found.
    
    Signed-off-by: Tom Lendacky <[email protected]>
    Reviewed-by: Thomas Gleixner <[email protected]>
    Cc: Alexander Potapenko <[email protected]>
    Cc: Andrey Ryabinin <[email protected]>
    Cc: Andy Lutomirski <[email protected]>
    Cc: Arnd Bergmann <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Brijesh Singh <[email protected]>
    Cc: Dave Young <[email protected]>
    Cc: Dmitry Vyukov <[email protected]>
    Cc: Jonathan Corbet <[email protected]>
    Cc: Konrad Rzeszutek Wilk <[email protected]>
    Cc: Larry Woodman <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Matt Fleming <[email protected]>
    Cc: Michael S. Tsirkin <[email protected]>
    Cc: Paolo Bonzini <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Radim Krčmář <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Toshimitsu Kani <[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/36b5f97492a9745dce27682305f990fc20e5cf8a.1500319216.git.thomas.lendacky@amd.com
    Signed-off-by: Ingo Molnar <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tlendacky authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    b5fd58e View commit details
    Browse the repository at this point in the history
  4. KAISER: Kernel Address Isolation

    This patch introduces our implementation of KAISER (Kernel Address Isolation to
    have Side-channels Efficiently Removed), a kernel isolation technique to close
    hardware side channels on kernel address information.
    
    More information about the patch can be found on:
    
            https://github.com/IAIK/KAISER
    
    From: Richard Fellner <[email protected]>
    From: Daniel Gruss <[email protected]>
    Subject: [RFC, PATCH] x86_64: KAISER - do not map kernel in user mode
    Date: Thu, 4 May 2017 14:26:50 +0200
    Link: http://marc.info/?l=linux-kernel&m=149390087310405&w=2
    Kaiser-4.10-SHA1: c4b1831d44c6144d3762ccc72f0c4e71a0c713e5
    
    To: <[email protected]>
    To: <[email protected]>
    Cc: <[email protected]>
    Cc: <[email protected]>
    Cc: Michael Schwarz <[email protected]>
    Cc: Richard Fellner <[email protected]>
    Cc: Ingo Molnar <[email protected]>
    Cc: <[email protected]>
    Cc: <[email protected]>
    
    After several recent works [1,2,3] KASLR on x86_64 was basically
    considered dead by many researchers. We have been working on an
    efficient but effective fix for this problem and found that not mapping
    the kernel space when running in user mode is the solution to this
    problem [4] (the corresponding paper [5] will be presented at ESSoS17).
    
    With this RFC patch we allow anybody to configure their kernel with the
    flag CONFIG_KAISER to add our defense mechanism.
    
    If there are any questions we would love to answer them.
    We also appreciate any comments!
    
    Cheers,
    Daniel (+ the KAISER team from Graz University of Technology)
    
    [1] http://www.ieee-security.org/TC/SP2013/papers/4977a191.pdf
    [2] https://www.blackhat.com/docs/us-16/materials/us-16-Fogh-Using-Undocumented-CPU-Behaviour-To-See-Into-Kernel-Mode-And-Break-KASLR-In-The-Process.pdf
    [3] https://www.blackhat.com/docs/us-16/materials/us-16-Jang-Breaking-Kernel-Address-Space-Layout-Randomization-KASLR-With-Intel-TSX.pdf
    [4] https://github.com/IAIK/KAISER
    [5] https://gruss.cc/files/kaiser.pdf
    
    [patch based also on
    https://raw.githubusercontent.com/IAIK/KAISER/master/KAISER/0001-KAISER-Kernel-Address-Isolation.patch]
    
    Signed-off-by: Richard Fellner <[email protected]>
    Signed-off-by: Moritz Lipp <[email protected]>
    Signed-off-by: Daniel Gruss <[email protected]>
    Signed-off-by: Michael Schwarz <[email protected]>
    Acked-by: Jiri Kosina <[email protected]>
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    RiAF- authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    13be448 View commit details
    Browse the repository at this point in the history
  5. kaiser: merged update

    Merged fixes and cleanups, rebased to 4.9.51 tree (no 5-level paging).
    
    Signed-off-by: Dave Hansen <[email protected]>
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hansendc authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    8f0baad View commit details
    Browse the repository at this point in the history
  6. kaiser: do not set _PAGE_NX on pgd_none

    native_pgd_clear() uses native_set_pgd(), so native_set_pgd() must
    avoid setting the _PAGE_NX bit on an otherwise pgd_none() entry:
    usually that just generated a warning on exit, but sometimes
    more mysterious and damaging failures (our production machines
    could not complete booting).
    
    The original fix to this just avoided adding _PAGE_NX to
    an empty entry; but eventually more problems surfaced with kexec,
    and EFI mapping expected to be a problem too.  So now instead
    change native_set_pgd() to update shadow only if _PAGE_USER:
    
    A few places (kernel/machine_kexec_64.c, platform/efi/efi_64.c for sure)
    use set_pgd() to set up a temporary internal virtual address space, with
    physical pages remapped at what Kaiser regards as userspace addresses:
    Kaiser then assumes a shadow pgd follows, which it will try to corrupt.
    
    This appears to be responsible for the recent kexec and kdump failures;
    though it's unclear how those did not manifest as a problem before.
    Ah, the shadow pgd will only be assumed to "follow" if the requested
    pgd is on an even-numbered page: so I suppose it was going wrong 50%
    of the time all along.
    
    What we need is a flag to set_pgd(), to tell it we're dealing with
    userspace.  Er, isn't that what the pgd's _PAGE_USER bit is saying?
    Add a test for that.  But we cannot do the same for pgd_clear()
    (which may be called to clear corrupted entries - set aside the
    question of "corrupt in which pgd?" until later), so there just
    rely on pgd_clear() not being called in the problematic cases -
    with a WARN_ON_ONCE() which should fire half the time if it is.
    
    But this is getting too big for an inline function: move it into
    arch/x86/mm/kaiser.c (which then demands a boot/compressed mod);
    and de-void and de-space native_get_shadow/normal_pgd() while here.
    
    Also make an unnecessary change to KASLR's init_trampoline(): it was
    using set_pgd() to assign a pgd-value to a global variable (not in a
    pg directory page), which was rather scary given Kaiser's previous
    set_pgd() implementation: not a problem now, but too scary to leave
    as was, it could easily blow up if we have to change set_pgd() again.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    ac2f101 View commit details
    Browse the repository at this point in the history
  7. kaiser: stack map PAGE_SIZE at THREAD_SIZE-PAGE_SIZE

    Kaiser only needs to map one page of the stack; and
    kernel/fork.c did not build on powerpc (no __PAGE_KERNEL).
    It's all cleaner if linux/kaiser.h provides kaiser_map_thread_stack()
    and kaiser_unmap_thread_stack() wrappers around asm/kaiser.h's
    kaiser_add_mapping() and kaiser_remove_mapping().  And use
    linux/kaiser.h in init/main.c to avoid the #ifdefs there.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    0994a2c View commit details
    Browse the repository at this point in the history
  8. kaiser: fix build and FIXME in alloc_ldt_struct()

    Include linux/kaiser.h instead of asm/kaiser.h to build ldt.c without
    CONFIG_KAISER.  kaiser_add_mapping() does already return an error code,
    so fix the FIXME.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    7a92e20 View commit details
    Browse the repository at this point in the history
  9. kaiser: KAISER depends on SMP

    It is absurd that KAISER should depend on SMP, but apparently nobody
    has tried a UP build before: which breaks on implicit declaration of
    function 'per_cpu_offset' in arch/x86/mm/kaiser.c.
    
    Now, you would expect that to be trivially fixed up; but looking at
    the System.map when that block is #ifdef'ed out of kaiser_init(),
    I see that in a UP build __per_cpu_user_mapped_end is precisely at
    __per_cpu_user_mapped_start, and the items carefully gathered into
    that section for user-mapping on SMP, dispersed elsewhere on UP.
    
    So, some other kind of section assignment will be needed on UP,
    but implementing that is not a priority: just make KAISER depend
    on SMP for now.
    
    Also inserted a blank line before the option, tidied up the
    brief Kconfig help message, and added an "If unsure, Y".
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    639c005 View commit details
    Browse the repository at this point in the history
  10. kaiser: fix regs to do_nmi() ifndef CONFIG_KAISER

    pjt has observed that nmi's second (nmi_from_kernel) call to do_nmi()
    adjusted the %rdi regs arg, rightly when CONFIG_KAISER, but wrongly
    when not CONFIG_KAISER.
    
    Although the minimal change is to add an #ifdef CONFIG_KAISER around
    the addq line, that looks cluttered, and I prefer how the first call
    to do_nmi() handled it: prepare args in %rdi and %rsi before getting
    into the CONFIG_KAISER block, since it does not touch them at all.
    
    And while we're here, place the "#ifdef CONFIG_KAISER" that follows
    each, to enclose the "Unconditionally restore CR3" comment: matching
    how the "Unconditionally use kernel CR3" comment above is enclosed.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    1937794 View commit details
    Browse the repository at this point in the history
  11. kaiser: fix perf crashes

    Avoid perf crashes: place debug_store in the user-mapped per-cpu area
    instead of allocating, and use page allocator plus kaiser_add_mapping()
    to keep the BTS and PEBS buffers user-mapped (that is, present in the
    user mapping, though visible only to kernel and hardware).  The PEBS
    fixup buffer does not need this treatment.
    
    The need for a user-mapped struct debug_store showed up before doing
    any conscious perf testing: in a couple of kernel paging oopses on
    Westmere, implicating the debug_store offset of the per-cpu area.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    f881e62 View commit details
    Browse the repository at this point in the history
  12. kaiser: ENOMEM if kaiser_pagetable_walk() NULL

    kaiser_add_user_map() took no notice when kaiser_pagetable_walk() failed.
    And avoid its might_sleep() when atomic (though atomic at present unused).
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    f43f386 View commit details
    Browse the repository at this point in the history
  13. kaiser: tidied up asm/kaiser.h somewhat

    Mainly deleting a surfeit of blank lines, and reflowing header comment.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    67fab0d View commit details
    Browse the repository at this point in the history
  14. kaiser: tidied up kaiser_add/remove_mapping slightly

    Yes, unmap_pud_range_nofree()'s declaration ought to be in a
    header file really, but I'm not sure we want to use it anyway:
    so for now just declare it inside kaiser_remove_mapping().
    And there doesn't seem to be such a thing as unmap_p4d_range(),
    even in a 5-level paging tree.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    be6bf01 View commit details
    Browse the repository at this point in the history
  15. kaiser: align addition to x86/mm/Makefile

    Use tab not space so they line up properly, kaslr.o also.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    604db49 View commit details
    Browse the repository at this point in the history
  16. kaiser: cleanups while trying for gold link

    While trying to get our gold link to work, four cleanups:
    matched the gdt_page declaration to its definition;
    in fiddling unsuccessfully with PERCPU_INPUT(), lined up backslashes;
    lined up the backslashes according to convention in percpu-defs.h;
    deleted the unused irq_stack_pointer addition to irq_stack_union.
    
    Sad to report that aligning backslashes does not appear to help gold
    align to 8192: but while these did not help, they are worth keeping.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    61b7a40 View commit details
    Browse the repository at this point in the history
  17. kaiser: name that 0x1000 KAISER_SHADOW_PGD_OFFSET

    There's a 0x1000 in various places, which looks better with a name.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    c27cdea View commit details
    Browse the repository at this point in the history
  18. kaiser: delete KAISER_REAL_SWITCH option

    We fail to see what CONFIG_KAISER_REAL_SWITCH is for: it seems to be
    left over from early development, and now just obscures tricky parts
    of the code.  Delete it before adding PCIDs, or nokaiser boot option.
    
    (Or if there is some good reason to keep the option, then it needs
    a help text - and a "depends on KAISER", so that all those without
    KAISER are not asked the question.  But we'd much rather delete it.)
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    1ce27de View commit details
    Browse the repository at this point in the history
  19. kaiser: vmstat show NR_KAISERTABLE as nr_overhead

    The kaiser update made an interesting choice, never to free any shadow
    page tables.  Contention on global spinlock was worrying, particularly
    with it held across page table scans when freeing.  Something had to be
    done: I was going to add refcounting; but simply never to free them is
    an appealing choice, minimizing contention without complicating the code
    (the more a page table is found already, the less the spinlock is used).
    
    But leaking pages in this way is also a worry: can we get away with it?
    At the very least, we need a count to show how bad it actually gets:
    in principle, one might end up wasting about 1/256 of memory that way
    (1/512 for when direct-mapped pages have to be user-mapped, plus 1/512
    for when they are user-mapped from the vmalloc area on another occasion
    (but we don't have vmalloc'ed stacks, so only large ldts are vmalloc'ed).
    
    Add per-cpu stat NR_KAISERTABLE: including 256 at startup for the
    shared pgd entries, and 1 for each intermediate page table added
    thereafter for user-mapping - but leave out the 1 per mm, for its
    shadow pgd, because that distracts from the monotonic increase.
    Shown in /proc/vmstat as nr_overhead (0 if kaiser not enabled).
    
    In practice, it doesn't look so bad so far: more like 1/12000 after
    nine hours of gtests below; and movable pageblock segregation should
    tend to cluster the kaiser tables into a subset of the address space
    (if not, they will be bad for compaction too).  But production may
    tell a different story: keep an eye on this number, and bring back
    lighter freeing if it gets out of control (maybe a shrinker).
    
    ["nr_overhead" should of course say "nr_kaisertable", if it needs
    to stay; but for the moment we are being coy, preferring that when
    Joe Blow notices a new line in his /proc/vmstat, he does not get
    too curious about what this "kaiser" stuff might be.]
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    1972bb9 View commit details
    Browse the repository at this point in the history
  20. kaiser: enhanced by kernel and user PCIDs

    Merged performance improvements to Kaiser, using distinct kernel
    and user Process Context Identifiers to minimize the TLB flushing.
    
    [This work actually all from Dave Hansen 2017-08-30:
    still omitting trackswitch mods, and KAISER_REAL_SWITCH deleted.]
    
    Signed-off-by: Dave Hansen <[email protected]>
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    2684b12 View commit details
    Browse the repository at this point in the history
  21. kaiser: load_new_mm_cr3() let SWITCH_USER_CR3 flush user

    We have many machines (Westmere, Sandybridge, Ivybridge) supporting
    PCID but not INVPCID: on these load_new_mm_cr3() simply crashed.
    
    Flushing user context inside load_new_mm_cr3() without the use of
    invpcid is difficult: momentarily switch from kernel to user context
    and back to do so?  I'm not sure whether that can be safely done at
    all, and would risk polluting user context with kernel internals,
    and kernel context with stale user externals.
    
    Instead, follow the hint in the comment that was there: change
    X86_CR3_PCID_USER_VAR to be a per-cpu variable, then load_new_mm_cr3()
    can leave a note in it, for SWITCH_USER_CR3 on return to userspace to
    flush user context TLB, instead of default X86_CR3_PCID_USER_NOFLUSH.
    
    Which works well enough that there's no need to do it this way only
    when invpcid is unsupported: it's a good alternative to invpcid here.
    But there's a couple of inlines in asm/tlbflush.h that need to do the
    same trick, so it's best to localize all this per-cpu business in
    mm/kaiser.c: moving that part of the initialization from setup_pcid()
    to kaiser_setup_pcid(); with kaiser_flush_tlb_on_return_to_user() the
    function for noting an X86_CR3_PCID_USER_FLUSH.  And let's keep a
    KAISER_SHADOW_PGD_OFFSET in there, to avoid the extra OR on exit.
    
    I did try to make the feature tests in asm/tlbflush.h more consistent
    with each other: there seem to be far too many ways of performing such
    tests, and I don't have a good grasp of their differences.  At first
    I converted them all to be static_cpu_has(): but that proved to be a
    mistake, as the comment in __native_flush_tlb_single() hints; so then
    I reversed and made them all this_cpu_has().  Probably all gratuitous
    change, but that's the way it's working at present.
    
    I am slightly bothered by the way non-per-cpu X86_CR3_PCID_KERN_VAR
    gets re-initialized by each cpu (before and after these changes):
    no problem when (as usual) all cpus on a machine have the same
    features, but in principle incorrect.  However, my experiment
    to per-cpu-ify that one did not end well...
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    0b5ca9d View commit details
    Browse the repository at this point in the history
  22. kaiser: PCID 0 for kernel and 128 for user

    Why was 4 chosen for kernel PCID and 6 for user PCID?
    No good reason in a backport where PCIDs are only used for Kaiser.
    
    If we continue with those, then we shall need to add Andy Lutomirski's
    4.13 commit 6c690ee ("x86/mm: Split read_cr3() into read_cr3_pa()
    and __read_cr3()"), which deals with the problem of read_cr3() callers
    finding stray bits in the cr3 that they expected to be page-aligned;
    and for hibernation, his 4.14 commit f34902c ("x86/hibernate/64:
    Mask off CR3's PCID bits in the saved CR3").
    
    But if 0 is used for kernel PCID, then there's no need to add in those
    commits - whenever the kernel looks, it sees 0 in the lower bits; and
    0 for kernel seems an obvious choice.
    
    And I naughtily propose 128 for user PCID.  Because there's a place
    in _SWITCH_TO_USER_CR3 where it takes note of the need for TLB FLUSH,
    but needs to reset that to NOFLUSH for the next occasion.  Currently
    it does so with a "movb $(0x80)" into the high byte of the per-cpu
    quadword, but that will cause a machine without PCID support to crash.
    Now, if %al just happened to have 0x80 in it at that point, on a
    machine with PCID support, but 0 on a machine without PCID support...
    
    (That will go badly wrong once the pgd can be at a physical address
    above 2^56, but even with 5-level paging, physical goes up to 2^52.)
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    6a2b411 View commit details
    Browse the repository at this point in the history
  23. kaiser: x86_cr3_pcid_noflush and x86_cr3_pcid_user

    Mostly this commit is just unshouting X86_CR3_PCID_KERN_VAR and
    X86_CR3_PCID_USER_VAR: we usually name variables in lower-case.
    
    But why does x86_cr3_pcid_noflush need to be __aligned(PAGE_SIZE)?
    Ah, it's a leftover from when kaiser_add_user_map() once complained
    about mapping the same page twice.  Make it __read_mostly instead.
    (I'm a little uneasy about all the unrelated data which shares its
    page getting user-mapped too, but that was so before, and not a big
    deal: though we call it user-mapped, it's not mapped with _PAGE_USER.)
    
    And there is a little change around the two calls to do_nmi().
    Previously they set the NOFLUSH bit (if PCID supported) when
    forcing to kernel context before do_nmi(); now they also have the
    NOFLUSH bit set (if PCID supported) when restoring context after:
    nothing done in do_nmi() should require a TLB to be flushed here.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    d0142ce View commit details
    Browse the repository at this point in the history
  24. kaiser: paranoid_entry pass cr3 need to paranoid_exit

    Neel Natu points out that paranoid_entry() was wrong to assume that
    an entry that did not need swapgs would not need SWITCH_KERNEL_CR3:
    paranoid_entry (used for debug breakpoint, int3, double fault or MCE;
    though I think it's only the MCE case that is cause for concern here)
    can break in at an awkward time, between cr3 switch and swapgs, but
    its handling always needs kernel gs and kernel cr3.
    
    Easy to fix in itself, but paranoid_entry() also needs to convey to
    paranoid_exit() (and my reading of macro idtentry says paranoid_entry
    and paranoid_exit are always paired) how to restore the prior state.
    The swapgs state is already conveyed by %ebx (0 or 1), so extend that
    also to convey when SWITCH_USER_CR3 will be needed (2 or 3).
    
    (Yes, I'd much prefer that 0 meant no swapgs, whereas it's the other
    way round: and a convention shared with error_entry() and error_exit(),
    which I don't want to touch.  Perhaps I should have inverted the bit
    for switch cr3 too, but did not.)
    
    paranoid_exit() would be straightforward, except for TRACE_IRQS: it
    did TRACE_IRQS_IRETQ when doing swapgs, but TRACE_IRQS_IRETQ_DEBUG
    when not: which is it supposed to use when SWITCH_USER_CR3 is split
    apart from that?  As best as I can determine, commit 5963e31
    ("ftrace/x86: Do not change stacks in DEBUG when calling lockdep")
    missed the swapgs case, and should have used TRACE_IRQS_IRETQ_DEBUG
    there too (the discrepancy has nothing to do with the liberal use
    of _NO_STACK and _UNSAFE_STACK hereabouts: TRACE_IRQS_OFF_DEBUG has
    just been used in all cases); discrepancy lovingly preserved across
    several paranoid_exit() cleanups, but I'm now removing it.
    
    Neel further indicates that to use SWITCH_USER_CR3_NO_STACK there in
    paranoid_exit() is now not only unnecessary but unsafe: might corrupt
    syscall entry's unsafe_stack_register_backup of %rax.  Just use
    SWITCH_USER_CR3: and delete SWITCH_USER_CR3_NO_STACK altogether,
    before we make the mistake of using it again.
    
    hughd adds: this commit fixes an issue in the Kaiser-without-PCIDs
    part of the series, and ought to be moved earlier, if you decided
    to make a release of Kaiser-without-PCIDs.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    05ddad1 View commit details
    Browse the repository at this point in the history
  25. kaiser: kaiser_remove_mapping() move along the pgd

    When removing the bogus comment from kaiser_remove_mapping(),
    I really ought to have checked the extent of its bogosity: as
    Neel points out, there is nothing to stop unmap_pud_range_nofree()
    from continuing beyond the end of a pud (and starting in the wrong
    position on the next).
    
    Fix kaiser_remove_mapping() to constrain the extent and advance pgd
    pointer correctly: use pgd_addr_end() macro as used throughout base
    mm (but don't assume page-rounded start and size in this case).
    
    But this bug was very unlikely to trigger in this backport: since
    any buddy allocation is contained within a single pud extent, and
    we are not using vmapped stacks (and are only mapping one page of
    stack anyway): the only way to hit this bug here would be when
    freeing a large modified ldt.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    3df1461 View commit details
    Browse the repository at this point in the history
  26. kaiser: fix unlikely error in alloc_ldt_struct()

    An error from kaiser_add_mapping() here is not at all likely, but
    Eric Biggers rightly points out that __free_ldt_struct() relies on
    new_ldt->size being initialized: move that up.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    cb7d8d7 View commit details
    Browse the repository at this point in the history
  27. kaiser: add "nokaiser" boot option, using ALTERNATIVE

    Added "nokaiser" boot option: an early param like "noinvpcid".
    Most places now check int kaiser_enabled (#defined 0 when not
    CONFIG_KAISER) instead of #ifdef CONFIG_KAISER; but entry_64.S
    and entry_64_compat.S are using the ALTERNATIVE technique, which
    patches in the preferred instructions at runtime.  That technique
    is tied to x86 cpu features, so X86_FEATURE_KAISER is fabricated.
    
    Prior to "nokaiser", Kaiser #defined _PAGE_GLOBAL 0: revert that,
    but be careful with both _PAGE_GLOBAL and CR4.PGE: setting them when
    nokaiser like when !CONFIG_KAISER, but not setting either when kaiser -
    neither matters on its own, but it's hard to be sure that _PAGE_GLOBAL
    won't get set in some obscure corner, or something add PGE into CR4.
    By omitting _PAGE_GLOBAL from __supported_pte_mask when kaiser_enabled,
    all page table setup which uses pte_pfn() masks it out of the ptes.
    
    It's slightly shameful that the same declaration versus definition of
    kaiser_enabled appears in not one, not two, but in three header files
    (asm/kaiser.h, asm/pgtable.h, asm/tlbflush.h).  I felt safer that way,
    than with #including any of those in any of the others; and did not
    feel it worth an asm/kaiser_enabled.h - kernel/cpu/common.c includes
    them all, so we shall hear about it if they get out of synch.
    
    Cleanups while in the area: removed the silly #ifdef CONFIG_KAISER
    from kaiser.c; removed the unused native_get_normal_pgd(); removed
    the spurious reg clutter from SWITCH_*_CR3 macro stubs; corrected some
    comments.  But more interestingly, set CR4.PSE in secondary_startup_64:
    the manual is clear that it does not matter whether it's 0 or 1 when
    4-level-pts are enabled, but I was distracted to find cr4 different on
    BSP and auxiliaries - BSP alone was adding PSE, in probe_page_size_mask().
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Acked-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    23e0943 View commit details
    Browse the repository at this point in the history
  28. x86/kaiser: Rename and simplify X86_FEATURE_KAISER handling

    Concentrate it in arch/x86/mm/kaiser.c and use the upstream string "nopti".
    
    Signed-off-by: Borislav Petkov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    suryasaimadhu authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    50624dd View commit details
    Browse the repository at this point in the history
  29. x86/kaiser: Check boottime cmdline params

    AMD (and possibly other vendors) are not affected by the leak
    KAISER is protecting against.
    
    Keep the "nopti" for traditional reasons and add pti=<on|off|auto>
    like upstream.
    
    Signed-off-by: Borislav Petkov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    suryasaimadhu authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    8018307 View commit details
    Browse the repository at this point in the history
  30. kaiser: use ALTERNATIVE instead of x86_cr3_pcid_noflush

    Now that we're playing the ALTERNATIVE game, use that more efficient
    method: instead of user-mapping an extra page, and reading an extra
    cacheline each time for x86_cr3_pcid_noflush.
    
    Neel has found that __stringify(bts $X86_CR3_PCID_NOFLUSH_BIT, %rax)
    is a working substitute for the "bts $63, %rax" in these ALTERNATIVEs;
    but the one line with $63 in looks clearer, so let's stick with that.
    
    Worried about what happens with an ALTERNATIVE between the jump and
    jump label in another ALTERNATIVE?  I was, but have checked the
    combinations in SWITCH_KERNEL_CR3_NO_STACK at entry_SYSCALL_64,
    and it does a good job.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Acked-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    169b369 View commit details
    Browse the repository at this point in the history
  31. kaiser: drop is_atomic arg to kaiser_pagetable_walk()

    I have not observed a might_sleep() warning from setup_fixmap_gdt()'s
    use of kaiser_add_mapping() in our tree (why not?), but like upstream
    we have not provided a way for that to pass is_atomic true down to
    kaiser_pagetable_walk(), and at startup it's far from a likely source
    of trouble: so just delete the walk's is_atomic arg and might_sleep().
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Acked-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    8c2f8a5 View commit details
    Browse the repository at this point in the history
  32. kaiser: asm/tlbflush.h handle noPGE at lower level

    I found asm/tlbflush.h too twisty, and think it safer not to avoid
    __native_flush_tlb_global_irq_disabled() in the kaiser_enabled case,
    but instead let it handle kaiser_enabled along with cr3: it can just
    use __native_flush_tlb() for that, no harm in re-disabling preemption.
    
    (This is not the same change as Kirill and Dave have suggested for
    upstream, flipping PGE in cr4: that's neat, but needs a cpu_has_pge
    check; cr3 is enough for kaiser, and thought to be cheaper than cr4.)
    
    Also delete the X86_FEATURE_INVPCID invpcid_flush_all_nonglobals()
    preference from __native_flush_tlb(): unlike the invpcid_flush_all()
    preference in __native_flush_tlb_global(), it's not seen in upstream
    4.14, and was recently reported to be surprisingly slow.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Acked-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    b72c26e View commit details
    Browse the repository at this point in the history
  33. kaiser: kaiser_flush_tlb_on_return_to_user() check PCID

    Let kaiser_flush_tlb_on_return_to_user() do the X86_FEATURE_PCID
    check, instead of each caller doing it inline first: nobody needs
    to optimize for the noPCID case, it's clearer this way, and better
    suits later changes.  Replace those no-op X86_CR3_PCID_KERN_FLUSH lines
    by a BUILD_BUG_ON() in load_new_mm_cr3(), in case something changes.
    
    Signed-off-by: Hugh Dickins <[email protected]>
    Acked-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Hugh Dickins authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    fe5cb75 View commit details
    Browse the repository at this point in the history
  34. x86/paravirt: Dont patch flush_tlb_single

    commit a035795 upstream
    
    native_flush_tlb_single() will be changed with the upcoming
    PAGE_TABLE_ISOLATION feature. This requires to have more code in
    there than INVLPG.
    
    Remove the paravirt patching for it.
    
    Signed-off-by: Thomas Gleixner <[email protected]>
    Reviewed-by: Josh Poimboeuf <[email protected]>
    Reviewed-by: Juergen Gross <[email protected]>
    Acked-by: Peter Zijlstra <[email protected]>
    Cc: Andy Lutomirski <[email protected]>
    Cc: Boris Ostrovsky <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Borislav Petkov <[email protected]>
    Cc: Brian Gerst <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: Dave Hansen <[email protected]>
    Cc: David Laight <[email protected]>
    Cc: Denys Vlasenko <[email protected]>
    Cc: Eduardo Valentin <[email protected]>
    Cc: Greg KH <[email protected]>
    Cc: H. Peter Anvin <[email protected]>
    Cc: Linus Torvalds <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Will Deacon <[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: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Ingo Molnar <[email protected]>
    Acked-by: Borislav Petkov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    KAGA-KOKO authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    1817d2c View commit details
    Browse the repository at this point in the history
  35. x86/kaiser: Reenable PARAVIRT

    Now that the required bits have been addressed, reenable
    PARAVIRT.
    
    Signed-off-by: Borislav Petkov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    suryasaimadhu authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    2c27217 View commit details
    Browse the repository at this point in the history
  36. kaiser: disabled on Xen PV

    Kaiser cannot be used on paravirtualized MMUs (namely reading and writing CR3).
    This does not work with KAISER as the CR3 switch from and to user space PGD
    would require to map the whole XEN_PV machinery into both.
    
    More importantly, enabling KAISER on Xen PV doesn't make too much sense, as PV
    guests use distinct %cr3 values for kernel and user already.
    
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Jiri Kosina authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    402e63d View commit details
    Browse the repository at this point in the history
  37. x86/kaiser: Move feature detection up

    ... before the first use of kaiser_enabled as otherwise funky
    things happen:
    
      about to get started...
      (XEN) d0v0 Unhandled page fault fault/trap [Freescale#14, ec=0000]
      (XEN) Pagetable walk from ffff88022a449090:
      (XEN)  L4[0x110] = 0000000229e0e067 0000000000001e0e
      (XEN)  L3[0x008] = 0000000000000000 ffffffffffffffff
      (XEN) domain_crash_sync called from entry.S: fault at ffff82d08033fd08
      entry.o#create_bounce_frame+0x135/0x14d
      (XEN) Domain 0 (vcpu#0) crashed on cpu#0:
      (XEN) ----[ Xen-4.9.1_02-3.21  x86_64  debug=n   Not tainted ]----
      (XEN) CPU:    0
      (XEN) RIP:    e033:[<ffffffff81007460>]
      (XEN) RFLAGS: 0000000000000286   EM: 1   CONTEXT: pv guest (d0v0)
    
    Signed-off-by: Borislav Petkov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    suryasaimadhu authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    59094fa View commit details
    Browse the repository at this point in the history
  38. KPTI: Rename to PAGE_TABLE_ISOLATION

    This renames CONFIG_KAISER to CONFIG_PAGE_TABLE_ISOLATION.
    
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kees authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    e71fac0 View commit details
    Browse the repository at this point in the history
  39. KPTI: Report when enabled

    Make sure dmesg reports when KPTI is enabled.
    
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    kees authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    ea6cd39 View commit details
    Browse the repository at this point in the history
  40. kaiser: Set _PAGE_NX only if supported

    This resolves a crash if loaded under qemu + haxm under windows.
    See https://www.spinics.net/lists/kernel/msg2689835.html for details.
    Here is a boot log (the log is from chromeos-4.4, but Tao Wu says that
    the same log is also seen with vanilla v4.4.110-rc1).
    
    [    0.712750] Freeing unused kernel memory: 552K
    [    0.721821] init: Corrupted page table at address 57b029b332e0
    [    0.722761] PGD 80000000bb238067 PUD bc36a067 PMD bc369067 PTE 45d2067
    [    0.722761] Bad pagetable: 000b [Freescale#1] PREEMPT SMP 
    [    0.722761] Modules linked in:
    [    0.722761] CPU: 1 PID: 1 Comm: init Not tainted 4.4.96 Freescale#31
    [    0.722761] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
    rel-1.7.5.1-0-g8936dbb-20141113_115728-nilsson.home.kraxel.org 04/01/2014
    [    0.722761] task: ffff8800bc290000 ti: ffff8800bc28c000 task.ti: ffff8800bc28c000
    [    0.722761] RIP: 0010:[<ffffffff83f4129e>]  [<ffffffff83f4129e>] __clear_user+0x42/0x67
    [    0.722761] RSP: 0000:ffff8800bc28fcf8  EFLAGS: 00010202
    [    0.722761] RAX: 0000000000000000 RBX: 00000000000001a4 RCX: 00000000000001a4
    [    0.722761] RDX: 0000000000000000 RSI: 0000000000000008 RDI: 000057b029b332e0
    [    0.722761] RBP: ffff8800bc28fd08 R08: ffff8800bc290000 R09: ffff8800bb2f4000
    [    0.722761] R10: ffff8800bc290000 R11: ffff8800bb2f4000 R12: 000057b029b332e0
    [    0.722761] R13: 0000000000000000 R14: 000057b029b33340 R15: ffff8800bb1e2a00
    [    0.722761] FS:  0000000000000000(0000) GS:ffff8800bfb00000(0000) knlGS:0000000000000000
    [    0.722761] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [    0.722761] CR2: 000057b029b332e0 CR3: 00000000bb2f8000 CR4: 00000000000006e0
    [    0.722761] Stack:
    [    0.722761]  000057b029b332e0 ffff8800bb95fa80 ffff8800bc28fd18 ffffffff83f4120c
    [    0.722761]  ffff8800bc28fe18 ffffffff83e9e7a1 ffff8800bc28fd68 0000000000000000
    [    0.722761]  ffff8800bc290000 ffff8800bc290000 ffff8800bc290000 ffff8800bc290000
    [    0.722761] Call Trace:
    [    0.722761]  [<ffffffff83f4120c>] clear_user+0x2e/0x30
    [    0.722761]  [<ffffffff83e9e7a1>] load_elf_binary+0xa7f/0x18f7
    [    0.722761]  [<ffffffff83de2088>] search_binary_handler+0x86/0x19c
    [    0.722761]  [<ffffffff83de389e>] do_execveat_common.isra.26+0x909/0xf98
    [    0.722761]  [<ffffffff844febe0>] ? rest_init+0x87/0x87
    [    0.722761]  [<ffffffff83de40be>] do_execve+0x23/0x25
    [    0.722761]  [<ffffffff83c002e3>] run_init_process+0x2b/0x2d
    [    0.722761]  [<ffffffff844fec4d>] kernel_init+0x6d/0xda
    [    0.722761]  [<ffffffff84505b2f>] ret_from_fork+0x3f/0x70
    [    0.722761]  [<ffffffff844febe0>] ? rest_init+0x87/0x87
    [    0.722761] Code: 86 84 be 12 00 00 00 e8 87 0d e8 ff 66 66 90 48 89 d8 48 c1
    eb 03 4c 89 e7 83 e0 07 48 89 d9 be 08 00 00 00 31 d2 48 85 c9 74 0a <48> 89 17
    48 01 f7 ff c9 75 f6 48 89 c1 85 c9 74 09 88 17 48 ff 
    [    0.722761] RIP  [<ffffffff83f4129e>] __clear_user+0x42/0x67
    [    0.722761]  RSP <ffff8800bc28fcf8>
    [    0.722761] ---[ end trace def703879b4ff090 ]---
    [    0.722761] BUG: sleeping function called from invalid context at /mnt/host/source/src/third_party/kernel/v4.4/kernel/locking/rwsem.c:21
    [    0.722761] in_atomic(): 0, irqs_disabled(): 1, pid: 1, name: init
    [    0.722761] CPU: 1 PID: 1 Comm: init Tainted: G      D         4.4.96 Freescale#31
    [    0.722761] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.7.5.1-0-g8936dbb-20141113_115728-nilsson.home.kraxel.org 04/01/2014
    [    0.722761]  0000000000000086 dcb5d76098c89836 ffff8800bc28fa30 ffffffff83f34004
    [    0.722761]  ffffffff84839dc2 0000000000000015 ffff8800bc28fa40 ffffffff83d57dc9
    [    0.722761]  ffff8800bc28fa68 ffffffff83d57e6a ffffffff84a53640 0000000000000000
    [    0.722761] Call Trace:
    [    0.722761]  [<ffffffff83f34004>] dump_stack+0x4d/0x63
    [    0.722761]  [<ffffffff83d57dc9>] ___might_sleep+0x13a/0x13c
    [    0.722761]  [<ffffffff83d57e6a>] __might_sleep+0x9f/0xa6
    [    0.722761]  [<ffffffff84502788>] down_read+0x20/0x31
    [    0.722761]  [<ffffffff83cc5d9b>] __blocking_notifier_call_chain+0x35/0x63
    [    0.722761]  [<ffffffff83cc5ddd>] blocking_notifier_call_chain+0x14/0x16
    [    0.800374] usb 1-1: new full-speed USB device number 2 using uhci_hcd
    [    0.722761]  [<ffffffff83cefe97>] profile_task_exit+0x1a/0x1c
    [    0.802309]  [<ffffffff83cac84e>] do_exit+0x39/0xe7f
    [    0.802309]  [<ffffffff83ce5938>] ? vprintk_default+0x1d/0x1f
    [    0.802309]  [<ffffffff83d7bb95>] ? printk+0x57/0x73
    [    0.802309]  [<ffffffff83c46e25>] oops_end+0x80/0x85
    [    0.802309]  [<ffffffff83c7b747>] pgtable_bad+0x8a/0x95
    [    0.802309]  [<ffffffff83ca7f4a>] __do_page_fault+0x8c/0x352
    [    0.802309]  [<ffffffff83eefba5>] ? file_has_perm+0xc4/0xe5
    [    0.802309]  [<ffffffff83ca821c>] do_page_fault+0xc/0xe
    [    0.802309]  [<ffffffff84507682>] page_fault+0x22/0x30
    [    0.802309]  [<ffffffff83f4129e>] ? __clear_user+0x42/0x67
    [    0.802309]  [<ffffffff83f4127f>] ? __clear_user+0x23/0x67
    [    0.802309]  [<ffffffff83f4120c>] clear_user+0x2e/0x30
    [    0.802309]  [<ffffffff83e9e7a1>] load_elf_binary+0xa7f/0x18f7
    [    0.802309]  [<ffffffff83de2088>] search_binary_handler+0x86/0x19c
    [    0.802309]  [<ffffffff83de389e>] do_execveat_common.isra.26+0x909/0xf98
    [    0.802309]  [<ffffffff844febe0>] ? rest_init+0x87/0x87
    [    0.802309]  [<ffffffff83de40be>] do_execve+0x23/0x25
    [    0.802309]  [<ffffffff83c002e3>] run_init_process+0x2b/0x2d
    [    0.802309]  [<ffffffff844fec4d>] kernel_init+0x6d/0xda
    [    0.802309]  [<ffffffff84505b2f>] ret_from_fork+0x3f/0x70
    [    0.802309]  [<ffffffff844febe0>] ? rest_init+0x87/0x87
    [    0.830559] Kernel panic - not syncing: Attempted to kill init!  exitcode=0x00000009
    [    0.830559] 
    [    0.831305] Kernel Offset: 0x2c00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
    [    0.831305] ---[ end Kernel panic - not syncing: Attempted to kill init!  exitcode=0x00000009
    
    The crash part of this problem may be solved with the following patch
    (thanks to Hugh for the hint). There is still another problem, though -
    with this patch applied, the qemu session aborts with "VCPU Shutdown
    request", whatever that means.
    
    Cc: lepton <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Guenter Roeck authored and gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    92fd81f View commit details
    Browse the repository at this point in the history
  41. Linux 4.9.75

    gregkh committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    9f74755 View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2018

  1. kernel/acct.c: fix the acct->needcheck check in check_free_space()

    commit 4d95701 upstream.
    
    As Tsukada explains, the time_is_before_jiffies(acct->needcheck) check
    is very wrong, we need time_is_after_jiffies() to make sys_acct() work.
    
    Ignoring the overflows, the code should "goto out" if needcheck >
    jiffies, while currently it checks "needcheck < jiffies" and thus in the
    likely case check_free_space() does nothing until jiffies overflow.
    
    In particular this means that sys_acct() is simply broken, acct_on()
    sets acct->needcheck = jiffies and expects that check_free_space()
    should set acct->active = 1 after the free-space check, but this won't
    happen if jiffies increments in between.
    
    This was broken by commit 32dc730 ("get rid of timer in
    kern/acct.c") in 2011, then another (correct) commit 795a2f2
    ("acct() should honour the limits from the very beginning") made the
    problem more visible.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Fixes: 32dc730 ("get rid of timer in kern/acct.c")
    Reported-by: TSUKADA Koutaro <[email protected]>
    Suggested-by: TSUKADA Koutaro <[email protected]>
    Signed-off-by: Oleg Nesterov <[email protected]>
    Cc: Al Viro <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    oleg-nesterov authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    790080c View commit details
    Browse the repository at this point in the history
  2. crypto: n2 - cure use after free

    commit 203f450 upstream.
    
    queue_cache_init is first called for the Control Word Queue
    (n2_crypto_probe). At that time, queue_cache[0] is NULL and a new
    kmem_cache will be allocated. If the subsequent n2_register_algs call
    fails, the kmem_cache will be released in queue_cache_destroy, but
    queue_cache_init[0] is not set back to NULL.
    
    So when the Module Arithmetic Unit gets probed next (n2_mau_probe),
    queue_cache_init will not allocate a kmem_cache again, but leave it
    as its bogus value, causing a BUG() to trigger when queue_cache[0] is
    eventually passed to kmem_cache_zalloc:
    
    	n2_crypto: Found N2CP at /virtual-devices@100/n2cp@7
    	n2_crypto: Registered NCS HVAPI version 2.0
    	called queue_cache_init
    	n2_crypto: md5 alg registration failed
    	n2cp f028687c: /virtual-devices@100/n2cp@7: Unable to register algorithms.
    	called queue_cache_destroy
    	n2cp: probe of f028687c failed with error -22
    	n2_crypto: Found NCP at /virtual-devices@100/ncp@6
    	n2_crypto: Registered NCS HVAPI version 2.0
    	called queue_cache_init
    	kernel BUG at mm/slab.c:2993!
    	Call Trace:
    	 [0000000000604488] kmem_cache_alloc+0x1a8/0x1e0
                      (inlined) kmem_cache_zalloc
                      (inlined) new_queue
                      (inlined) spu_queue_setup
                      (inlined) handle_exec_unit
    	 [0000000010c61eb4] spu_mdesc_scan+0x1f4/0x460 [n2_crypto]
    	 [0000000010c62b80] n2_mau_probe+0x100/0x220 [n2_crypto]
    	 [000000000084b174] platform_drv_probe+0x34/0xc0
    
    Signed-off-by: Jan Engelhardt <[email protected]>
    Acked-by: David S. Miller <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    jengelh authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    f6db86f View commit details
    Browse the repository at this point in the history
  3. crypto: chacha20poly1305 - validate the digest size

    commit e57121d upstream.
    
    If the rfc7539 template was instantiated with a hash algorithm with
    digest size larger than 16 bytes (POLY1305_DIGEST_SIZE), then the digest
    overran the 'tag' buffer in 'struct chachapoly_req_ctx', corrupting the
    subsequent memory, including 'cryptlen'.  This caused a crash during
    crypto_skcipher_decrypt().
    
    Fix it by, when instantiating the template, requiring that the
    underlying hash algorithm has the digest size expected for Poly1305.
    
    Reproducer:
    
        #include <linux/if_alg.h>
        #include <sys/socket.h>
        #include <unistd.h>
    
        int main()
        {
                int algfd, reqfd;
                struct sockaddr_alg addr = {
                        .salg_type = "aead",
                        .salg_name = "rfc7539(chacha20,sha256)",
                };
                unsigned char buf[32] = { 0 };
    
                algfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
                bind(algfd, (void *)&addr, sizeof(addr));
                setsockopt(algfd, SOL_ALG, ALG_SET_KEY, buf, sizeof(buf));
                reqfd = accept(algfd, 0, 0);
                write(reqfd, buf, 16);
                read(reqfd, buf, 16);
        }
    
    Reported-by: syzbot <[email protected]>
    Fixes: 71ebc4d ("crypto: chacha20poly1305 - Add a ChaCha20-Poly1305 AEAD construction, RFC7539")
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ebiggers authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    868f50b View commit details
    Browse the repository at this point in the history
  4. crypto: pcrypt - fix freeing pcrypt instances

    commit d76c681 upstream.
    
    pcrypt is using the old way of freeing instances, where the ->free()
    method specified in the 'struct crypto_template' is passed a pointer to
    the 'struct crypto_instance'.  But the crypto_instance is being
    kfree()'d directly, which is incorrect because the memory was actually
    allocated as an aead_instance, which contains the crypto_instance at a
    nonzero offset.  Thus, the wrong pointer was being kfree()'d.
    
    Fix it by switching to the new way to free aead_instance's where the
    ->free() method is specified in the aead_instance itself.
    
    Reported-by: syzbot <[email protected]>
    Fixes: 0496f56 ("crypto: pcrypt - Add support for new AEAD interface")
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    ebiggers authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    c195a4c View commit details
    Browse the repository at this point in the history
  5. sunxi-rsb: Include OF based modalias in device uevent

    commit e2bf801 upstream.
    
    Include the OF-based modalias in the uevent sent when registering devices
    on the sunxi RSB bus, so that user space has a chance to autoload the
    kernel module for the device.
    
    Fixes a regression caused by commit 3f241bf ("arm64: allwinner: a64:
    pine64: Use dcdc1 regulator for mmc0"). When the axp20x-rsb module for
    the AXP803 PMIC is built as a module, it is not loaded and the system
    ends up with an disfunctional MMC controller.
    
    Fixes: d787dcd ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus")
    Acked-by: Chen-Yu Tsai <[email protected]>
    Signed-off-by: Stefan Brüns <[email protected]>
    Signed-off-by: Maxime Ripard <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    StefanBruens authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    34fa2ee View commit details
    Browse the repository at this point in the history
  6. fscache: Fix the default for fscache_maybe_release_page()

    commit 9880150 upstream.
    
    Fix the default for fscache_maybe_release_page() for when the cookie isn't
    valid or the page isn't cached.  It mustn't return false as that indicates
    the page cannot yet be freed.
    
    The problem with the default is that if, say, there's no cache, but a
    network filesystem's pages are using up almost all the available memory, a
    system can OOM because the filesystem ->releasepage() op will not allow
    them to be released as fscache_maybe_release_page() incorrectly prevents
    it.
    
    This can be tested by writing a sequence of 512MiB files to an AFS mount.
    It does not affect NFS or CIFS because both of those wrap the call in a
    check of PG_fscache and it shouldn't bother Ceph as that only has
    PG_private set whilst writeback is in progress.  This might be an issue for
    9P, however.
    
    Note that the pages aren't entirely stuck.  Removing a file or unmounting
    will clear things because that uses ->invalidatepage() instead.
    
    Fixes: 201a154 ("FS-Cache: Handle pages pending storage that get evicted under OOM conditions")
    Reported-by: Marc Dionne <[email protected]>
    Signed-off-by: David Howells <[email protected]>
    Reviewed-by: Jeff Layton <[email protected]>
    Acked-by: Al Viro <[email protected]>
    Tested-by: Marc Dionne <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    dhowells authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    2b9b200 View commit details
    Browse the repository at this point in the history
  7. nbd: fix use-after-free of rq/bio in the xmit path

    commit 429a787 upstream.
    
    For writes, we can get a completion in while we're still iterating
    the request and bio chain. If that happens, we're reading freed
    memory and we can crash.
    
    Break out after the last segment and avoid having the iterator
    read freed memory.
    
    Reviewed-by: Josef Bacik <[email protected]>
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    axboe authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    3a381ab View commit details
    Browse the repository at this point in the history
  8. kernel: make groups_sort calling a responsibility group_info allocators

    commit bdcf0a4 upstream.
    
    In testing, we found that nfsd threads may call set_groups in parallel
    for the same entry cached in auth.unix.gid, racing in the call of
    groups_sort, corrupting the groups for that entry and leading to
    permission denials for the client.
    
    This patch:
     - Make groups_sort globally visible.
     - Move the call to groups_sort to the modifiers of group_info
     - Remove the call to groups_sort from set_groups
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Thiago Rafael Becker <[email protected]>
    Reviewed-by: Matthew Wilcox <[email protected]>
    Reviewed-by: NeilBrown <[email protected]>
    Acked-by: "J. Bruce Fields" <[email protected]>
    Cc: Al Viro <[email protected]>
    Cc: Martin Schwidefsky <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    trbecker authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    79258d9 View commit details
    Browse the repository at this point in the history
  9. kernel/signal.c: protect the traced SIGNAL_UNKILLABLE tasks from SIGKILL

    commit 628c1bc upstream.
    
    The comment in sig_ignored() says "Tracers may want to know about even
    ignored signals" but SIGKILL can not be reported to debugger and it is
    just wrong to return 0 in this case: SIGKILL should only kill the
    SIGNAL_UNKILLABLE task if it comes from the parent ns.
    
    Change sig_ignored() to ignore ->ptrace if sig == SIGKILL and rely on
    sig_task_ignored().
    
    SISGTOP coming from within the namespace is not really right too but at
    least debugger can intercept it, and we can't drop it here because this
    will break "gdb -p 1": ptrace_attach() won't work.  Perhaps we will add
    another ->ptrace check later, we will see.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Oleg Nesterov <[email protected]>
    Tested-by: Kyle Huey <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    oleg-nesterov authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    1453b3a View commit details
    Browse the repository at this point in the history
  10. kernel/signal.c: protect the SIGNAL_UNKILLABLE tasks from !sig_kernel…

    …_only() signals
    
    commit ac25385 upstream.
    
    Change sig_task_ignored() to drop the SIG_DFL && !sig_kernel_only()
    signals even if force == T.  This simplifies the next change and this
    matches the same check in get_signal() which will drop these signals
    anyway.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Oleg Nesterov <[email protected]>
    Tested-by: Kyle Huey <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    oleg-nesterov authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    794ac8e View commit details
    Browse the repository at this point in the history
  11. kernel/signal.c: remove the no longer needed SIGNAL_UNKILLABLE check …

    …in complete_signal()
    
    commit 4269157 upstream.
    
    complete_signal() checks SIGNAL_UNKILLABLE before it starts to destroy
    the thread group, today this is wrong in many ways.
    
    If nothing else, fatal_signal_pending() should always imply that the
    whole thread group (except ->group_exit_task if it is not NULL) is
    killed, this check breaks the rule.
    
    After the previous changes we can rely on sig_task_ignored();
    sig_fatal(sig) && SIGNAL_UNKILLABLE can only be true if we actually want
    to kill this task and sig == SIGKILL OR it is traced and debugger can
    intercept the signal.
    
    This should hopefully fix the problem reported by Dmitry.  This
    test-case
    
    	static int init(void *arg)
    	{
    		for (;;)
    			pause();
    	}
    
    	int main(void)
    	{
    		char stack[16 * 1024];
    
    		for (;;) {
    			int pid = clone(init, stack + sizeof(stack)/2,
    					CLONE_NEWPID | SIGCHLD, NULL);
    			assert(pid > 0);
    
    			assert(ptrace(PTRACE_ATTACH, pid, 0, 0) == 0);
    			assert(waitpid(-1, NULL, WSTOPPED) == pid);
    
    			assert(ptrace(PTRACE_DETACH, pid, 0, SIGSTOP) == 0);
    			assert(syscall(__NR_tkill, pid, SIGKILL) == 0);
    			assert(pid == wait(NULL));
    		}
    	}
    
    triggers the WARN_ON_ONCE(!(task->jobctl & JOBCTL_STOP_PENDING)) in
    task_participate_group_stop().  do_signal_stop()->signal_group_exit()
    checks SIGNAL_GROUP_EXIT and return false, but task_set_jobctl_pending()
    checks fatal_signal_pending() and does not set JOBCTL_STOP_PENDING.
    
    And his should fix the minor security problem reported by Kyle,
    SECCOMP_RET_TRACE can miss fatal_signal_pending() the same way if the
    task is the root of a pid namespace.
    
    Link: http://lkml.kernel.org/r/[email protected]
    Signed-off-by: Oleg Nesterov <[email protected]>
    Reported-by: Dmitry Vyukov <[email protected]>
    Reported-by: Kyle Huey <[email protected]>
    Reviewed-by: Kees Cook <[email protected]>
    Tested-by: Kyle Huey <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    oleg-nesterov authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    4d53eb4 View commit details
    Browse the repository at this point in the history
  12. iommu/arm-smmu-v3: Don't free page table ops twice

    commit 57d72e1 upstream.
    
    Kasan reports a double free when finalise_stage_fn fails: the io_pgtable
    ops are freed by arm_smmu_domain_finalise and then again by
    arm_smmu_domain_free. Prevent this by leaving pgtbl_ops empty on failure.
    
    Fixes: 48ec83b ("iommu/arm-smmu: Add initial driver support for ARM SMMUv3 devices")
    Reviewed-by: Robin Murphy <[email protected]>
    Signed-off-by: Jean-Philippe Brucker <[email protected]>
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Jean-Philippe Brucker authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    03975fa View commit details
    Browse the repository at this point in the history
  13. iommu/arm-smmu-v3: Cope with duplicated Stream IDs

    commit 563b5cb upstream.
    
    For PCI devices behind an aliasing PCIe-to-PCI/X bridge, the bridge
    alias to DevFn 0.0 on the subordinate bus may match the original RID of
    the device, resulting in the same SID being present in the device's
    fwspec twice. This causes trouble later in arm_smmu_write_strtab_ent()
    when we wind up visiting the STE a second time and find it already live.
    
    Avoid the issue by giving arm_smmu_install_ste_for_dev() the cleverness
    to skip over duplicates. It seems mildly counterintuitive compared to
    preventing the duplicates from existing in the first place, but since
    the DT and ACPI probe paths build their fwspecs differently, this is
    actually the cleanest and most self-contained way to deal with it.
    
    Fixes: 8f78515 ("iommu/arm-smmu: Implement of_xlate() for SMMUv3")
    Reported-by: Tomasz Nowicki <[email protected]>
    Tested-by: Tomasz Nowicki <[email protected]>
    Tested-by: Jayachandran C. <[email protected]>
    Signed-off-by: Robin Murphy <[email protected]>
    Signed-off-by: Will Deacon <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    rmurphy-arm authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    e6a897a View commit details
    Browse the repository at this point in the history
  14. ARC: uaccess: dont use "l" gcc inline asm constraint modifier

    commit 79435ac upstream.
    
    This used to setup the LP_COUNT register automatically, but now has been
    removed.
    
    There was an earlier fix 3c7c7a2 which fixed instance in delay.h but
    somehow missed this one as gcc change had not made its way into
    production toolchains and was not pedantic as it is now !
    
    Signed-off-by: Vineet Gupta <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    vineetgarc authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    cc1349f View commit details
    Browse the repository at this point in the history
  15. Input: elantech - add new icbody type 15

    commit 10d9003 upstream.
    
    The touchpad of Lenovo Thinkpad L480 reports it's version as 15.
    
    Signed-off-by: Aaron Ma <[email protected]>
    Signed-off-by: Dmitry Torokhov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    pyma1 authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    2b009d3 View commit details
    Browse the repository at this point in the history
  16. x86/microcode/AMD: Add support for fam17h microcode loading

    commit f4e9b7a upstream.
    
    The size for the Microcode Patch Block (MPB) for an AMD family 17h
    processor is 3200 bytes.  Add a #define for fam17h so that it does
    not default to 2048 bytes and fail a microcode load/update.
    
    Signed-off-by: Tom Lendacky <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Reviewed-by: Borislav Petkov <[email protected]>
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Ingo Molnar <[email protected]>
    Cc: Alice Ferrazzi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    tlendacky authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    dd43c46 View commit details
    Browse the repository at this point in the history
  17. parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel

    commit 88776c0 upstream.
    
    Qemu for PARISC reported on a 32bit SMP parisc kernel strange failures
    about "Not-handled unaligned insn 0x0e8011d6 and 0x0c2011c9."
    
    Those opcodes evaluate to the ldcw() assembly instruction which requires
    (on 32bit) an alignment of 16 bytes to ensure atomicity.
    
    As it turns out, qemu is correct and in our assembly code in entry.S and
    pacache.S we don't pay attention to the required alignment.
    
    This patch fixes the problem by aligning the lock offset in assembly
    code in the same manner as we do in our C-code.
    
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hdeller authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    14c0620 View commit details
    Browse the repository at this point in the history
  18. parisc: qemu idle sleep support

    commit 310d827 upstream.
    
    Add qemu idle sleep support when running under qemu with SeaBIOS PDC
    firmware.
    
    Like the power architecture we use the "or" assembler instructions,
    which translate to nops on real hardware, to indicate that qemu shall
    idle sleep.
    
    Signed-off-by: Helge Deller <[email protected]>
    Cc: Richard Henderson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    hdeller authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    91dfc41 View commit details
    Browse the repository at this point in the history
  19. x86/tlb: Drop the _GPL from the cpu_tlbstate export

    commit 1e54768 upstream.
    
    The recent changes for PTI touch cpu_tlbstate from various tlb_flush
    inlines. cpu_tlbstate is exported as GPL symbol, so this causes a
    regression when building out of tree drivers for certain graphics cards.
    
    Aside of that the export was wrong since it was introduced as it should
    have been EXPORT_PER_CPU_SYMBOL_GPL().
    
    Use the correct PER_CPU export and drop the _GPL to restore the previous
    state which allows users to utilize the cards they payed for.
    
    As always I'm really thrilled to make this kind of change to support the
    #friends (or however the hot hashtag of today is spelled) from that closet
    sauce graphics corp.
    
    Fixes: 1e02ce4 ("x86: Store a per-cpu shadow copy of CR4")
    Fixes: 6fd166a ("x86/mm: Use/Fix PCID to optimize user/kernel switches")
    Reported-by: Kees Cook <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Cc: Peter Zijlstra <[email protected]>
    Cc: Andy Lutomirski <[email protected]>
    Cc: Thomas Backlund <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    KAGA-KOKO authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    47f3cea View commit details
    Browse the repository at this point in the history
  20. Map the vsyscall page with _PAGE_USER

    This needs to happen early in kaiser_pagetable_walk(), before the
    hierarchy is established so that _PAGE_USER permission can be really
    set.
    
    A proper fix would be to teach kaiser_pagetable_walk() to update those
    permissions but the vsyscall page is the only exception here so ...
    
    Signed-off-by: Borislav Petkov <[email protected]>
    Acked-by: Hugh Dickins <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    suryasaimadhu authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    beca4e2 View commit details
    Browse the repository at this point in the history
  21. mtd: nand: pxa3xx: Fix READOOB implementation

    commit fee4380 upstream.
    
    In the current driver, OOB bytes are accessed in raw mode, and when a
    page access is done with NDCR_SPARE_EN set and NDCR_ECC_EN cleared, the
    driver must read the whole spare area (64 bytes in case of a 2k page,
    16 bytes for a 512 page). The driver was only reading the free OOB
    bytes, which was leaving some unread data in the FIFO and was somehow
    leading to a timeout.
    
    We could patch the driver to read ->spare_size + ->ecc_size instead of
    just ->spare_size when READOOB is requested, but we'd better make
    in-band and OOB accesses consistent.
    Since the driver is always accessing in-band data in non-raw mode (with
    the ECC engine enabled), we should also access OOB data in this mode.
    That's particularly useful when using the BCH engine because in this
    mode the free OOB bytes are also ECC protected.
    
    Fixes: 43bcfd2 ("mtd: nand: pxa3xx: Add driver-specific ECC BCH support")
    Reported-by: Sean Nyekjær <[email protected]>
    Tested-by: Willy Tarreau <[email protected]>
    Signed-off-by: Boris Brezillon <[email protected]>
    Acked-by: Ezequiel Garcia <[email protected]>
    Tested-by: Sean Nyekjaer <[email protected]>
    Acked-by: Robert Jarzmik <[email protected]>
    Signed-off-by: Richard Weinberger <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Boris Brezillon authored and gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    5e1f377 View commit details
    Browse the repository at this point in the history
  22. Linux 4.9.76

    gregkh committed Jan 10, 2018
    Configuration menu
    Copy the full SHA
    7bbc6ca View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2018

  1. Merge tag 'v4.9.76' into 4.9-1.0.x-imx-stable-merge

    This is the 4.9.76 stable release
    
    Resolved conflicts
          drivers/clk/imx/clk-imx6q.c
          drivers/net/ethernet/freescale/fec_main.c
    Stefan Agner committed Jan 24, 2018
    Configuration menu
    Copy the full SHA
    0710597 View commit details
    Browse the repository at this point in the history