18 Oct, 2018

1 commit

  • [ Upstream commit d4859d749aa7090ffb743d15648adb962a1baeae ]

    Syzkaller reported this on a slightly older kernel but it's still
    applicable to the current kernel -

    ======================================================
    WARNING: possible circular locking dependency detected
    4.18.0-next-20180823+ #46 Not tainted
    ------------------------------------------------------
    syz-executor4/26841 is trying to acquire lock:
    00000000dd41ef48 ((wq_completion)bond_dev->name){+.+.}, at: flush_workqueue+0x2db/0x1e10 kernel/workqueue.c:2652

    but task is already holding lock:
    00000000768ab431 (rtnl_mutex){+.+.}, at: rtnl_lock net/core/rtnetlink.c:77 [inline]
    00000000768ab431 (rtnl_mutex){+.+.}, at: rtnetlink_rcv_msg+0x412/0xc30 net/core/rtnetlink.c:4708

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #2 (rtnl_mutex){+.+.}:
    __mutex_lock_common kernel/locking/mutex.c:925 [inline]
    __mutex_lock+0x171/0x1700 kernel/locking/mutex.c:1073
    mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1088
    rtnl_lock+0x17/0x20 net/core/rtnetlink.c:77
    bond_netdev_notify drivers/net/bonding/bond_main.c:1310 [inline]
    bond_netdev_notify_work+0x44/0xd0 drivers/net/bonding/bond_main.c:1320
    process_one_work+0xc73/0x1aa0 kernel/workqueue.c:2153
    worker_thread+0x189/0x13c0 kernel/workqueue.c:2296
    kthread+0x35a/0x420 kernel/kthread.c:246
    ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:415

    -> #1 ((work_completion)(&(&nnw->work)->work)){+.+.}:
    process_one_work+0xc0b/0x1aa0 kernel/workqueue.c:2129
    worker_thread+0x189/0x13c0 kernel/workqueue.c:2296
    kthread+0x35a/0x420 kernel/kthread.c:246
    ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:415

    -> #0 ((wq_completion)bond_dev->name){+.+.}:
    lock_acquire+0x1e4/0x4f0 kernel/locking/lockdep.c:3901
    flush_workqueue+0x30a/0x1e10 kernel/workqueue.c:2655
    drain_workqueue+0x2a9/0x640 kernel/workqueue.c:2820
    destroy_workqueue+0xc6/0x9d0 kernel/workqueue.c:4155
    __alloc_workqueue_key+0xef9/0x1190 kernel/workqueue.c:4138
    bond_init+0x269/0x940 drivers/net/bonding/bond_main.c:4734
    register_netdevice+0x337/0x1100 net/core/dev.c:8410
    bond_newlink+0x49/0xa0 drivers/net/bonding/bond_netlink.c:453
    rtnl_newlink+0xef4/0x1d50 net/core/rtnetlink.c:3099
    rtnetlink_rcv_msg+0x46e/0xc30 net/core/rtnetlink.c:4711
    netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2454
    rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4729
    netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
    netlink_unicast+0x5a0/0x760 net/netlink/af_netlink.c:1343
    netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1908
    sock_sendmsg_nosec net/socket.c:622 [inline]
    sock_sendmsg+0xd5/0x120 net/socket.c:632
    ___sys_sendmsg+0x7fd/0x930 net/socket.c:2115
    __sys_sendmsg+0x11d/0x290 net/socket.c:2153
    __do_sys_sendmsg net/socket.c:2162 [inline]
    __se_sys_sendmsg net/socket.c:2160 [inline]
    __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2160
    do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
    entry_SYSCALL_64_after_hwframe+0x49/0xbe

    other info that might help us debug this:

    Chain exists of:
    (wq_completion)bond_dev->name --> (work_completion)(&(&nnw->work)->work) --> rtnl_mutex

    Possible unsafe locking scenario:

    CPU0 CPU1
    ---- ----
    lock(rtnl_mutex);
    lock((work_completion)(&(&nnw->work)->work));
    lock(rtnl_mutex);
    lock((wq_completion)bond_dev->name);

    *** DEADLOCK ***

    1 lock held by syz-executor4/26841:

    stack backtrace:
    CPU: 1 PID: 26841 Comm: syz-executor4 Not tainted 4.18.0-next-20180823+ #46
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
    __dump_stack lib/dump_stack.c:77 [inline]
    dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
    print_circular_bug.isra.34.cold.55+0x1bd/0x27d kernel/locking/lockdep.c:1222
    check_prev_add kernel/locking/lockdep.c:1862 [inline]
    check_prevs_add kernel/locking/lockdep.c:1975 [inline]
    validate_chain kernel/locking/lockdep.c:2416 [inline]
    __lock_acquire+0x3449/0x5020 kernel/locking/lockdep.c:3412
    lock_acquire+0x1e4/0x4f0 kernel/locking/lockdep.c:3901
    flush_workqueue+0x30a/0x1e10 kernel/workqueue.c:2655
    drain_workqueue+0x2a9/0x640 kernel/workqueue.c:2820
    destroy_workqueue+0xc6/0x9d0 kernel/workqueue.c:4155
    __alloc_workqueue_key+0xef9/0x1190 kernel/workqueue.c:4138
    bond_init+0x269/0x940 drivers/net/bonding/bond_main.c:4734
    register_netdevice+0x337/0x1100 net/core/dev.c:8410
    bond_newlink+0x49/0xa0 drivers/net/bonding/bond_netlink.c:453
    rtnl_newlink+0xef4/0x1d50 net/core/rtnetlink.c:3099
    rtnetlink_rcv_msg+0x46e/0xc30 net/core/rtnetlink.c:4711
    netlink_rcv_skb+0x172/0x440 net/netlink/af_netlink.c:2454
    rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:4729
    netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline]
    netlink_unicast+0x5a0/0x760 net/netlink/af_netlink.c:1343
    netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1908
    sock_sendmsg_nosec net/socket.c:622 [inline]
    sock_sendmsg+0xd5/0x120 net/socket.c:632
    ___sys_sendmsg+0x7fd/0x930 net/socket.c:2115
    __sys_sendmsg+0x11d/0x290 net/socket.c:2153
    __do_sys_sendmsg net/socket.c:2162 [inline]
    __se_sys_sendmsg net/socket.c:2160 [inline]
    __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2160
    do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
    entry_SYSCALL_64_after_hwframe+0x49/0xbe
    RIP: 0033:0x457089
    Code: fd b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 3d 01 f0 ff ff 0f 83 cb b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00
    RSP: 002b:00007f2df20a5c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
    RAX: ffffffffffffffda RBX: 00007f2df20a66d4 RCX: 0000000000457089
    RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003
    RBP: 0000000000930140 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
    R13: 00000000004d40b8 R14: 00000000004c8ad8 R15: 0000000000000001

    Signed-off-by: Mahesh Bandewar
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Mahesh Bandewar
     

13 Oct, 2018

2 commits

  • commit c7cdff0e864713a089d7cb3a2b1136ba9a54881a upstream.

    fill_balloon doing memory allocations under balloon_lock
    can cause a deadlock when leak_balloon is called from
    virtballoon_oom_notify and tries to take same lock.

    To fix, split page allocation and enqueue and do allocations outside the lock.

    Here's a detailed analysis of the deadlock by Tetsuo Handa:

    In leak_balloon(), mutex_lock(&vb->balloon_lock) is called in order to
    serialize against fill_balloon(). But in fill_balloon(),
    alloc_page(GFP_HIGHUSER[_MOVABLE] | __GFP_NOMEMALLOC | __GFP_NORETRY) is
    called with vb->balloon_lock mutex held. Since GFP_HIGHUSER[_MOVABLE]
    implies __GFP_DIRECT_RECLAIM | __GFP_IO | __GFP_FS, despite __GFP_NORETRY
    is specified, this allocation attempt might indirectly depend on somebody
    else's __GFP_DIRECT_RECLAIM memory allocation. And such indirect
    __GFP_DIRECT_RECLAIM memory allocation might call leak_balloon() via
    virtballoon_oom_notify() via blocking_notifier_call_chain() callback via
    out_of_memory() when it reached __alloc_pages_may_oom() and held oom_lock
    mutex. Since vb->balloon_lock mutex is already held by fill_balloon(), it
    will cause OOM lockup.

    Thread1 Thread2
    fill_balloon()
    takes a balloon_lock
    balloon_page_enqueue()
    alloc_page(GFP_HIGHUSER_MOVABLE)
    direct reclaim (__GFP_FS context) takes a fs lock
    waits for that fs lock alloc_page(GFP_NOFS)
    __alloc_pages_may_oom()
    takes the oom_lock
    out_of_memory()
    blocking_notifier_call_chain()
    leak_balloon()
    tries to take that balloon_lock and deadlocks

    Reported-by: Tetsuo Handa
    Cc: Michal Hocko
    Cc: Wei Wang
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Greg Kroah-Hartman

    Michael S. Tsirkin
     
  • commit 017b1660df89f5fb4bfe66c34e35f7d2031100c7 upstream.

    The page migration code employs try_to_unmap() to try and unmap the source
    page. This is accomplished by using rmap_walk to find all vmas where the
    page is mapped. This search stops when page mapcount is zero. For shared
    PMD huge pages, the page map count is always 1 no matter the number of
    mappings. Shared mappings are tracked via the reference count of the PMD
    page. Therefore, try_to_unmap stops prematurely and does not completely
    unmap all mappings of the source page.

    This problem can result is data corruption as writes to the original
    source page can happen after contents of the page are copied to the target
    page. Hence, data is lost.

    This problem was originally seen as DB corruption of shared global areas
    after a huge page was soft offlined due to ECC memory errors. DB
    developers noticed they could reproduce the issue by (hotplug) offlining
    memory used to back huge pages. A simple testcase can reproduce the
    problem by creating a shared PMD mapping (note that this must be at least
    PUD_SIZE in size and PUD_SIZE aligned (1GB on x86)), and using
    migrate_pages() to migrate process pages between nodes while continually
    writing to the huge pages being migrated.

    To fix, have the try_to_unmap_one routine check for huge PMD sharing by
    calling huge_pmd_unshare for hugetlbfs huge pages. If it is a shared
    mapping it will be 'unshared' which removes the page table entry and drops
    the reference on the PMD page. After this, flush caches and TLB.

    mmu notifiers are called before locking page tables, but we can not be
    sure of PMD sharing until page tables are locked. Therefore, check for
    the possibility of PMD sharing before locking so that notifiers can
    prepare for the worst possible case.

    Link: http://lkml.kernel.org/r/20180823205917.16297-2-mike.kravetz@oracle.com
    [mike.kravetz@oracle.com: make _range_in_vma() a static inline]
    Link: http://lkml.kernel.org/r/6063f215-a5c8-2f0c-465a-2c515ddc952d@oracle.com
    Fixes: 39dde65c9940 ("shared page table for hugetlb page")
    Signed-off-by: Mike Kravetz
    Acked-by: Kirill A. Shutemov
    Reviewed-by: Naoya Horiguchi
    Acked-by: Michal Hocko
    Cc: Vlastimil Babka
    Cc: Davidlohr Bueso
    Cc: Jerome Glisse
    Cc: Mike Kravetz
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Mike Kravetz
     

04 Oct, 2018

7 commits

  • commit ad608fbcf166fec809e402d548761768f602702c upstream.

    The event subscriptions are added to the subscribed event list while
    holding a spinlock, but that lock is subsequently released while still
    accessing the subscription object. This makes it possible to unsubscribe
    the event --- and freeing the subscription object's memory --- while
    the subscription object is simultaneously accessed.

    Prevent this by adding a mutex to serialise the event subscription and
    unsubscription. This also gives a guarantee to the callback ops that the
    add op has returned before the del op is called.

    This change also results in making the elems field less special:
    subscriptions are only added to the event list once they are fully
    initialised.

    Signed-off-by: Sakari Ailus
    Reviewed-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Cc: stable@vger.kernel.org # for 4.14 and up
    Fixes: c3b5b0241f62 ("V4L/DVB: V4L: Events: Add backend")
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Sakari Ailus
     
  • [ Upstream commit 755a8bf5579d22eb5636685c516d8dede799e27b ]

    If someone has the silly idea to write something along those lines:

    extern u64 foo(void);

    void bar(struct arm_smccc_res *res)
    {
    arm_smccc_1_1_smc(0xbad, foo(), res);
    }

    they are in for a surprise, as this gets compiled as:

    0000000000000588 :
    588: a9be7bfd stp x29, x30, [sp, #-32]!
    58c: 910003fd mov x29, sp
    590: f9000bf3 str x19, [sp, #16]
    594: aa0003f3 mov x19, x0
    598: aa1e03e0 mov x0, x30
    59c: 94000000 bl 0
    5a0: 94000000 bl 0
    5a4: aa0003e1 mov x1, x0
    5a8: d4000003 smc #0x0
    5ac: b4000073 cbz x19, 5b8
    5b0: a9000660 stp x0, x1, [x19]
    5b4: a9010e62 stp x2, x3, [x19, #16]
    5b8: f9400bf3 ldr x19, [sp, #16]
    5bc: a8c27bfd ldp x29, x30, [sp], #32
    5c0: d65f03c0 ret
    5c4: d503201f nop

    The call to foo "overwrites" the x0 register for the return value,
    and we end up calling the wrong secure service.

    A solution is to evaluate all the parameters before assigning
    anything to specific registers, leading to the expected result:

    0000000000000588 :
    588: a9be7bfd stp x29, x30, [sp, #-32]!
    58c: 910003fd mov x29, sp
    590: f9000bf3 str x19, [sp, #16]
    594: aa0003f3 mov x19, x0
    598: aa1e03e0 mov x0, x30
    59c: 94000000 bl 0
    5a0: 94000000 bl 0
    5a4: aa0003e1 mov x1, x0
    5a8: d28175a0 mov x0, #0xbad
    5ac: d4000003 smc #0x0
    5b0: b4000073 cbz x19, 5bc
    5b4: a9000660 stp x0, x1, [x19]
    5b8: a9010e62 stp x2, x3, [x19, #16]
    5bc: f9400bf3 ldr x19, [sp, #16]
    5c0: a8c27bfd ldp x29, x30, [sp], #32
    5c4: d65f03c0 ret

    Reported-by: Julien Grall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Will Deacon
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Marc Zyngier
     
  • [ Upstream commit 1d8f574708a3fb6f18c85486d0c5217df893c0cf ]

    An unfortunate consequence of having a strong typing for the input
    values to the SMC call is that it also affects the type of the
    return values, limiting r0 to 32 bits and r{1,2,3} to whatever
    was passed as an input.

    Let's turn everything into "unsigned long", which satisfies the
    requirements of both architectures, and allows for the full
    range of return values.

    Reported-by: Julien Grall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Will Deacon
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Marc Zyngier
     
  • [ Upstream commit 3ad867001c91657c46dcf6656d52eb6080286fd5 ]

    fix the sysfs shunt resistor read access: return the shunt resistor
    value, not the calibration register contents.

    update email address

    Signed-off-by: Lothar Felten
    Signed-off-by: Guenter Roeck
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Lothar Felten
     
  • commit e5d9998f3e09359b372a037a6ac55ba235d95d57 upstream.

    /*
    * cpu_partial determined the maximum number of objects
    * kept in the per cpu partial lists of a processor.
    */

    Can't be negative.

    Link: http://lkml.kernel.org/r/20180305200730.15812-15-adobriyan@gmail.com
    Signed-off-by: Alexey Dobriyan
    Acked-by: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Joonsoo Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: zhong jiang
    Signed-off-by: Greg Kroah-Hartman

    Alexey Dobriyan
     
  • [ Upstream commit 78c9c4dfbf8c04883941445a195276bb4bb92c76 ]

    The posix timer overrun handling is broken because the forwarding functions
    can return a huge number of overruns which does not fit in an int. As a
    consequence timer_getoverrun(2) and siginfo::si_overrun can turn into
    random number generators.

    The k_clock::timer_forward() callbacks return a 64 bit value now. Make
    k_itimer::ti_overrun[_last] 64bit as well, so the kernel internal
    accounting is correct. 3Remove the temporary (int) casts.

    Add a helper function which clamps the overrun value returned to user space
    via timer_getoverrun(2) or siginfo::si_overrun limited to a positive value
    between 0 and INT_MAX. INT_MAX is an indicator for user space that the
    overrun value has been clamped.

    Reported-by: Team OWL337
    Signed-off-by: Thomas Gleixner
    Acked-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Michael Kerrisk
    Link: https://lkml.kernel.org/r/20180626132705.018623573@linutronix.de
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • [ Upstream commit 3ffa6583e24e1ad1abab836d24bfc9d2308074e5 ]

    If a device gets removed right after having registered a power_supply node,
    we might enter in a deadlock between the remove call (that has a lock on
    the parent device) and the deferred register work.

    Allow the deferred register work to exit without taking the lock when
    we are in the remove state.

    Stack trace on a Ubuntu 16.04:

    [16072.109121] INFO: task kworker/u16:2:1180 blocked for more than 120 seconds.
    [16072.109127] Not tainted 4.13.0-41-generic #46~16.04.1-Ubuntu
    [16072.109129] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [16072.109132] kworker/u16:2 D 0 1180 2 0x80000000
    [16072.109142] Workqueue: events_power_efficient power_supply_deferred_register_work
    [16072.109144] Call Trace:
    [16072.109152] __schedule+0x3d6/0x8b0
    [16072.109155] schedule+0x36/0x80
    [16072.109158] schedule_preempt_disabled+0xe/0x10
    [16072.109161] __mutex_lock.isra.2+0x2ab/0x4e0
    [16072.109166] __mutex_lock_slowpath+0x13/0x20
    [16072.109168] ? __mutex_lock_slowpath+0x13/0x20
    [16072.109171] mutex_lock+0x2f/0x40
    [16072.109174] power_supply_deferred_register_work+0x2b/0x50
    [16072.109179] process_one_work+0x15b/0x410
    [16072.109182] worker_thread+0x4b/0x460
    [16072.109186] kthread+0x10c/0x140
    [16072.109189] ? process_one_work+0x410/0x410
    [16072.109191] ? kthread_create_on_node+0x70/0x70
    [16072.109194] ret_from_fork+0x35/0x40
    [16072.109199] INFO: task test:2257 blocked for more than 120 seconds.
    [16072.109202] Not tainted 4.13.0-41-generic #46~16.04.1-Ubuntu
    [16072.109204] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [16072.109206] test D 0 2257 2256 0x00000004
    [16072.109208] Call Trace:
    [16072.109211] __schedule+0x3d6/0x8b0
    [16072.109215] schedule+0x36/0x80
    [16072.109218] schedule_timeout+0x1f3/0x360
    [16072.109221] ? check_preempt_curr+0x5a/0xa0
    [16072.109224] ? ttwu_do_wakeup+0x1e/0x150
    [16072.109227] wait_for_completion+0xb4/0x140
    [16072.109230] ? wait_for_completion+0xb4/0x140
    [16072.109233] ? wake_up_q+0x70/0x70
    [16072.109236] flush_work+0x129/0x1e0
    [16072.109240] ? worker_detach_from_pool+0xb0/0xb0
    [16072.109243] __cancel_work_timer+0x10f/0x190
    [16072.109247] ? device_del+0x264/0x310
    [16072.109250] ? __wake_up+0x44/0x50
    [16072.109253] cancel_delayed_work_sync+0x13/0x20
    [16072.109257] power_supply_unregister+0x37/0xb0
    [16072.109260] devm_power_supply_release+0x11/0x20
    [16072.109263] release_nodes+0x110/0x200
    [16072.109266] devres_release_group+0x7c/0xb0
    [16072.109274] wacom_remove+0xc2/0x110 [wacom]
    [16072.109279] hid_device_remove+0x6e/0xd0 [hid]
    [16072.109284] device_release_driver_internal+0x158/0x210
    [16072.109288] device_release_driver+0x12/0x20
    [16072.109291] bus_remove_device+0xec/0x160
    [16072.109293] device_del+0x1de/0x310
    [16072.109298] hid_destroy_device+0x27/0x60 [hid]
    [16072.109303] usbhid_disconnect+0x51/0x70 [usbhid]
    [16072.109308] usb_unbind_interface+0x77/0x270
    [16072.109311] device_release_driver_internal+0x158/0x210
    [16072.109315] device_release_driver+0x12/0x20
    [16072.109318] usb_driver_release_interface+0x77/0x80
    [16072.109321] proc_ioctl+0x20f/0x250
    [16072.109325] usbdev_do_ioctl+0x57f/0x1140
    [16072.109327] ? __wake_up+0x44/0x50
    [16072.109331] usbdev_ioctl+0xe/0x20
    [16072.109336] do_vfs_ioctl+0xa4/0x600
    [16072.109339] ? vfs_write+0x15a/0x1b0
    [16072.109343] SyS_ioctl+0x79/0x90
    [16072.109347] entry_SYSCALL_64_fastpath+0x24/0xab
    [16072.109349] RIP: 0033:0x7f20da807f47
    [16072.109351] RSP: 002b:00007ffc422ae398 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
    [16072.109353] RAX: ffffffffffffffda RBX: 00000000010b8560 RCX: 00007f20da807f47
    [16072.109355] RDX: 00007ffc422ae3a0 RSI: 00000000c0105512 RDI: 0000000000000009
    [16072.109356] RBP: 0000000000000000 R08: 00007ffc422ae3e0 R09: 0000000000000010
    [16072.109357] R10: 00000000000000a6 R11: 0000000000000246 R12: 0000000000000000
    [16072.109359] R13: 00000000010b8560 R14: 00007ffc422ae2e0 R15: 0000000000000000

    Reported-and-tested-by: Richard Hughes
    Tested-by: Aaron Skomra
    Signed-off-by: Benjamin Tissoires
    Fixes: 7f1a57fdd6cb ("power_supply: Fix possible NULL pointer dereference on early uevent")
    Signed-off-by: Sebastian Reichel
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Tissoires
     

29 Sep, 2018

3 commits

  • commit 8c0f9f5b309d627182d5da72a69246f58bde1026 upstream.

    This changes UAPI, breaking iwd and libell:

    ell/key.c: In function 'kernel_dh_compute':
    ell/key.c:205:38: error: 'struct keyctl_dh_params' has no member named 'private'; did you mean 'dh_private'?
    struct keyctl_dh_params params = { .private = private,
    ^~~~~~~
    dh_private

    This reverts commit 8a2336e549d385bb0b46880435b411df8d8200e8.

    Fixes: 8a2336e549d3 ("uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name")
    Signed-off-by: Lubomir Rintel
    Signed-off-by: David Howells
    cc: Randy Dunlap
    cc: Mat Martineau
    cc: Stephan Mueller
    cc: James Morris
    cc: "Serge E. Hallyn"
    cc: Mat Martineau
    cc: Andrew Morton
    cc: Linus Torvalds
    cc:
    Signed-off-by: James Morris
    Signed-off-by: Greg Kroah-Hartman

    Lubomir Rintel
     
  • commit e285d5bfb7e9785d289663baef252dd315e171f8 upstream.

    According to ETSI TS 102 622 specification chapter 4.4 pipe identifier
    is 7 bits long which allows for 128 unique pipe IDs. Because
    NFC_HCI_MAX_PIPES is used as the number of pipes supported and not
    as the max pipe ID, its value should be 128 instead of 127.

    nfc_hci_recv_from_llc extracts pipe ID from packet header using
    NFC_HCI_FRAGMENT(0x7F) mask which allows for pipe ID value of 127.
    Same happens when NCI_HCP_MSG_GET_PIPE() is being used. With
    pipes array having only 127 elements and pipe ID of 127 the OOB memory
    access will result.

    Cc: Samuel Ortiz
    Cc: Allen Pais
    Cc: "David S. Miller"
    Suggested-by: Dan Carpenter
    Signed-off-by: Suren Baghdasaryan
    Reviewed-by: Kees Cook
    Cc: stable
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Suren Baghdasaryan
     
  • [ Upstream commit 86029d10af18381814881d6cce2dd6872163b59f ]

    This contains key material in crypto_send_aes_gcm_128 and
    crypto_recv_aes_gcm_128.

    Introduce union tls_crypto_context, and replace the two identical
    unions directly embedded in struct tls_context with it. We can then
    use this union to clean up the memory in the new tls_ctx_free()
    function.

    Fixes: 3c4d7559159b ("tls: kernel TLS support")
    Signed-off-by: Sabrina Dubroca
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Sabrina Dubroca
     

26 Sep, 2018

2 commits

  • [ Upstream commit e2861fa71641c6414831d628a1f4f793b6562580 ]

    When EVM attempts to appraise a file signed with a crypto algorithm the
    kernel doesn't have support for, it will cause the kernel to trigger a
    module load. If the EVM policy includes appraisal of kernel modules this
    will in turn call back into EVM - since EVM is holding a lock until the
    crypto initialisation is complete, this triggers a deadlock. Add a
    CRYPTO_NOLOAD flag and skip module loading if it's set, and add that flag
    in the EVM case in order to fail gracefully with an error message
    instead of deadlocking.

    Signed-off-by: Matthew Garrett
    Acked-by: Herbert Xu
    Signed-off-by: Mimi Zohar
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Matthew Garrett
     
  • [ Upstream commit 76d5581c870454be5f1f1a106c57985902e7ea20 ]

    When the mlx5 health mechanism detects a problem while the driver
    is in the middle of init_one or remove_one, the driver needs to prevent
    the health mechanism from scheduling future work; if future work
    is scheduled, there is a problem with use-after-free: the system WQ
    tries to run the work item (which has been freed) at the scheduled
    future time.

    Prevent this by disabling work item scheduling in the health mechanism
    when the driver is in the middle of init_one() or remove_one().

    Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
    Signed-off-by: Jack Morgenstein
    Reviewed-by: Feras Daoud
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Greg Kroah-Hartman

    Jack Morgenstein
     

20 Sep, 2018

20 commits

  • commit 7a9cdebdcc17e426fb5287e4a82db1dfe86339b2 upstream.

    Jann Horn points out that the vmacache_flush_all() function is not only
    potentially expensive, it's buggy too. It also happens to be entirely
    unnecessary, because the sequence number overflow case can be avoided by
    simply making the sequence number be 64-bit. That doesn't even grow the
    data structures in question, because the other adjacent fields are
    already 64-bit.

    So simplify the whole thing by just making the sequence number overflow
    case go away entirely, which gets rid of all the complications and makes
    the code faster too. Win-win.

    [ Oleg Nesterov points out that the VMACACHE_FULL_FLUSHES statistics
    also just goes away entirely with this ]

    Reported-by: Jann Horn
    Suggested-by: Will Deacon
    Acked-by: Davidlohr Bueso
    Cc: Oleg Nesterov
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Linus Torvalds
     
  • This patch introduces several helper functions/macros that will be
    used in the follow-up patch. No runtime changes yet.

    The new logic (fully implemented in the second patch) is as follows:

    * Nodes in the rb-tree will now contain not single fragments, but lists
    of consecutive fragments ("runs").

    * At each point in time, the current "active" run at the tail is
    maintained/tracked. Fragments that arrive in-order, adjacent
    to the previous tail fragment, are added to this tail run without
    triggering the re-balancing of the rb-tree.

    * If a fragment arrives out of order with the offset _before_ the tail run,
    it is inserted into the rb-tree as a single fragment.

    * If a fragment arrives after the current tail fragment (with a gap),
    it starts a new "tail" run, as is inserted into the rb-tree
    at the end as the head of the new run.

    skb->cb is used to store additional information
    needed here (suggested by Eric Dumazet).

    Reported-by: Willem de Bruijn
    Signed-off-by: Peter Oskolkov
    Cc: Eric Dumazet
    Cc: Florian Westphal
    Signed-off-by: David S. Miller
    (cherry picked from commit 353c9cb360874e737fb000545f783df756c06f9a)
    Signed-off-by: Greg Kroah-Hartman

    Peter Oskolkov
     
  • commit bffa72cf7f9df842f0016ba03586039296b4caaf upstream

    skb->rbnode shares space with skb->next, skb->prev and skb->tstamp

    Current uses (TCP receive ofo queue and netem) need to save/restore
    tstamp, while skb->dev is either NULL (TCP) or a constant for a given
    queue (netem).

    Since we plan using an RB tree for TCP retransmit queue to speedup SACK
    processing with large BDP, this patch exchanges skb->dev and
    skb->tstamp.

    This saves some overhead in both TCP and netem.

    v2: removes the swtstamp field from struct tcp_skb_cb

    Signed-off-by: Eric Dumazet
    Cc: Soheil Hassas Yeganeh
    Cc: Wei Wang
    Cc: Willem de Bruijn
    Acked-by: Soheil Hassas Yeganeh
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • Geeralize private netem_rb_to_skb()

    TCP rtx queue will soon be converted to rb-tree,
    so we will need skb_rbtree_walk() helpers.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit 18a4c0eab2623cc95be98a1e6af1ad18e7695977)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • After working on IP defragmentation lately, I found that some large
    packets defeat CHECKSUM_COMPLETE optimization because of NIC adding
    zero paddings on the last (small) fragment.

    While removing the padding with pskb_trim_rcsum(), we set skb->ip_summed
    to CHECKSUM_NONE, forcing a full csum validation, even if all prior
    fragments had CHECKSUM_COMPLETE set.

    We can instead compute the checksum of the part we are trimming,
    usually smaller than the part we keep.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit 88078d98d1bb085d72af8437707279e203524fa5)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • Tested: see the next patch is the series.

    Suggested-by: Eric Dumazet
    Signed-off-by: Peter Oskolkov
    Signed-off-by: Eric Dumazet
    Cc: Florian Westphal
    Signed-off-by: David S. Miller
    (cherry picked from commit 385114dec8a49b5e5945e77ba7de6356106713f4)
    Signed-off-by: Greg Kroah-Hartman

    Peter Oskolkov
     
  • This behavior is required in IPv6, and there is little need
    to tolerate overlapping fragments in IPv4. This change
    simplifies the code and eliminates potential DDoS attack vectors.

    Tested: ran ip_defrag selftest (not yet available uptream).

    Suggested-by: David S. Miller
    Signed-off-by: Peter Oskolkov
    Signed-off-by: Eric Dumazet
    Cc: Florian Westphal
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller
    (cherry picked from commit 7969e5c40dfd04799d4341f1b7cd266b6e47f227)
    Signed-off-by: Greg Kroah-Hartman

    Peter Oskolkov
     
  • ip_defrag uses skb->cb[] to store the fragment offset, and unfortunately
    this integer is currently in a different cache line than skb->next,
    meaning that we use two cache lines per skb when finding the insertion point.

    By aliasing skb->ip_defrag_offset and skb->dev, we pack all the fields
    in a single cache line and save precious memory bandwidth.

    Note that after the fast path added by Changli Gao in commit
    d6bebca92c66 ("fragment: add fast path for in-order fragments")
    this change wont help the fast path, since we still need
    to access prev->len (2nd cache line), but will show great
    benefits when slow path is entered, since we perform
    a linear scan of a potentially long list.

    Also, note that this potential long list is an attack vector,
    we might consider also using an rb-tree there eventually.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit bf66337140c64c27fa37222b7abca7e49d63fb57)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • Put the read-mostly fields in a separate cache line
    at the beginning of struct netns_frags, to reduce
    false sharing noticed in inet_frag_kill()

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit c2615cf5a761b32bf74e85bddc223dfff3d9b9f0)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • While under frags DDOS I noticed unfortunate false sharing between
    @nelems and @params.automatic_shrinking

    Move @nelems at the end of struct rhashtable so that first cache line
    is shared between all cpus, because almost never dirtied.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit e5d672a0780d9e7118caad4c171ec88b8299398d)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • Some users are willing to provision huge amounts of memory to be able
    to perform reassembly reasonnably well under pressure.

    Current memory tracking is using one atomic_t and integers.

    Switch to atomic_long_t so that 64bit arches can use more than 2GB,
    without any cost for 32bit arches.

    Note that this patch avoids an overflow error, if high_thresh was set
    to ~2GB, since this test in inet_frag_alloc() was never true :

    if (... || frag_mem_limit(nf) > nf->high_thresh)

    Tested:

    $ echo 16000000000 >/proc/sys/net/ipv4/ipfrag_high_thresh

    $ grep FRAG /proc/net/sockstat
    FRAG: inuse 14705885 memory 16000002880

    $ nstat -n ; sleep 1 ; nstat | grep Reas
    IpReasmReqds 3317150 0.0
    IpReasmFails 3317112 0.0

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit 3e67f106f619dcfaf6f4e2039599bdb69848c714)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • This function is obsolete, after rhashtable addition to inet defrag.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit 2d44ed22e607f9a285b049de2263e3840673a260)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • This refactors ip_expire() since one indentation level is removed.

    Note: in the future, we should try hard to avoid the skb_clone()
    since this is a serious performance cost.
    Under DDOS, the ICMP message wont be sent because of rate limits.

    Fact that ip6_expire_frag_queue() does not use skb_clone() is
    disturbing too. Presumably IPv6 should have the same
    issue than the one we fixed in commit ec4fbd64751d
    ("inet: frag: release spinlock before calling icmp_send()")

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit 399d1404be660d355192ff4df5ccc3f4159ec1e4)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • Remove sum_frag_mem_limit(), ip_frag_mem() & ip6_frag_mem()

    Also since we use rhashtable we can bring back the number of fragments
    in "grep FRAG /proc/net/sockstat /proc/net/sockstat6" that was
    removed in commit 434d305405ab ("inet: frag: don't account number
    of fragment queues")

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit 6befe4a78b1553edb6eed3a78b4bcd9748526672)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • Some applications still rely on IP fragmentation, and to be fair linux
    reassembly unit is not working under any serious load.

    It uses static hash tables of 1024 buckets, and up to 128 items per bucket (!!!)

    A work queue is supposed to garbage collect items when host is under memory
    pressure, and doing a hash rebuild, changing seed used in hash computations.

    This work queue blocks softirqs for up to 25 ms when doing a hash rebuild,
    occurring every 5 seconds if host is under fire.

    Then there is the problem of sharing this hash table for all netns.

    It is time to switch to rhashtables, and allocate one of them per netns
    to speedup netns dismantle, since this is a critical metric these days.

    Lookup is now using RCU. A followup patch will even remove
    the refcount hold/release left from prior implementation and save
    a couple of atomic operations.

    Before this patch, 16 cpus (16 RX queue NIC) could not handle more
    than 1 Mpps frags DDOS.

    After the patch, I reach 9 Mpps without any tuning, and can use up to 2GB
    of storage for the fragments (exact number depends on frags being evicted
    after timeout)

    $ grep FRAG /proc/net/sockstat
    FRAG: inuse 1966916 memory 2140004608

    A followup patch will change the limits for 64bit arches.

    Signed-off-by: Eric Dumazet
    Cc: Kirill Tkhai
    Cc: Herbert Xu
    Cc: Florian Westphal
    Cc: Jesper Dangaard Brouer
    Cc: Alexander Aring
    Cc: Stefan Schmidt
    Signed-off-by: David S. Miller
    (cherry picked from commit 648700f76b03b7e8149d13cc2bdb3355035258a9)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • In preparation for unconditionally passing the struct timer_list pointer to
    all timer callbacks, switch to using the new timer_setup() and from_timer()
    to pass the timer pointer explicitly.

    Cc: Alexander Aring
    Cc: Stefan Schmidt
    Cc: "David S. Miller"
    Cc: Alexey Kuznetsov
    Cc: Hideaki YOSHIFUJI
    Cc: Pablo Neira Ayuso
    Cc: Jozsef Kadlecsik
    Cc: Florian Westphal
    Cc: linux-wpan@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: netfilter-devel@vger.kernel.org
    Cc: coreteam@netfilter.org
    Signed-off-by: Kees Cook
    Acked-by: Stefan Schmidt # for ieee802154
    Signed-off-by: David S. Miller
    (cherry picked from commit 78802011fbe34331bdef6f2dfb1634011f0e4c32)
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     
  • In order to simplify the API, add a pointer to struct inet_frags.
    This will allow us to make things less complex.

    These functions no longer have a struct inet_frags parameter :

    inet_frag_destroy(struct inet_frag_queue *q /*, struct inet_frags *f */)
    inet_frag_put(struct inet_frag_queue *q /*, struct inet_frags *f */)
    inet_frag_kill(struct inet_frag_queue *q /*, struct inet_frags *f */)
    inet_frags_exit_net(struct netns_frags *nf /*, struct inet_frags *f */)
    ip6_expire_frag_queue(struct net *net, struct frag_queue *fq)

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit 093ba72914b696521e4885756a68a3332782c8de)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • We will soon initialize one rhashtable per struct netns_frags
    in inet_frags_init_net().

    This patch changes the return value to eventually propagate an
    error.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller
    (cherry picked from commit 787bea7748a76130566f881c2342a0be4127d182)
    Signed-off-by: Greg Kroah-Hartman

    Eric Dumazet
     
  • [ Upstream commit d89d41556141a527030a15233135ba622ba3350d ]

    Android's header sanitization tool chokes on static inline functions having a
    trailing semicolon, leading to an incorrectly parsed header file. While the
    tool should obviously be fixed, also fix the header files for the two affected
    functions: ethtool_get_flow_spec_ring() and ethtool_get_flow_spec_ring_vf().

    Fixes: 8cf6f497de40 ("ethtool: Add helper routines to pass vf to rx_flow_spec")
    Reporetd-by: Blair Prescott
    Signed-off-by: Florian Fainelli
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Florian Fainelli
     
  • commit 627448e85c766587f6fdde1ea3886d6615081c77 upstream.

    Fix tpm ptt initialization error:
    tpm tpm0: A TPM error (378) occurred get tpm pcr allocation.

    We cannot use go_idle cmd_ready commands via runtime_pm handles
    as with the introduction of localities this is no longer an optional
    feature, while runtime pm can be not enabled.
    Though cmd_ready/go_idle provides a power saving, it's also a part of
    TPM2 protocol and should be called explicitly.
    This patch exposes cmd_read/go_idle via tpm class ops and removes
    runtime pm support as it is not used by any driver.

    When calling from nested context always use both flags:
    TPM_TRANSMIT_UNLOCKED and TPM_TRANSMIT_RAW. Both are needed to resolve
    tpm spaces and locality request recursive calls to tpm_transmit().
    TPM_TRANSMIT_RAW should never be used standalone as it will fail
    on double locking. While TPM_TRANSMIT_UNLOCKED standalone should be
    called from non-recursive locked contexts.

    New wrappers are added tpm_cmd_ready() and tpm_go_idle() to
    streamline tpm_try_transmit code.

    tpm_crb no longer needs own power saving functions and can drop using
    tpm_pm_suspend/resume.

    This patch cannot be really separated from the locality fix.
    Fixes: 888d867df441 (tpm: cmd_ready command can be issued only after granting locality)

    Cc: stable@vger.kernel.org
    Fixes: 888d867df441 (tpm: cmd_ready command can be issued only after granting locality)
    Signed-off-by: Tomas Winkler
    Tested-by: Jarkko Sakkinen
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Tomas Winkler
     

15 Sep, 2018

3 commits

  • commit 8a2336e549d385bb0b46880435b411df8d8200e8 upstream.

    Since this header is in "include/uapi/linux/", apparently people want to
    use it in userspace programs -- even in C++ ones. However, the header
    uses a C++ reserved keyword ("private"), so change that to "dh_private"
    instead to allow the header file to be used in C++ userspace.

    Fixes https://bugzilla.kernel.org/show_bug.cgi?id=191051
    Link: http://lkml.kernel.org/r/0db6c314-1ef4-9bfa-1baa-7214dd2ee061@infradead.org
    Fixes: ddbb41148724 ("KEYS: Add KEYCTL_DH_COMPUTE command")
    Signed-off-by: Randy Dunlap
    Reviewed-by: Andrew Morton
    Cc: David Howells
    Cc: James Morris
    Cc: "Serge E. Hallyn"
    Cc: Mat Martineau
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • [ Upstream commit 037b0b86ecf5646f8eae777d8b52ff8b401692ec ]

    Lets not turn the TCP ULP lookup into an arbitrary module loader as
    we only intend to load ULP modules through this mechanism, not other
    unrelated kernel modules:

    [root@bar]# cat foo.c
    #include
    #include
    #include
    #include

    int main(void)
    {
    int sock = socket(PF_INET, SOCK_STREAM, 0);
    setsockopt(sock, IPPROTO_TCP, TCP_ULP, "sctp", sizeof("sctp"));
    return 0;
    }

    [root@bar]# gcc foo.c -O2 -Wall
    [root@bar]# lsmod | grep sctp
    [root@bar]# ./a.out
    [root@bar]# lsmod | grep sctp
    sctp 1077248 4
    libcrc32c 16384 3 nf_conntrack,nf_nat,sctp
    [root@bar]#

    Fix it by adding module alias to TCP ULP modules, so probing module
    via request_module() will be limited to tcp-ulp-[name]. The existing
    modules like kTLS will load fine given tcp-ulp-tls alias, but others
    will fail to load:

    [root@bar]# lsmod | grep sctp
    [root@bar]# ./a.out
    [root@bar]# lsmod | grep sctp
    [root@bar]#

    Sockmap is not affected from this since it's either built-in or not.

    Fixes: 734942cc4ea6 ("tcp: ULP infrastructure")
    Signed-off-by: Daniel Borkmann
    Acked-by: John Fastabend
    Acked-by: Song Liu
    Signed-off-by: Alexei Starovoitov
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Daniel Borkmann
     
  • [ Upstream commit 9fd0e09a4e86499639653243edfcb417a05c5c46 ]

    This card identifies itself as:
    Ethernet controller [0200]: NCube Device [10ff:8168] (rev 06)
    Subsystem: TP-LINK Technologies Co., Ltd. Device [7470:3468]

    Adding a new entry to rtl8169_pci_tbl makes the card work.

    Link: http://launchpad.net/bugs/1788730
    Signed-off-by: Anthony Wong
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Anthony Wong
     

10 Sep, 2018

2 commits

  • commit bb24153a3f13dd0dbc1f8055ad97fe346d598f66 upstream.

    The default delay 5 jiffies is too much when the kernel is compiled with
    HZ=100 - it results in jumpy cursor in Xwindow.

    In order to find out the optimal delay, I benchmarked the driver on
    1280x720x30fps video. I found out that with HZ=1000, 10ms is acceptable,
    but with HZ=250 or HZ=300, we need 4ms, so that the video is played
    without any frame skips.

    This patch changes the delay to this value.

    Signed-off-by: Mikulas Patocka
    Cc: stable@vger.kernel.org
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Greg Kroah-Hartman

    Mikulas Patocka
     
  • commit 1c48db44924298ad0cb5a6386b88017539be8822 upstream.

    PFSID should be used in the invalidation descriptor for flushing
    device IOTLBs on SRIOV VFs.

    Signed-off-by: Jacob Pan
    Cc: stable@vger.kernel.org
    Cc: "Ashok Raj"
    Cc: "Lu Baolu"
    Signed-off-by: Joerg Roedel
    Signed-off-by: Greg Kroah-Hartman

    Jacob Pan