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

isdnctrl 2>&1|grep version #361

Closed
wants to merge 1 commit into from
Closed

isdnctrl 2>&1|grep version #361

wants to merge 1 commit into from

Conversation

deveshmehra
Copy link

isdnctrl 2>&1|grep version changed to isdnctrl 2>&1|grep --version

isdnctrl 2>&1|grep version changed to isdnctrl 2>&1|grep --version
@deveshmehra deveshmehra reopened this Nov 21, 2016
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Mar 15, 2017
The minimum and maximum value of the ATU Age Time varies depending on
the switch model. The current code returns -ERANGE for out-of-range
values, and makes switchdev commit phase fail with this stacktrace:

    # brctl setageing br0 4
    [ 8530.082179] WARNING: CPU: 0 PID: 910 at net/switchdev/switchdev.c:291 switchdev_port_attr_set_now+0xbc/0xc0
    [ 8530.090679] br0: Commit of attribute (id=5) failed.
    [ 8530.094256] Modules linked in:
    [ 8530.096032] CPU: 0 PID: 910 Comm: kworker/0:4 Tainted: G        W       4.10.0 torvalds#361
    [ 8530.102412] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
    [ 8530.107571] Workqueue: events switchdev_deferred_process_work
    [ 8530.112039] Backtrace:
    [ 8530.113224] [<8010ca34>] (dump_backtrace) from [<8010cd3c>] (show_stack+0x20/0x24)
    [ 8530.119521]  r6:00000000 r5:80834da0 r4:80ca7e48 r3:8120ca3c
    [ 8530.123908] [<8010cd1c>] (show_stack) from [<8037ad40>] (dump_stack+0x24/0x28)
    [ 8530.129873] [<8037ad1c>] (dump_stack) from [<80118de4>] (__warn+0xf4/0x10c)
    [ 8530.135545] [<80118cf0>] (__warn) from [<80118e44>] (warn_slowpath_fmt+0x48/0x50)
    [ 8530.141760]  r9:00000000 r8:81252bec r7:80f19d90 r6:9dc3c000 r5:80ca7e7c r4:80834de8
    [ 8530.148235] [<80118e00>] (warn_slowpath_fmt) from [<80670b20>] (switchdev_port_attr_set_now+0xbc/0xc0)
    [ 8530.156240]  r3:9dc3c000 r2:80834de8
    [ 8530.158539]  r4:ffffffde
    [ 8530.159788] [<80670a64>] (switchdev_port_attr_set_now) from [<80670b44>] (switchdev_port_attr_set_deferred+0x20/0x6c)
    [ 8530.169118]  r7:806705a8 r6:9dc3c000 r5:80f19d90 r4:80f19d80
    [ 8530.173500] [<80670b24>] (switchdev_port_attr_set_deferred) from [<80670580>] (switchdev_deferred_process+0x50/0xe8)
    [ 8530.182742]  r6:80ca6000 r5:81252bec r4:80f19d80 r3:80670b24
    [ 8530.187115] [<80670530>] (switchdev_deferred_process) from [<80670930>] (switchdev_deferred_process_work+0x1c/0x24)
    [ 8530.196277]  r8:00000000 r7:9ffdc100 r6:8120ad6c r5:9ddefc00 r4:81252bf4 r3:9de343c0
    [ 8530.202756] [<80670914>] (switchdev_deferred_process_work) from [<8012f770>] (process_one_work+0x120/0x3b0)
    [ 8530.211231] [<8012f650>] (process_one_work) from [<8012fa70>] (worker_thread+0x70/0x534)
    [ 8530.218046]  r10:9ddefc00 r9:8120ad6c r8:80ca6038 r7:8120ad80 r6:81211f80 r5:9ddefc18
    [ 8530.224579]  r4:8120ad6c
    [ 8530.225830] [<8012fa00>] (worker_thread) from [<80135640>] (kthread+0x114/0x144)
    [ 8530.231955]  r10:9f4e9e94 r9:9de1fe58 r8:8012fa00 r7:9ddefc00 r6:9de1fdc0 r5:00000000
    [ 8530.238497]  r4:9de1fe40
    [ 8530.239750] [<8013552c>] (kthread) from [<80108cd8>] (ret_from_fork+0x14/0x3c)
    [ 8530.245679]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:8013552c
    [ 8530.252234]  r4:9de1fdc0 r3:80ca6000
    [ 8530.254512] ---[ end trace 87475cc71b80ef73 ]---
    [ 8530.257852] br0: failed (err=-34) to set attribute (id=5)

Fix this in the mv88e6xxx driver by limiting the 8-bit AgeTime value to
its minimum or maximum for out-of-range values.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reported-by: Jason Cobham <jcobham@questertangent.com>
idosch pushed a commit to idosch/linux that referenced this pull request Mar 16, 2017
Vivien Didelot says:

====================
net: dsa: check out-of-range ageing time

The ageing time limits supported by DSA drivers vary depending on the
switch model. If a driver returns -ERANGE for out-of-range values, the
switchdev commit phase will fail with the following stacktrace:

    # brctl setageing br0 4
    [ 8530.082179] WARNING: CPU: 0 PID: 910 at net/switchdev/switchdev.c:291 switchdev_port_attr_set_now+0xbc/0xc0
    [ 8530.090679] br0: Commit of attribute (id=5) failed.
    [ 8530.094256] Modules linked in:
    [ 8530.096032] CPU: 0 PID: 910 Comm: kworker/0:4 Tainted: G        W       4.10.0 torvalds#361
    [ 8530.102412] Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
    [ 8530.107571] Workqueue: events switchdev_deferred_process_work
    [ 8530.112039] Backtrace:
    [ 8530.113224] [<8010ca34>] (dump_backtrace) from [<8010cd3c>] (show_stack+0x20/0x24)
    [ 8530.119521]  r6:00000000 r5:80834da0 r4:80ca7e48 r3:8120ca3c
    [ 8530.123908] [<8010cd1c>] (show_stack) from [<8037ad40>] (dump_stack+0x24/0x28)
    [ 8530.129873] [<8037ad1c>] (dump_stack) from [<80118de4>] (__warn+0xf4/0x10c)
    [ 8530.135545] [<80118cf0>] (__warn) from [<80118e44>] (warn_slowpath_fmt+0x48/0x50)
    [ 8530.141760]  r9:00000000 r8:81252bec r7:80f19d90 r6:9dc3c000 r5:80ca7e7c r4:80834de8
    [ 8530.148235] [<80118e00>] (warn_slowpath_fmt) from [<80670b20>] (switchdev_port_attr_set_now+0xbc/0xc0)
    [ 8530.156240]  r3:9dc3c000 r2:80834de8
    [ 8530.158539]  r4:ffffffde
    [ 8530.159788] [<80670a64>] (switchdev_port_attr_set_now) from [<80670b44>] (switchdev_port_attr_set_deferred+0x20/0x6c)
    [ 8530.169118]  r7:806705a8 r6:9dc3c000 r5:80f19d90 r4:80f19d80
    [ 8530.173500] [<80670b24>] (switchdev_port_attr_set_deferred) from [<80670580>] (switchdev_deferred_process+0x50/0xe8)
    [ 8530.182742]  r6:80ca6000 r5:81252bec r4:80f19d80 r3:80670b24
    [ 8530.187115] [<80670530>] (switchdev_deferred_process) from [<80670930>] (switchdev_deferred_process_work+0x1c/0x24)
    [ 8530.196277]  r8:00000000 r7:9ffdc100 r6:8120ad6c r5:9ddefc00 r4:81252bf4 r3:9de343c0
    [ 8530.202756] [<80670914>] (switchdev_deferred_process_work) from [<8012f770>] (process_one_work+0x120/0x3b0)
    [ 8530.211231] [<8012f650>] (process_one_work) from [<8012fa70>] (worker_thread+0x70/0x534)
    [ 8530.218046]  r10:9ddefc00 r9:8120ad6c r8:80ca6038 r7:8120ad80 r6:81211f80 r5:9ddefc18
    [ 8530.224579]  r4:8120ad6c
    [ 8530.225830] [<8012fa00>] (worker_thread) from [<80135640>] (kthread+0x114/0x144)
    [ 8530.231955]  r10:9f4e9e94 r9:9de1fe58 r8:8012fa00 r7:9ddefc00 r6:9de1fdc0 r5:00000000
    [ 8530.238497]  r4:9de1fe40
    [ 8530.239750] [<8013552c>] (kthread) from [<80108cd8>] (ret_from_fork+0x14/0x3c)
    [ 8530.245679]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:8013552c
    [ 8530.252234]  r4:9de1fdc0 r3:80ca6000
    [ 8530.254512] ---[ end trace 87475cc71b80ef73 ]---
    [ 8530.257852] br0: failed (err=-34) to set attribute (id=5)

This patchset fixes this by adding ageing_time_min and ageing_time_max
fields to the dsa_switch structure, which can optionally be set by a DSA
driver.

If provided, the DSA core will check for out-of-range values in the
SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME prepare phase and return -ERANGE
accordingly.

Finally set these limits in the mv88e6xxx driver.
====================

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
JoonsooKim pushed a commit to JoonsooKim/linux that referenced this pull request Mar 27, 2017
khugepaged does swap in during collapse under anon_vma lock. It causes
complain from lockdep. The trace below shows following scenario:

 - khugepaged tries to swap in a page under mmap_sem and anon_vma lock;
 - do_swap_page() calls swapin_readahead() with GFP_HIGHUSER_MOVABLE;
 - __read_swap_cache_async() tries to allocate the page for swap in;
 - lockdep_trace_alloc() in __alloc_pages_nodemask() notices that with
   given gfp_mask we could end up in direct relaim.
 - Lockdep already knows that reclaim sometimes (e.g. in case of
   split_huge_page()) wants to take anon_vma lock on its own.

Therefore deadlock is possible.

The fix is to take anon_vma lock after swap in.

[18344.236625] =================================
[18344.236628] [ INFO: inconsistent lock state ]
[18344.236633] 4.3.0-rc1-next-20150918-dbg-00014-ge5128d0-dirty torvalds#361 Not tainted
[18344.236636] ---------------------------------
[18344.236640] inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage.
[18344.236645] khugepaged/32 [HC0[0]:SC0[0]:HE1:SE1] takes:
[18344.236648]  (&anon_vma->rwsem){++++?.}, at: [<ffffffff81134403>] khugepaged+0x8b0/0x1987
[18344.236662] {IN-RECLAIM_FS-W} state was registered at:
[18344.236666]   [<ffffffff8107d747>] __lock_acquire+0x8e2/0x1183
[18344.236673]   [<ffffffff8107e7ac>] lock_acquire+0x10b/0x1a6
[18344.236678]   [<ffffffff8150a367>] down_write+0x3b/0x6a
[18344.236686]   [<ffffffff811360d8>] split_huge_page_to_list+0x5b/0x61f
[18344.236689]   [<ffffffff811224b3>] add_to_swap+0x37/0x78
[18344.236691]   [<ffffffff810fd650>] shrink_page_list+0x4c2/0xb9a
[18344.236694]   [<ffffffff810fe47c>] shrink_inactive_list+0x371/0x5d9
[18344.236696]   [<ffffffff810fee2f>] shrink_lruvec+0x410/0x5ae
[18344.236698]   [<ffffffff810ff024>] shrink_zone+0x57/0x140
[18344.236700]   [<ffffffff810ffc79>] kswapd+0x6a5/0x91b
[18344.236702]   [<ffffffff81059588>] kthread+0x107/0x10f
[18344.236706]   [<ffffffff8150c7bf>] ret_from_fork+0x3f/0x70
[18344.236708] irq event stamp: 6517947
[18344.236709] hardirqs last  enabled at (6517947): [<ffffffff810f2d0c>] get_page_from_freelist+0x362/0x59e
[18344.236713] hardirqs last disabled at (6517946): [<ffffffff8150ba41>] _raw_spin_lock_irqsave+0x18/0x51
[18344.236715] softirqs last  enabled at (6507072): [<ffffffff81041cb0>] __do_softirq+0x2df/0x3f5
[18344.236719] softirqs last disabled at (6507055): [<ffffffff81041fb5>] irq_exit+0x40/0x94
[18344.236722]
               other info that might help us debug this:
[18344.236723]  Possible unsafe locking scenario:

[18344.236724]        CPU0
[18344.236725]        ----
[18344.236726]   lock(&anon_vma->rwsem);
[18344.236728]   <Interrupt>
[18344.236729]     lock(&anon_vma->rwsem);
[18344.236731]
                *** DEADLOCK ***

[18344.236733] 2 locks held by khugepaged/32:
[18344.236733]  #0:  (&mm->mmap_sem){++++++}, at: [<ffffffff81134122>] khugepaged+0x5cf/0x1987
[18344.236738]  #1:  (&anon_vma->rwsem){++++?.}, at: [<ffffffff81134403>] khugepaged+0x8b0/0x1987
[18344.236741]
               stack backtrace:
[18344.236744] CPU: 3 PID: 32 Comm: khugepaged Not tainted 4.3.0-rc1-next-20150918-dbg-00014-ge5128d0-dirty torvalds#361
[18344.236747]  0000000000000000 ffff880132827a00 ffffffff81230867 ffffffff8237ba90
[18344.236750]  ffff880132827a38 ffffffff810ea9b9 000000000000000a ffff8801333b52e0
[18344.236753]  ffff8801333b4c00 ffffffff8107b3ce 000000000000000a ffff880132827a78
[18344.236755] Call Trace:
[18344.236758]  [<ffffffff81230867>] dump_stack+0x4e/0x79
[18344.236761]  [<ffffffff810ea9b9>] print_usage_bug.part.24+0x259/0x268
[18344.236763]  [<ffffffff8107b3ce>] ? print_shortest_lock_dependencies+0x180/0x180
[18344.236765]  [<ffffffff8107c7fc>] mark_lock+0x381/0x567
[18344.236766]  [<ffffffff8107ca40>] mark_held_locks+0x5e/0x74
[18344.236768]  [<ffffffff8107ee9f>] lockdep_trace_alloc+0xb0/0xb3
[18344.236771]  [<ffffffff810f30cc>] __alloc_pages_nodemask+0x99/0x856
[18344.236772]  [<ffffffff810ebaf9>] ? find_get_entry+0x14b/0x17a
[18344.236774]  [<ffffffff810ebb16>] ? find_get_entry+0x168/0x17a
[18344.236777]  [<ffffffff811226d9>] __read_swap_cache_async+0x7b/0x1aa
[18344.236778]  [<ffffffff8112281d>] read_swap_cache_async+0x15/0x2d
[18344.236780]  [<ffffffff8112294f>] swapin_readahead+0x11a/0x16a
[18344.236783]  [<ffffffff81112791>] do_swap_page+0xa7/0x36b
[18344.236784]  [<ffffffff81112791>] ? do_swap_page+0xa7/0x36b
[18344.236787]  [<ffffffff8113444c>] khugepaged+0x8f9/0x1987
[18344.236790]  [<ffffffff810772f3>] ? wait_woken+0x88/0x88
[18344.236792]  [<ffffffff81133b53>] ? maybe_pmd_mkwrite+0x1a/0x1a
[18344.236794]  [<ffffffff81059588>] kthread+0x107/0x10f
[18344.236797]  [<ffffffff81059481>] ? kthread_create_on_node+0x1ea/0x1ea
[18344.236799]  [<ffffffff8150c7bf>] ret_from_fork+0x3f/0x70
[18344.236801]  [<ffffffff81059481>] ? kthread_create_on_node+0x1ea/0x1ea

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
JoonsooKim pushed a commit to JoonsooKim/linux that referenced this pull request Mar 27, 2017
khugepaged does swap in during collapse under anon_vma lock. It causes
complain from lockdep. The trace below shows following scenario:

 - khugepaged tries to swap in a page under mmap_sem and anon_vma lock;
 - do_swap_page() calls swapin_readahead() with GFP_HIGHUSER_MOVABLE;
 - __read_swap_cache_async() tries to allocate the page for swap in;
 - lockdep_trace_alloc() in __alloc_pages_nodemask() notices that with
   given gfp_mask we could end up in direct relaim.
 - Lockdep already knows that reclaim sometimes (e.g. in case of
   split_huge_page()) wants to take anon_vma lock on its own.

Therefore deadlock is possible.

The fix is to take anon_vma lock after swap in.

[18344.236625] =================================
[18344.236628] [ INFO: inconsistent lock state ]
[18344.236633] 4.3.0-rc1-next-20150918-dbg-00014-ge5128d0-dirty torvalds#361 Not tainted
[18344.236636] ---------------------------------
[18344.236640] inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage.
[18344.236645] khugepaged/32 [HC0[0]:SC0[0]:HE1:SE1] takes:
[18344.236648]  (&anon_vma->rwsem){++++?.}, at: [<ffffffff81134403>] khugepaged+0x8b0/0x1987
[18344.236662] {IN-RECLAIM_FS-W} state was registered at:
[18344.236666]   [<ffffffff8107d747>] __lock_acquire+0x8e2/0x1183
[18344.236673]   [<ffffffff8107e7ac>] lock_acquire+0x10b/0x1a6
[18344.236678]   [<ffffffff8150a367>] down_write+0x3b/0x6a
[18344.236686]   [<ffffffff811360d8>] split_huge_page_to_list+0x5b/0x61f
[18344.236689]   [<ffffffff811224b3>] add_to_swap+0x37/0x78
[18344.236691]   [<ffffffff810fd650>] shrink_page_list+0x4c2/0xb9a
[18344.236694]   [<ffffffff810fe47c>] shrink_inactive_list+0x371/0x5d9
[18344.236696]   [<ffffffff810fee2f>] shrink_lruvec+0x410/0x5ae
[18344.236698]   [<ffffffff810ff024>] shrink_zone+0x57/0x140
[18344.236700]   [<ffffffff810ffc79>] kswapd+0x6a5/0x91b
[18344.236702]   [<ffffffff81059588>] kthread+0x107/0x10f
[18344.236706]   [<ffffffff8150c7bf>] ret_from_fork+0x3f/0x70
[18344.236708] irq event stamp: 6517947
[18344.236709] hardirqs last  enabled at (6517947): [<ffffffff810f2d0c>] get_page_from_freelist+0x362/0x59e
[18344.236713] hardirqs last disabled at (6517946): [<ffffffff8150ba41>] _raw_spin_lock_irqsave+0x18/0x51
[18344.236715] softirqs last  enabled at (6507072): [<ffffffff81041cb0>] __do_softirq+0x2df/0x3f5
[18344.236719] softirqs last disabled at (6507055): [<ffffffff81041fb5>] irq_exit+0x40/0x94
[18344.236722]
               other info that might help us debug this:
[18344.236723]  Possible unsafe locking scenario:

[18344.236724]        CPU0
[18344.236725]        ----
[18344.236726]   lock(&anon_vma->rwsem);
[18344.236728]   <Interrupt>
[18344.236729]     lock(&anon_vma->rwsem);
[18344.236731]
                *** DEADLOCK ***

[18344.236733] 2 locks held by khugepaged/32:
[18344.236733]  #0:  (&mm->mmap_sem){++++++}, at: [<ffffffff81134122>] khugepaged+0x5cf/0x1987
[18344.236738]  #1:  (&anon_vma->rwsem){++++?.}, at: [<ffffffff81134403>] khugepaged+0x8b0/0x1987
[18344.236741]
               stack backtrace:
[18344.236744] CPU: 3 PID: 32 Comm: khugepaged Not tainted 4.3.0-rc1-next-20150918-dbg-00014-ge5128d0-dirty torvalds#361
[18344.236747]  0000000000000000 ffff880132827a00 ffffffff81230867 ffffffff8237ba90
[18344.236750]  ffff880132827a38 ffffffff810ea9b9 000000000000000a ffff8801333b52e0
[18344.236753]  ffff8801333b4c00 ffffffff8107b3ce 000000000000000a ffff880132827a78
[18344.236755] Call Trace:
[18344.236758]  [<ffffffff81230867>] dump_stack+0x4e/0x79
[18344.236761]  [<ffffffff810ea9b9>] print_usage_bug.part.24+0x259/0x268
[18344.236763]  [<ffffffff8107b3ce>] ? print_shortest_lock_dependencies+0x180/0x180
[18344.236765]  [<ffffffff8107c7fc>] mark_lock+0x381/0x567
[18344.236766]  [<ffffffff8107ca40>] mark_held_locks+0x5e/0x74
[18344.236768]  [<ffffffff8107ee9f>] lockdep_trace_alloc+0xb0/0xb3
[18344.236771]  [<ffffffff810f30cc>] __alloc_pages_nodemask+0x99/0x856
[18344.236772]  [<ffffffff810ebaf9>] ? find_get_entry+0x14b/0x17a
[18344.236774]  [<ffffffff810ebb16>] ? find_get_entry+0x168/0x17a
[18344.236777]  [<ffffffff811226d9>] __read_swap_cache_async+0x7b/0x1aa
[18344.236778]  [<ffffffff8112281d>] read_swap_cache_async+0x15/0x2d
[18344.236780]  [<ffffffff8112294f>] swapin_readahead+0x11a/0x16a
[18344.236783]  [<ffffffff81112791>] do_swap_page+0xa7/0x36b
[18344.236784]  [<ffffffff81112791>] ? do_swap_page+0xa7/0x36b
[18344.236787]  [<ffffffff8113444c>] khugepaged+0x8f9/0x1987
[18344.236790]  [<ffffffff810772f3>] ? wait_woken+0x88/0x88
[18344.236792]  [<ffffffff81133b53>] ? maybe_pmd_mkwrite+0x1a/0x1a
[18344.236794]  [<ffffffff81059588>] kthread+0x107/0x10f
[18344.236797]  [<ffffffff81059481>] ? kthread_create_on_node+0x1ea/0x1ea
[18344.236799]  [<ffffffff8150c7bf>] ret_from_fork+0x3f/0x70
[18344.236801]  [<ffffffff81059481>] ? kthread_create_on_node+0x1ea/0x1ea

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
krzk pushed a commit to krzk/linux that referenced this pull request May 15, 2017
khugepaged does swap in during collapse under anon_vma lock. It causes
complain from lockdep. The trace below shows following scenario:

 - khugepaged tries to swap in a page under mmap_sem and anon_vma lock;
 - do_swap_page() calls swapin_readahead() with GFP_HIGHUSER_MOVABLE;
 - __read_swap_cache_async() tries to allocate the page for swap in;
 - lockdep_trace_alloc() in __alloc_pages_nodemask() notices that with
   given gfp_mask we could end up in direct relaim.
 - Lockdep already knows that reclaim sometimes (e.g. in case of
   split_huge_page()) wants to take anon_vma lock on its own.

Therefore deadlock is possible.

The fix is to take anon_vma lock after swap in.

[18344.236625] =================================
[18344.236628] [ INFO: inconsistent lock state ]
[18344.236633] 4.3.0-rc1-next-20150918-dbg-00014-ge5128d0-dirty torvalds#361 Not tainted
[18344.236636] ---------------------------------
[18344.236640] inconsistent {IN-RECLAIM_FS-W} -> {RECLAIM_FS-ON-W} usage.
[18344.236645] khugepaged/32 [HC0[0]:SC0[0]:HE1:SE1] takes:
[18344.236648]  (&anon_vma->rwsem){++++?.}, at: [<ffffffff81134403>] khugepaged+0x8b0/0x1987
[18344.236662] {IN-RECLAIM_FS-W} state was registered at:
[18344.236666]   [<ffffffff8107d747>] __lock_acquire+0x8e2/0x1183
[18344.236673]   [<ffffffff8107e7ac>] lock_acquire+0x10b/0x1a6
[18344.236678]   [<ffffffff8150a367>] down_write+0x3b/0x6a
[18344.236686]   [<ffffffff811360d8>] split_huge_page_to_list+0x5b/0x61f
[18344.236689]   [<ffffffff811224b3>] add_to_swap+0x37/0x78
[18344.236691]   [<ffffffff810fd650>] shrink_page_list+0x4c2/0xb9a
[18344.236694]   [<ffffffff810fe47c>] shrink_inactive_list+0x371/0x5d9
[18344.236696]   [<ffffffff810fee2f>] shrink_lruvec+0x410/0x5ae
[18344.236698]   [<ffffffff810ff024>] shrink_zone+0x57/0x140
[18344.236700]   [<ffffffff810ffc79>] kswapd+0x6a5/0x91b
[18344.236702]   [<ffffffff81059588>] kthread+0x107/0x10f
[18344.236706]   [<ffffffff8150c7bf>] ret_from_fork+0x3f/0x70
[18344.236708] irq event stamp: 6517947
[18344.236709] hardirqs last  enabled at (6517947): [<ffffffff810f2d0c>] get_page_from_freelist+0x362/0x59e
[18344.236713] hardirqs last disabled at (6517946): [<ffffffff8150ba41>] _raw_spin_lock_irqsave+0x18/0x51
[18344.236715] softirqs last  enabled at (6507072): [<ffffffff81041cb0>] __do_softirq+0x2df/0x3f5
[18344.236719] softirqs last disabled at (6507055): [<ffffffff81041fb5>] irq_exit+0x40/0x94
[18344.236722]
               other info that might help us debug this:
[18344.236723]  Possible unsafe locking scenario:

[18344.236724]        CPU0
[18344.236725]        ----
[18344.236726]   lock(&anon_vma->rwsem);
[18344.236728]   <Interrupt>
[18344.236729]     lock(&anon_vma->rwsem);
[18344.236731]
                *** DEADLOCK ***

[18344.236733] 2 locks held by khugepaged/32:
[18344.236733]  #0:  (&mm->mmap_sem){++++++}, at: [<ffffffff81134122>] khugepaged+0x5cf/0x1987
[18344.236738]  #1:  (&anon_vma->rwsem){++++?.}, at: [<ffffffff81134403>] khugepaged+0x8b0/0x1987
[18344.236741]
               stack backtrace:
[18344.236744] CPU: 3 PID: 32 Comm: khugepaged Not tainted 4.3.0-rc1-next-20150918-dbg-00014-ge5128d0-dirty torvalds#361
[18344.236747]  0000000000000000 ffff880132827a00 ffffffff81230867 ffffffff8237ba90
[18344.236750]  ffff880132827a38 ffffffff810ea9b9 000000000000000a ffff8801333b52e0
[18344.236753]  ffff8801333b4c00 ffffffff8107b3ce 000000000000000a ffff880132827a78
[18344.236755] Call Trace:
[18344.236758]  [<ffffffff81230867>] dump_stack+0x4e/0x79
[18344.236761]  [<ffffffff810ea9b9>] print_usage_bug.part.24+0x259/0x268
[18344.236763]  [<ffffffff8107b3ce>] ? print_shortest_lock_dependencies+0x180/0x180
[18344.236765]  [<ffffffff8107c7fc>] mark_lock+0x381/0x567
[18344.236766]  [<ffffffff8107ca40>] mark_held_locks+0x5e/0x74
[18344.236768]  [<ffffffff8107ee9f>] lockdep_trace_alloc+0xb0/0xb3
[18344.236771]  [<ffffffff810f30cc>] __alloc_pages_nodemask+0x99/0x856
[18344.236772]  [<ffffffff810ebaf9>] ? find_get_entry+0x14b/0x17a
[18344.236774]  [<ffffffff810ebb16>] ? find_get_entry+0x168/0x17a
[18344.236777]  [<ffffffff811226d9>] __read_swap_cache_async+0x7b/0x1aa
[18344.236778]  [<ffffffff8112281d>] read_swap_cache_async+0x15/0x2d
[18344.236780]  [<ffffffff8112294f>] swapin_readahead+0x11a/0x16a
[18344.236783]  [<ffffffff81112791>] do_swap_page+0xa7/0x36b
[18344.236784]  [<ffffffff81112791>] ? do_swap_page+0xa7/0x36b
[18344.236787]  [<ffffffff8113444c>] khugepaged+0x8f9/0x1987
[18344.236790]  [<ffffffff810772f3>] ? wait_woken+0x88/0x88
[18344.236792]  [<ffffffff81133b53>] ? maybe_pmd_mkwrite+0x1a/0x1a
[18344.236794]  [<ffffffff81059588>] kthread+0x107/0x10f
[18344.236797]  [<ffffffff81059481>] ? kthread_create_on_node+0x1ea/0x1ea
[18344.236799]  [<ffffffff8150c7bf>] ret_from_fork+0x3f/0x70
[18344.236801]  [<ffffffff81059481>] ? kthread_create_on_node+0x1ea/0x1ea

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Ebru Akagunduz <ebru.akagunduz@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
amery pushed a commit to linux-sunxi/linux-sunxi that referenced this pull request Jun 22, 2017
commit 10d784e upstream.

block plug callback could sleep, so we introduce a parameter
'from_schedule' and corresponding drivers can use it to destinguish a
schedule plug flush or a plug finish. Unfortunately io_schedule_out
still uses blk_flush_plug(). This causes below output (Note, I added a
might_sleep() in raid1_unplug to make it trigger faster, but the whole
thing doesn't matter if I add might_sleep). In raid1/10, this can cause
deadlock.

This patch makes io_schedule_out always uses blk_schedule_flush_plug.
This should only impact drivers (as far as I know, raid 1/10) which are
sensitive to the 'from_schedule' parameter.

[  370.817949] ------------[ cut here ]------------
[  370.817960] WARNING: CPU: 7 PID: 145 at ../kernel/sched/core.c:7306 __might_sleep+0x7f/0x90()
[  370.817969] do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff81092fcf>] prepare_to_wait+0x2f/0x90
[  370.817971] Modules linked in: raid1
[  370.817976] CPU: 7 PID: 145 Comm: kworker/u16:9 Tainted: G        W       4.0.0+ torvalds#361
[  370.817977] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153802- 04/01/2014
[  370.817983] Workqueue: writeback bdi_writeback_workfn (flush-9:1)
[  370.817985]  ffffffff81cd83be ffff8800ba8cb298 ffffffff819dd7af 0000000000000001
[  370.817988]  ffff8800ba8cb2e8 ffff8800ba8cb2d8 ffffffff81051afc ffff8800ba8cb2c8
[  370.817990]  ffffffffa00061a8 000000000000041e 0000000000000000 ffff8800ba8cba28
[  370.817993] Call Trace:
[  370.817999]  [<ffffffff819dd7af>] dump_stack+0x4f/0x7b
[  370.818002]  [<ffffffff81051afc>] warn_slowpath_common+0x8c/0xd0
[  370.818004]  [<ffffffff81051b86>] warn_slowpath_fmt+0x46/0x50
[  370.818006]  [<ffffffff81092fcf>] ? prepare_to_wait+0x2f/0x90
[  370.818008]  [<ffffffff81092fcf>] ? prepare_to_wait+0x2f/0x90
[  370.818010]  [<ffffffff810776ef>] __might_sleep+0x7f/0x90
[  370.818014]  [<ffffffffa0000c03>] raid1_unplug+0xd3/0x170 [raid1]
[  370.818024]  [<ffffffff81421d9a>] blk_flush_plug_list+0x8a/0x1e0
[  370.818028]  [<ffffffff819e3550>] ? bit_wait+0x50/0x50
[  370.818031]  [<ffffffff819e21b0>] io_schedule_timeout+0x130/0x140
[  370.818033]  [<ffffffff819e3586>] bit_wait_io+0x36/0x50
[  370.818034]  [<ffffffff819e31b5>] __wait_on_bit+0x65/0x90
[  370.818041]  [<ffffffff8125b67c>] ? ext4_read_block_bitmap_nowait+0xbc/0x630
[  370.818043]  [<ffffffff819e3550>] ? bit_wait+0x50/0x50
[  370.818045]  [<ffffffff819e3302>] out_of_line_wait_on_bit+0x72/0x80
[  370.818047]  [<ffffffff810935e0>] ? autoremove_wake_function+0x40/0x40
[  370.818050]  [<ffffffff811de744>] __wait_on_buffer+0x44/0x50
[  370.818053]  [<ffffffff8125ae80>] ext4_wait_block_bitmap+0xe0/0xf0
[  370.818058]  [<ffffffff812975d6>] ext4_mb_init_cache+0x206/0x790
[  370.818062]  [<ffffffff8114bc6c>] ? lru_cache_add+0x1c/0x50
[  370.818064]  [<ffffffff81297c7e>] ext4_mb_init_group+0x11e/0x200
[  370.818066]  [<ffffffff81298231>] ext4_mb_load_buddy+0x341/0x360
[  370.818068]  [<ffffffff8129a1a3>] ext4_mb_find_by_goal+0x93/0x2f0
[  370.818070]  [<ffffffff81295b54>] ? ext4_mb_normalize_request+0x1e4/0x5b0
[  370.818072]  [<ffffffff8129ab67>] ext4_mb_regular_allocator+0x67/0x460
[  370.818074]  [<ffffffff81295b54>] ? ext4_mb_normalize_request+0x1e4/0x5b0
[  370.818076]  [<ffffffff8129ca4b>] ext4_mb_new_blocks+0x4cb/0x620
[  370.818079]  [<ffffffff81290956>] ext4_ext_map_blocks+0x4c6/0x14d0
[  370.818081]  [<ffffffff812a4d4e>] ? ext4_es_lookup_extent+0x4e/0x290
[  370.818085]  [<ffffffff8126399d>] ext4_map_blocks+0x14d/0x4f0
[  370.818088]  [<ffffffff81266fbd>] ext4_writepages+0x76d/0xe50
[  370.818094]  [<ffffffff81149691>] do_writepages+0x21/0x50
[  370.818097]  [<ffffffff811d5c00>] __writeback_single_inode+0x60/0x490
[  370.818099]  [<ffffffff811d630a>] writeback_sb_inodes+0x2da/0x590
[  370.818103]  [<ffffffff811abf4b>] ? trylock_super+0x1b/0x50
[  370.818105]  [<ffffffff811abf4b>] ? trylock_super+0x1b/0x50
[  370.818107]  [<ffffffff811d665f>] __writeback_inodes_wb+0x9f/0xd0
[  370.818109]  [<ffffffff811d69db>] wb_writeback+0x34b/0x3c0
[  370.818111]  [<ffffffff811d70df>] bdi_writeback_workfn+0x23f/0x550
[  370.818116]  [<ffffffff8106bbd8>] process_one_work+0x1c8/0x570
[  370.818117]  [<ffffffff8106bb5b>] ? process_one_work+0x14b/0x570
[  370.818119]  [<ffffffff8106c09b>] worker_thread+0x11b/0x470
[  370.818121]  [<ffffffff8106bf80>] ? process_one_work+0x570/0x570
[  370.818124]  [<ffffffff81071868>] kthread+0xf8/0x110
[  370.818126]  [<ffffffff81071770>] ? kthread_create_on_node+0x210/0x210
[  370.818129]  [<ffffffff819e9322>] ret_from_fork+0x42/0x70
[  370.818131]  [<ffffffff81071770>] ? kthread_create_on_node+0x210/0x210
[  370.818132] ---[ end trace 7b4deb71e68b6605 ]---

V2: don't change ->in_iowait

Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Shaohua Li <shli@fb.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Change-Id: Idba4bc13069614dacf76633dbde117f79fab11de
vthanki pushed a commit to raumfeld/linux that referenced this pull request Jul 6, 2017
commit 10d784e upstream.

block plug callback could sleep, so we introduce a parameter
'from_schedule' and corresponding drivers can use it to destinguish a
schedule plug flush or a plug finish. Unfortunately io_schedule_out
still uses blk_flush_plug(). This causes below output (Note, I added a
might_sleep() in raid1_unplug to make it trigger faster, but the whole
thing doesn't matter if I add might_sleep). In raid1/10, this can cause
deadlock.

This patch makes io_schedule_out always uses blk_schedule_flush_plug.
This should only impact drivers (as far as I know, raid 1/10) which are
sensitive to the 'from_schedule' parameter.

[  370.817949] ------------[ cut here ]------------
[  370.817960] WARNING: CPU: 7 PID: 145 at ../kernel/sched/core.c:7306 __might_sleep+0x7f/0x90()
[  370.817969] do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff81092fcf>] prepare_to_wait+0x2f/0x90
[  370.817971] Modules linked in: raid1
[  370.817976] CPU: 7 PID: 145 Comm: kworker/u16:9 Tainted: G        W       4.0.0+ torvalds#361
[  370.817977] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153802- 04/01/2014
[  370.817983] Workqueue: writeback bdi_writeback_workfn (flush-9:1)
[  370.817985]  ffffffff81cd83be ffff8800ba8cb298 ffffffff819dd7af 0000000000000001
[  370.817988]  ffff8800ba8cb2e8 ffff8800ba8cb2d8 ffffffff81051afc ffff8800ba8cb2c8
[  370.817990]  ffffffffa00061a8 000000000000041e 0000000000000000 ffff8800ba8cba28
[  370.817993] Call Trace:
[  370.817999]  [<ffffffff819dd7af>] dump_stack+0x4f/0x7b
[  370.818002]  [<ffffffff81051afc>] warn_slowpath_common+0x8c/0xd0
[  370.818004]  [<ffffffff81051b86>] warn_slowpath_fmt+0x46/0x50
[  370.818006]  [<ffffffff81092fcf>] ? prepare_to_wait+0x2f/0x90
[  370.818008]  [<ffffffff81092fcf>] ? prepare_to_wait+0x2f/0x90
[  370.818010]  [<ffffffff810776ef>] __might_sleep+0x7f/0x90
[  370.818014]  [<ffffffffa0000c03>] raid1_unplug+0xd3/0x170 [raid1]
[  370.818024]  [<ffffffff81421d9a>] blk_flush_plug_list+0x8a/0x1e0
[  370.818028]  [<ffffffff819e3550>] ? bit_wait+0x50/0x50
[  370.818031]  [<ffffffff819e21b0>] io_schedule_timeout+0x130/0x140
[  370.818033]  [<ffffffff819e3586>] bit_wait_io+0x36/0x50
[  370.818034]  [<ffffffff819e31b5>] __wait_on_bit+0x65/0x90
[  370.818041]  [<ffffffff8125b67c>] ? ext4_read_block_bitmap_nowait+0xbc/0x630
[  370.818043]  [<ffffffff819e3550>] ? bit_wait+0x50/0x50
[  370.818045]  [<ffffffff819e3302>] out_of_line_wait_on_bit+0x72/0x80
[  370.818047]  [<ffffffff810935e0>] ? autoremove_wake_function+0x40/0x40
[  370.818050]  [<ffffffff811de744>] __wait_on_buffer+0x44/0x50
[  370.818053]  [<ffffffff8125ae80>] ext4_wait_block_bitmap+0xe0/0xf0
[  370.818058]  [<ffffffff812975d6>] ext4_mb_init_cache+0x206/0x790
[  370.818062]  [<ffffffff8114bc6c>] ? lru_cache_add+0x1c/0x50
[  370.818064]  [<ffffffff81297c7e>] ext4_mb_init_group+0x11e/0x200
[  370.818066]  [<ffffffff81298231>] ext4_mb_load_buddy+0x341/0x360
[  370.818068]  [<ffffffff8129a1a3>] ext4_mb_find_by_goal+0x93/0x2f0
[  370.818070]  [<ffffffff81295b54>] ? ext4_mb_normalize_request+0x1e4/0x5b0
[  370.818072]  [<ffffffff8129ab67>] ext4_mb_regular_allocator+0x67/0x460
[  370.818074]  [<ffffffff81295b54>] ? ext4_mb_normalize_request+0x1e4/0x5b0
[  370.818076]  [<ffffffff8129ca4b>] ext4_mb_new_blocks+0x4cb/0x620
[  370.818079]  [<ffffffff81290956>] ext4_ext_map_blocks+0x4c6/0x14d0
[  370.818081]  [<ffffffff812a4d4e>] ? ext4_es_lookup_extent+0x4e/0x290
[  370.818085]  [<ffffffff8126399d>] ext4_map_blocks+0x14d/0x4f0
[  370.818088]  [<ffffffff81266fbd>] ext4_writepages+0x76d/0xe50
[  370.818094]  [<ffffffff81149691>] do_writepages+0x21/0x50
[  370.818097]  [<ffffffff811d5c00>] __writeback_single_inode+0x60/0x490
[  370.818099]  [<ffffffff811d630a>] writeback_sb_inodes+0x2da/0x590
[  370.818103]  [<ffffffff811abf4b>] ? trylock_super+0x1b/0x50
[  370.818105]  [<ffffffff811abf4b>] ? trylock_super+0x1b/0x50
[  370.818107]  [<ffffffff811d665f>] __writeback_inodes_wb+0x9f/0xd0
[  370.818109]  [<ffffffff811d69db>] wb_writeback+0x34b/0x3c0
[  370.818111]  [<ffffffff811d70df>] bdi_writeback_workfn+0x23f/0x550
[  370.818116]  [<ffffffff8106bbd8>] process_one_work+0x1c8/0x570
[  370.818117]  [<ffffffff8106bb5b>] ? process_one_work+0x14b/0x570
[  370.818119]  [<ffffffff8106c09b>] worker_thread+0x11b/0x470
[  370.818121]  [<ffffffff8106bf80>] ? process_one_work+0x570/0x570
[  370.818124]  [<ffffffff81071868>] kthread+0xf8/0x110
[  370.818126]  [<ffffffff81071770>] ? kthread_create_on_node+0x210/0x210
[  370.818129]  [<ffffffff819e9322>] ret_from_fork+0x42/0x70
[  370.818131]  [<ffffffff81071770>] ? kthread_create_on_node+0x210/0x210
[  370.818132] ---[ end trace 7b4deb71e68b6605 ]---

V2: don't change ->in_iowait

Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Shaohua Li <shli@fb.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Cc: poma <pomidorabelisima@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
jgunthorpe added a commit to jgunthorpe/linux that referenced this pull request Mar 29, 2018
process_one_req() can race with rdma_addr_cancel():

           CPU0                                 CPU1
           ====                                 ====
 process_one_work()
  debug_work_deactivate(work);
  process_one_req()
                                        rdma_addr_cancel()
	                                  mutex_lock(&lock);
 			    	           set_timeout(&req->work,..);
                                              __queue_work()
				   	       debug_work_activate(work);
	                                  mutex_unlock(&lock);

   mutex_lock(&lock);
[..]
	list_del(&req->list);
   mutex_unlock(&lock);
[..]

   // ODEBUG explodes since the work is still queued.
   kfree(req);

Causing ODEBUG to detect the use after free:

ODEBUG: free active (active state 0) object type: work_struct hint: process_one_req+0x0/0x6c0 include/net/dst.h:165
WARNING: CPU: 0 PID: 79 at lib/debugobjects.c:291 debug_print_object+0x166/0x220 lib/debugobjects.c:288
kvm: emulating exchange as write
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 79 Comm: kworker/u4:3 Not tainted 4.16.0-rc6+ torvalds#361
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: ib_addr process_one_req
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 panic+0x1e4/0x41c kernel/panic.c:183
 __warn+0x1dc/0x200 kernel/panic.c:547
 report_bug+0x1f4/0x2b0 lib/bug.c:186
 fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
 fixup_bug arch/x86/kernel/traps.c:247 [inline]
 do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
 invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:986
RIP: 0010:debug_print_object+0x166/0x220 lib/debugobjects.c:288
RSP: 0000:ffff8801d966f210 EFLAGS: 00010086
RAX: dffffc0000000008 RBX: 0000000000000003 RCX: ffffffff815acd6e
RDX: 0000000000000000 RSI: 1ffff1003b2cddf2 RDI: 0000000000000000
RBP: ffff8801d966f250 R08: 0000000000000000 R09: 1ffff1003b2cddc8
R10: ffffed003b2cde71 R11: ffffffff86f39a98 R12: 0000000000000001
R13: ffffffff86f15540 R14: ffffffff86408700 R15: ffffffff8147c0a0
 __debug_check_no_obj_freed lib/debugobjects.c:745 [inline]
 debug_check_no_obj_freed+0x662/0xf1f lib/debugobjects.c:774
 kfree+0xc7/0x260 mm/slab.c:3799
 process_one_req+0x2e7/0x6c0 drivers/infiniband/core/addr.c:592
 process_one_work+0xc47/0x1bb0 kernel/workqueue.c:2113
 worker_thread+0x223/0x1990 kernel/workqueue.c:2247
 kthread+0x33c/0x400 kernel/kthread.c:238
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:406

Fixes: 5fff41e ("IB/core: Fix race condition in resolving IP to MAC")
Reported-by: <syzbot+3b4acab09b6463472d0a@syzkaller.appspotmail.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
damentz pushed a commit to zen-kernel/zen-kernel that referenced this pull request Apr 8, 2018
commit 9137108 upstream.

process_one_req() can race with rdma_addr_cancel():

           CPU0                                 CPU1
           ====                                 ====
 process_one_work()
  debug_work_deactivate(work);
  process_one_req()
                                        rdma_addr_cancel()
	                                  mutex_lock(&lock);
 			    	           set_timeout(&req->work,..);
                                              __queue_work()
				   	       debug_work_activate(work);
	                                  mutex_unlock(&lock);

   mutex_lock(&lock);
[..]
	list_del(&req->list);
   mutex_unlock(&lock);
[..]

   // ODEBUG explodes since the work is still queued.
   kfree(req);

Causing ODEBUG to detect the use after free:

ODEBUG: free active (active state 0) object type: work_struct hint: process_one_req+0x0/0x6c0 include/net/dst.h:165
WARNING: CPU: 0 PID: 79 at lib/debugobjects.c:291 debug_print_object+0x166/0x220 lib/debugobjects.c:288
kvm: emulating exchange as write
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 79 Comm: kworker/u4:3 Not tainted 4.16.0-rc6+ torvalds#361
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: ib_addr process_one_req
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 panic+0x1e4/0x41c kernel/panic.c:183
 __warn+0x1dc/0x200 kernel/panic.c:547
 report_bug+0x1f4/0x2b0 lib/bug.c:186
 fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
 fixup_bug arch/x86/kernel/traps.c:247 [inline]
 do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
 invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:986
RIP: 0010:debug_print_object+0x166/0x220 lib/debugobjects.c:288
RSP: 0000:ffff8801d966f210 EFLAGS: 00010086
RAX: dffffc0000000008 RBX: 0000000000000003 RCX: ffffffff815acd6e
RDX: 0000000000000000 RSI: 1ffff1003b2cddf2 RDI: 0000000000000000
RBP: ffff8801d966f250 R08: 0000000000000000 R09: 1ffff1003b2cddc8
R10: ffffed003b2cde71 R11: ffffffff86f39a98 R12: 0000000000000001
R13: ffffffff86f15540 R14: ffffffff86408700 R15: ffffffff8147c0a0
 __debug_check_no_obj_freed lib/debugobjects.c:745 [inline]
 debug_check_no_obj_freed+0x662/0xf1f lib/debugobjects.c:774
 kfree+0xc7/0x260 mm/slab.c:3799
 process_one_req+0x2e7/0x6c0 drivers/infiniband/core/addr.c:592
 process_one_work+0xc47/0x1bb0 kernel/workqueue.c:2113
 worker_thread+0x223/0x1990 kernel/workqueue.c:2247
 kthread+0x33c/0x400 kernel/kthread.c:238
 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:406

Fixes: 5fff41e ("IB/core: Fix race condition in resolving IP to MAC")
Reported-by: <syzbot+3b4acab09b6463472d0a@syzkaller.appspotmail.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Jul 28, 2018
Registration of a memory region(MR) through FRMR/fastreg(unlike FMR)
needs a connection/qp. With a proxy qp, this dependency on connection
will be removed, but that needs more infrastructure patches, which is a
work in progress.

As an intermediate fix, the get_mr returns EOPNOTSUPP when connection
details are not populated. The MR registration through sendmsg() will
continue to work even with fast registration, since connection in this
case is formed upfront.

This patch fixes the following crash:
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
Modules linked in:
CPU: 1 PID: 4244 Comm: syzkaller468044 Not tainted 4.16.0-rc6+ torvalds#361
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:rds_ib_get_mr+0x5c/0x230 net/rds/ib_rdma.c:544
RSP: 0018:ffff8801b059f890 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff8801b07e1300 RCX: ffffffff8562d96e
RDX: 000000000000000d RSI: 0000000000000001 RDI: 0000000000000068
RBP: ffff8801b059f8b8 R08: ffffed0036274244 R09: ffff8801b13a1200
R10: 0000000000000004 R11: ffffed0036274243 R12: ffff8801b13a1200
R13: 0000000000000001 R14: ffff8801ca09fa9c R15: 0000000000000000
FS:  00007f4d050af700(0000) GS:ffff8801db300000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4d050aee78 CR3: 00000001b0d9b006 CR4: 00000000001606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __rds_rdma_map+0x710/0x1050 net/rds/rdma.c:271
 rds_get_mr_for_dest+0x1d4/0x2c0 net/rds/rdma.c:357
 rds_setsockopt+0x6cc/0x980 net/rds/af_rds.c:347
 SYSC_setsockopt net/socket.c:1849 [inline]
 SyS_setsockopt+0x189/0x360 net/socket.c:1828
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4456d9
RSP: 002b:00007f4d050aedb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00000000006dac3c RCX: 00000000004456d9
RDX: 0000000000000007 RSI: 0000000000000114 RDI: 0000000000000004
RBP: 00000000006dac38 R08: 00000000000000a0 R09: 0000000000000000
R10: 0000000020000380 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffbfb36d6f R14: 00007f4d050af9c0 R15: 0000000000000005
Code: fa 48 c1 ea 03 80 3c 02 00 0f 85 cc 01 00 00 4c 8b bb 80 04 00 00
48
b8 00 00 00 00 00 fc ff df 49 8d 7f 68 48 89 fa 48 c1 ea 03 <80> 3c 02
00 0f
85 9c 01 00 00 4d 8b 7f 68 48 b8 00 00 00 00 00
RIP: rds_ib_get_mr+0x5c/0x230 net/rds/ib_rdma.c:544 RSP:
ffff8801b059f890
---[ end trace 7e1cea13b85473b0 ]---

Reported-by: syzbot+b51c77ef956678a65834@syzkaller.appspotmail.com
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Avinash Repaka <avinash.repaka@oracle.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
amery pushed a commit to linux-sunxi/linux-sunxi that referenced this pull request Jul 31, 2018
block plug callback could sleep, so we introduce a parameter
'from_schedule' and corresponding drivers can use it to destinguish a
schedule plug flush or a plug finish. Unfortunately io_schedule_out
still uses blk_flush_plug(). This causes below output (Note, I added a
might_sleep() in raid1_unplug to make it trigger faster, but the whole
thing doesn't matter if I add might_sleep). In raid1/10, this can cause
deadlock.

This patch makes io_schedule_out always uses blk_schedule_flush_plug.
This should only impact drivers (as far as I know, raid 1/10) which are
sensitive to the 'from_schedule' parameter.

[  370.817949] ------------[ cut here ]------------
[  370.817960] WARNING: CPU: 7 PID: 145 at ../kernel/sched/core.c:7306 __might_sleep+0x7f/0x90()
[  370.817969] do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff81092fcf>] prepare_to_wait+0x2f/0x90
[  370.817971] Modules linked in: raid1
[  370.817976] CPU: 7 PID: 145 Comm: kworker/u16:9 Tainted: G        W       4.0.0+ torvalds#361
[  370.817977] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140709_153802- 04/01/2014
[  370.817983] Workqueue: writeback bdi_writeback_workfn (flush-9:1)
[  370.817985]  ffffffff81cd83be ffff8800ba8cb298 ffffffff819dd7af 0000000000000001
[  370.817988]  ffff8800ba8cb2e8 ffff8800ba8cb2d8 ffffffff81051afc ffff8800ba8cb2c8
[  370.817990]  ffffffffa00061a8 000000000000041e 0000000000000000 ffff8800ba8cba28
[  370.817993] Call Trace:
[  370.817999]  [<ffffffff819dd7af>] dump_stack+0x4f/0x7b
[  370.818002]  [<ffffffff81051afc>] warn_slowpath_common+0x8c/0xd0
[  370.818004]  [<ffffffff81051b86>] warn_slowpath_fmt+0x46/0x50
[  370.818006]  [<ffffffff81092fcf>] ? prepare_to_wait+0x2f/0x90
[  370.818008]  [<ffffffff81092fcf>] ? prepare_to_wait+0x2f/0x90
[  370.818010]  [<ffffffff810776ef>] __might_sleep+0x7f/0x90
[  370.818014]  [<ffffffffa0000c03>] raid1_unplug+0xd3/0x170 [raid1]
[  370.818024]  [<ffffffff81421d9a>] blk_flush_plug_list+0x8a/0x1e0
[  370.818028]  [<ffffffff819e3550>] ? bit_wait+0x50/0x50
[  370.818031]  [<ffffffff819e21b0>] io_schedule_timeout+0x130/0x140
[  370.818033]  [<ffffffff819e3586>] bit_wait_io+0x36/0x50
[  370.818034]  [<ffffffff819e31b5>] __wait_on_bit+0x65/0x90
[  370.818041]  [<ffffffff8125b67c>] ? ext4_read_block_bitmap_nowait+0xbc/0x630
[  370.818043]  [<ffffffff819e3550>] ? bit_wait+0x50/0x50
[  370.818045]  [<ffffffff819e3302>] out_of_line_wait_on_bit+0x72/0x80
[  370.818047]  [<ffffffff810935e0>] ? autoremove_wake_function+0x40/0x40
[  370.818050]  [<ffffffff811de744>] __wait_on_buffer+0x44/0x50
[  370.818053]  [<ffffffff8125ae80>] ext4_wait_block_bitmap+0xe0/0xf0
[  370.818058]  [<ffffffff812975d6>] ext4_mb_init_cache+0x206/0x790
[  370.818062]  [<ffffffff8114bc6c>] ? lru_cache_add+0x1c/0x50
[  370.818064]  [<ffffffff81297c7e>] ext4_mb_init_group+0x11e/0x200
[  370.818066]  [<ffffffff81298231>] ext4_mb_load_buddy+0x341/0x360
[  370.818068]  [<ffffffff8129a1a3>] ext4_mb_find_by_goal+0x93/0x2f0
[  370.818070]  [<ffffffff81295b54>] ? ext4_mb_normalize_request+0x1e4/0x5b0
[  370.818072]  [<ffffffff8129ab67>] ext4_mb_regular_allocator+0x67/0x460
[  370.818074]  [<ffffffff81295b54>] ? ext4_mb_normalize_request+0x1e4/0x5b0
[  370.818076]  [<ffffffff8129ca4b>] ext4_mb_new_blocks+0x4cb/0x620
[  370.818079]  [<ffffffff81290956>] ext4_ext_map_blocks+0x4c6/0x14d0
[  370.818081]  [<ffffffff812a4d4e>] ? ext4_es_lookup_extent+0x4e/0x290
[  370.818085]  [<ffffffff8126399d>] ext4_map_blocks+0x14d/0x4f0
[  370.818088]  [<ffffffff81266fbd>] ext4_writepages+0x76d/0xe50
[  370.818094]  [<ffffffff81149691>] do_writepages+0x21/0x50
[  370.818097]  [<ffffffff811d5c00>] __writeback_single_inode+0x60/0x490
[  370.818099]  [<ffffffff811d630a>] writeback_sb_inodes+0x2da/0x590
[  370.818103]  [<ffffffff811abf4b>] ? trylock_super+0x1b/0x50
[  370.818105]  [<ffffffff811abf4b>] ? trylock_super+0x1b/0x50
[  370.818107]  [<ffffffff811d665f>] __writeback_inodes_wb+0x9f/0xd0
[  370.818109]  [<ffffffff811d69db>] wb_writeback+0x34b/0x3c0
[  370.818111]  [<ffffffff811d70df>] bdi_writeback_workfn+0x23f/0x550
[  370.818116]  [<ffffffff8106bbd8>] process_one_work+0x1c8/0x570
[  370.818117]  [<ffffffff8106bb5b>] ? process_one_work+0x14b/0x570
[  370.818119]  [<ffffffff8106c09b>] worker_thread+0x11b/0x470
[  370.818121]  [<ffffffff8106bf80>] ? process_one_work+0x570/0x570
[  370.818124]  [<ffffffff81071868>] kthread+0xf8/0x110
[  370.818126]  [<ffffffff81071770>] ? kthread_create_on_node+0x210/0x210
[  370.818129]  [<ffffffff819e9322>] ret_from_fork+0x42/0x70
[  370.818131]  [<ffffffff81071770>] ? kthread_create_on_node+0x210/0x210
[  370.818132] ---[ end trace 7b4deb71e68b6605 ]---

V2: don't change ->in_iowait

Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Shaohua Li <shli@fb.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
heftig pushed a commit to zen-kernel/zen-kernel that referenced this pull request Aug 3, 2018
[ Upstream commit 9e630bc ]

Registration of a memory region(MR) through FRMR/fastreg(unlike FMR)
needs a connection/qp. With a proxy qp, this dependency on connection
will be removed, but that needs more infrastructure patches, which is a
work in progress.

As an intermediate fix, the get_mr returns EOPNOTSUPP when connection
details are not populated. The MR registration through sendmsg() will
continue to work even with fast registration, since connection in this
case is formed upfront.

This patch fixes the following crash:
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
Modules linked in:
CPU: 1 PID: 4244 Comm: syzkaller468044 Not tainted 4.16.0-rc6+ torvalds#361
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:rds_ib_get_mr+0x5c/0x230 net/rds/ib_rdma.c:544
RSP: 0018:ffff8801b059f890 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff8801b07e1300 RCX: ffffffff8562d96e
RDX: 000000000000000d RSI: 0000000000000001 RDI: 0000000000000068
RBP: ffff8801b059f8b8 R08: ffffed0036274244 R09: ffff8801b13a1200
R10: 0000000000000004 R11: ffffed0036274243 R12: ffff8801b13a1200
R13: 0000000000000001 R14: ffff8801ca09fa9c R15: 0000000000000000
FS:  00007f4d050af700(0000) GS:ffff8801db300000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4d050aee78 CR3: 00000001b0d9b006 CR4: 00000000001606e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __rds_rdma_map+0x710/0x1050 net/rds/rdma.c:271
 rds_get_mr_for_dest+0x1d4/0x2c0 net/rds/rdma.c:357
 rds_setsockopt+0x6cc/0x980 net/rds/af_rds.c:347
 SYSC_setsockopt net/socket.c:1849 [inline]
 SyS_setsockopt+0x189/0x360 net/socket.c:1828
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x4456d9
RSP: 002b:00007f4d050aedb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00000000006dac3c RCX: 00000000004456d9
RDX: 0000000000000007 RSI: 0000000000000114 RDI: 0000000000000004
RBP: 00000000006dac38 R08: 00000000000000a0 R09: 0000000000000000
R10: 0000000020000380 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffbfb36d6f R14: 00007f4d050af9c0 R15: 0000000000000005
Code: fa 48 c1 ea 03 80 3c 02 00 0f 85 cc 01 00 00 4c 8b bb 80 04 00 00
48
b8 00 00 00 00 00 fc ff df 49 8d 7f 68 48 89 fa 48 c1 ea 03 <80> 3c 02
00 0f
85 9c 01 00 00 4d 8b 7f 68 48 b8 00 00 00 00 00
RIP: rds_ib_get_mr+0x5c/0x230 net/rds/ib_rdma.c:544 RSP:
ffff8801b059f890
---[ end trace 7e1cea13b85473b0 ]---

Reported-by: syzbot+b51c77ef956678a65834@syzkaller.appspotmail.com
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Avinash Repaka <avinash.repaka@oracle.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tobetter pushed a commit to tobetter/linux that referenced this pull request Jan 19, 2019
Update amlogic vpu code to changes required for Kodi v18 Leia to work…
Mic92 pushed a commit to Mic92/linux that referenced this pull request Feb 4, 2019
DPDK backend refactor and offload support
ruscur pushed a commit to ruscur/linux that referenced this pull request Feb 26, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 2, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 4, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 5, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 10, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 12, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 13, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 16, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 23, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 24, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 27, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 30, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Mar 31, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Apr 2, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Apr 3, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
ruscur pushed a commit to ruscur/linux that referenced this pull request Apr 6, 2020
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
torvalds#12:
Save 2 atomic ops, 1 allocation, 1 free per open/read/close sequence for such

WARNING: braces {} are not necessary for single statement blocks
torvalds#163: FILE: fs/proc/generic.c:536:
+	if (pde->proc_ops->proc_flags & PROC_ENTRY_PERMANENT) {
+		pde->flags |= PROC_ENTRY_PERMANENT;
+	}

WARNING: line over 80 characters
torvalds#203: FILE: fs/proc/generic.c:676:
+			WARN(1, "removing permanent /proc entry '%s'", de->name);

WARNING: braces {} are not necessary for single statement blocks
torvalds#207: FILE: fs/proc/generic.c:680:
+			if (S_ISDIR(de->mode)) {
+				parent->nlink--;
+			}

WARNING: line over 80 characters
torvalds#244: FILE: fs/proc/inode.c:198:
+static loff_t pde_lseek(struct proc_dir_entry *pde, struct file *file, loff_t offset, int whence)

WARNING: line over 80 characters
torvalds#274: FILE: fs/proc/inode.c:222:
+static ssize_t pde_read(struct proc_dir_entry *pde, struct file *file, char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#303: FILE: fs/proc/inode.c:246:
+static ssize_t pde_write(struct proc_dir_entry *pde, struct file *file, const char __user *buf, size_t count, loff_t *ppos)

WARNING: line over 80 characters
torvalds#332: FILE: fs/proc/inode.c:270:
+static __poll_t pde_poll(struct proc_dir_entry *pde, struct file *file, struct poll_table_struct *pts)

WARNING: line over 80 characters
torvalds#361: FILE: fs/proc/inode.c:294:
+static long pde_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#391: FILE: fs/proc/inode.c:319:
+static long pde_compat_ioctl(struct proc_dir_entry *pde, struct file *file, unsigned int cmd, unsigned long arg)

WARNING: line over 80 characters
torvalds#421: FILE: fs/proc/inode.c:343:
+static int pde_mmap(struct proc_dir_entry *pde, struct file *file, struct vm_area_struct *vma)

WARNING: line over 80 characters
torvalds#452: FILE: fs/proc/inode.c:368:
+pde_get_unmapped_area(struct proc_dir_entry *pde, struct file *file, unsigned long orig_addr,

WARNING: line over 80 characters
torvalds#489: FILE: fs/proc/inode.c:393:
+		return pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: line over 80 characters
torvalds#491: FILE: fs/proc/inode.c:395:
+		rv = pde_get_unmapped_area(pde, file, orig_addr, len, pgoff, flags);

WARNING: braces {} are not necessary for single statement blocks
torvalds#518: FILE: fs/proc/inode.c:470:
+		if (release) {
+			return release(inode, file);
+		}

total: 0 errors, 15 warnings, 462 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

./patches/proc-faster-open-read-close-with-permanent-files.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
nbdd0121 pushed a commit to nbdd0121/linux that referenced this pull request Jun 7, 2021
Support unit tests and doctests
kikei pushed a commit to kikei/linux that referenced this pull request Jan 17, 2023
…ations

The late_alloc() PTE allocation function used by create_mapping_late()
does not call pgtable_page_ctor() on PTE pages it allocates, leaving
the per-page spinlock uninitialized.

Since generic page table manipulation code may assume that translation
table pages that are not owned by init_mm are covered by fully
constructed struct pages, the following crash may occur with the new
UEFI memory attributes table code.

  efi: memattr: Processing EFI Memory Attributes table:
  efi: memattr:  0x0000ffa16000-0x0000ffa82fff [Runtime Code       |RUN|  |  |XP|  |  |  |   |  |  |  |  ]
  Unable to handle kernel NULL pointer dereference at virtual address 00000010
  pgd = c0204000
  [00000010] *pgd=00000000
  Internal error: Oops: 5 [#1] SMP ARM
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.7.0-rc4-00063-g3882aa7b340b torvalds#361
  Hardware name: Generic DT based system
  task: ed858000 ti: ed842000 task.ti: ed842000
  PC is at __lock_acquire+0xa0/0x19a8
  ...
  [<c038c830>] (__lock_acquire) from [<c038e4f8>] (lock_acquire+0x6c/0x88)
  [<c038e4f8>] (lock_acquire) from [<c0c06134>] (_raw_spin_lock+0x2c/0x3c)
  [<c0c06134>] (_raw_spin_lock) from [<c0410384>] (apply_to_page_range+0xe8/0x238)
  [<c0410384>] (apply_to_page_range) from [<c1205f34>] (efi_set_mapping_permissions+0x54/0x5c)
  [<c1205f34>] (efi_set_mapping_permissions) from [<c1247474>] (efi_memattr_apply_permissions+0x2b8/0x378)
  [<c1247474>] (efi_memattr_apply_permissions) from [<c1248258>] (arm_enable_runtime_services+0x1f0/0x22c)
  [<c1248258>] (arm_enable_runtime_services) from [<c0301f0c>] (do_one_initcall+0x44/0x174)
  [<c0301f0c>] (do_one_initcall) from [<c1200d10>] (kernel_init_freeable+0x90/0x1e8)
  [<c1200d10>] (kernel_init_freeable) from [<c0bff690>] (kernel_init+0x8/0x114)
  [<c0bff690>] (kernel_init) from [<c0307ed0>] (ret_from_fork+0x14/0x24)

The crash is due to the fact that the UEFI page tables are not owned by
init_mm, but are not covered by fully constructed struct pages.

Given that the UEFI subsystem is currently the only user of
create_mapping_late(), add an unconditional call to pgtable_page_ctor() to
late_alloc().

Fixes: 9fc68b7 ("ARM/efi: Apply strict permissions for UEFI Runtime Services regions")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Mar 7, 2023
When sock_alloc_file fails to allocate a file, it will call sock_release.
__sys_socket_file should then not call sock_release again, otherwise there
will be a double free.

[   89.319884] ------------[ cut here ]------------
[   89.320286] kernel BUG at fs/inode.c:1764!
[   89.320656] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[   89.321051] CPU: 7 PID: 125 Comm: iou-sqp-124 Not tainted 6.2.0+ torvalds#361
[   89.321535] RIP: 0010:iput+0x1ff/0x240
[   89.321808] Code: d1 83 e1 03 48 83 f9 02 75 09 48 81 fa 00 10 00 00 77 05 83 e2 01 75 1f 4c 89 ef e8 fb d2 ba 00 e9 80 fe ff ff c3 cc cc cc cc <0f> 0b 0f 0b e9 d0 fe ff ff 0f 0b eb 8d 49 8d b4 24 08 01 00 00 48
[   89.322760] RSP: 0018:ffffbdd60068bd50 EFLAGS: 00010202
[   89.323036] RAX: 0000000000000000 RBX: ffff9d7ad3cacac0 RCX: 0000000000001107
[   89.323412] RDX: 000000000003af00 RSI: 0000000000000000 RDI: ffff9d7ad3cacb40
[   89.323785] RBP: ffffbdd60068bd68 R08: ffffffffffffffff R09: ffffffffab606438
[   89.324157] R10: ffffffffacb3dfa0 R11: 6465686361657256 R12: ffff9d7ad3cacb40
[   89.324529] R13: 0000000080000001 R14: 0000000080000001 R15: 0000000000000002
[   89.324904] FS:  00007f7b28516740(0000) GS:ffff9d7aeb1c0000(0000) knlGS:0000000000000000
[   89.325328] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   89.325629] CR2: 00007f0af52e96c0 CR3: 0000000002a02006 CR4: 0000000000770ee0
[   89.326004] PKRU: 55555554
[   89.326161] Call Trace:
[   89.326298]  <TASK>
[   89.326419]  __sock_release+0xb5/0xc0
[   89.326632]  __sys_socket_file+0xb2/0xd0
[   89.326844]  io_socket+0x88/0x100
[   89.327039]  ? io_issue_sqe+0x6a/0x430
[   89.327258]  io_issue_sqe+0x67/0x430
[   89.327450]  io_submit_sqes+0x1fe/0x670
[   89.327661]  io_sq_thread+0x2e6/0x530
[   89.327859]  ? __pfx_autoremove_wake_function+0x10/0x10
[   89.328145]  ? __pfx_io_sq_thread+0x10/0x10
[   89.328367]  ret_from_fork+0x29/0x50
[   89.328576] RIP: 0033:0x0
[   89.328732] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   89.329073] RSP: 002b:0000000000000000 EFLAGS: 00000202 ORIG_RAX: 00000000000001a9
[   89.329477] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f7b28637a3d
[   89.329845] RDX: 00007fff4e4318a8 RSI: 00007fff4e4318b0 RDI: 0000000000000400
[   89.330216] RBP: 00007fff4e431830 R08: 00007fff4e431711 R09: 00007fff4e4318b0
[   89.330584] R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff4e441b38
[   89.330950] R13: 0000563835e3e725 R14: 0000563835e40d10 R15: 00007f7b28784040
[   89.331318]  </TASK>
[   89.331441] Modules linked in:
[   89.331617] ---[ end trace 0000000000000000 ]---

Fixes: da214a4 ("net: add __sys_socket_file()")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Eric Dumazet <edumazet@google.com>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Mar 9, 2023
When sock_alloc_file fails to allocate a file, it will call sock_release.
__sys_socket_file should then not call sock_release again, otherwise there
will be a double free.

[   89.319884] ------------[ cut here ]------------
[   89.320286] kernel BUG at fs/inode.c:1764!
[   89.320656] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[   89.321051] CPU: 7 PID: 125 Comm: iou-sqp-124 Not tainted 6.2.0+ torvalds#361
[   89.321535] RIP: 0010:iput+0x1ff/0x240
[   89.321808] Code: d1 83 e1 03 48 83 f9 02 75 09 48 81 fa 00 10 00 00 77 05 83 e2 01 75 1f 4c 89 ef e8 fb d2 ba 00 e9 80 fe ff ff c3 cc cc cc cc <0f> 0b 0f 0b e9 d0 fe ff ff 0f 0b eb 8d 49 8d b4 24 08 01 00 00 48
[   89.322760] RSP: 0018:ffffbdd60068bd50 EFLAGS: 00010202
[   89.323036] RAX: 0000000000000000 RBX: ffff9d7ad3cacac0 RCX: 0000000000001107
[   89.323412] RDX: 000000000003af00 RSI: 0000000000000000 RDI: ffff9d7ad3cacb40
[   89.323785] RBP: ffffbdd60068bd68 R08: ffffffffffffffff R09: ffffffffab606438
[   89.324157] R10: ffffffffacb3dfa0 R11: 6465686361657256 R12: ffff9d7ad3cacb40
[   89.324529] R13: 0000000080000001 R14: 0000000080000001 R15: 0000000000000002
[   89.324904] FS:  00007f7b28516740(0000) GS:ffff9d7aeb1c0000(0000) knlGS:0000000000000000
[   89.325328] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   89.325629] CR2: 00007f0af52e96c0 CR3: 0000000002a02006 CR4: 0000000000770ee0
[   89.326004] PKRU: 55555554
[   89.326161] Call Trace:
[   89.326298]  <TASK>
[   89.326419]  __sock_release+0xb5/0xc0
[   89.326632]  __sys_socket_file+0xb2/0xd0
[   89.326844]  io_socket+0x88/0x100
[   89.327039]  ? io_issue_sqe+0x6a/0x430
[   89.327258]  io_issue_sqe+0x67/0x430
[   89.327450]  io_submit_sqes+0x1fe/0x670
[   89.327661]  io_sq_thread+0x2e6/0x530
[   89.327859]  ? __pfx_autoremove_wake_function+0x10/0x10
[   89.328145]  ? __pfx_io_sq_thread+0x10/0x10
[   89.328367]  ret_from_fork+0x29/0x50
[   89.328576] RIP: 0033:0x0
[   89.328732] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   89.329073] RSP: 002b:0000000000000000 EFLAGS: 00000202 ORIG_RAX: 00000000000001a9
[   89.329477] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f7b28637a3d
[   89.329845] RDX: 00007fff4e4318a8 RSI: 00007fff4e4318b0 RDI: 0000000000000400
[   89.330216] RBP: 00007fff4e431830 R08: 00007fff4e431711 R09: 00007fff4e4318b0
[   89.330584] R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff4e441b38
[   89.330950] R13: 0000563835e3e725 R14: 0000563835e40d10 R15: 00007f7b28784040
[   89.331318]  </TASK>
[   89.331441] Modules linked in:
[   89.331617] ---[ end trace 0000000000000000 ]---

Fixes: da214a4 ("net: add __sys_socket_file()")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230307173707.468744-1-cascardo@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Mar 10, 2023
commit 649c15c upstream.

When sock_alloc_file fails to allocate a file, it will call sock_release.
__sys_socket_file should then not call sock_release again, otherwise there
will be a double free.

[   89.319884] ------------[ cut here ]------------
[   89.320286] kernel BUG at fs/inode.c:1764!
[   89.320656] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[   89.321051] CPU: 7 PID: 125 Comm: iou-sqp-124 Not tainted 6.2.0+ torvalds#361
[   89.321535] RIP: 0010:iput+0x1ff/0x240
[   89.321808] Code: d1 83 e1 03 48 83 f9 02 75 09 48 81 fa 00 10 00 00 77 05 83 e2 01 75 1f 4c 89 ef e8 fb d2 ba 00 e9 80 fe ff ff c3 cc cc cc cc <0f> 0b 0f 0b e9 d0 fe ff ff 0f 0b eb 8d 49 8d b4 24 08 01 00 00 48
[   89.322760] RSP: 0018:ffffbdd60068bd50 EFLAGS: 00010202
[   89.323036] RAX: 0000000000000000 RBX: ffff9d7ad3cacac0 RCX: 0000000000001107
[   89.323412] RDX: 000000000003af00 RSI: 0000000000000000 RDI: ffff9d7ad3cacb40
[   89.323785] RBP: ffffbdd60068bd68 R08: ffffffffffffffff R09: ffffffffab606438
[   89.324157] R10: ffffffffacb3dfa0 R11: 6465686361657256 R12: ffff9d7ad3cacb40
[   89.324529] R13: 0000000080000001 R14: 0000000080000001 R15: 0000000000000002
[   89.324904] FS:  00007f7b28516740(0000) GS:ffff9d7aeb1c0000(0000) knlGS:0000000000000000
[   89.325328] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   89.325629] CR2: 00007f0af52e96c0 CR3: 0000000002a02006 CR4: 0000000000770ee0
[   89.326004] PKRU: 55555554
[   89.326161] Call Trace:
[   89.326298]  <TASK>
[   89.326419]  __sock_release+0xb5/0xc0
[   89.326632]  __sys_socket_file+0xb2/0xd0
[   89.326844]  io_socket+0x88/0x100
[   89.327039]  ? io_issue_sqe+0x6a/0x430
[   89.327258]  io_issue_sqe+0x67/0x430
[   89.327450]  io_submit_sqes+0x1fe/0x670
[   89.327661]  io_sq_thread+0x2e6/0x530
[   89.327859]  ? __pfx_autoremove_wake_function+0x10/0x10
[   89.328145]  ? __pfx_io_sq_thread+0x10/0x10
[   89.328367]  ret_from_fork+0x29/0x50
[   89.328576] RIP: 0033:0x0
[   89.328732] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   89.329073] RSP: 002b:0000000000000000 EFLAGS: 00000202 ORIG_RAX: 00000000000001a9
[   89.329477] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f7b28637a3d
[   89.329845] RDX: 00007fff4e4318a8 RSI: 00007fff4e4318b0 RDI: 0000000000000400
[   89.330216] RBP: 00007fff4e431830 R08: 00007fff4e431711 R09: 00007fff4e4318b0
[   89.330584] R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff4e441b38
[   89.330950] R13: 0000563835e3e725 R14: 0000563835e40d10 R15: 00007f7b28784040
[   89.331318]  </TASK>
[   89.331441] Modules linked in:
[   89.331617] ---[ end trace 0000000000000000 ]---

Fixes: da214a4 ("net: add __sys_socket_file()")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230307173707.468744-1-cascardo@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Mar 10, 2023
commit 649c15c upstream.

When sock_alloc_file fails to allocate a file, it will call sock_release.
__sys_socket_file should then not call sock_release again, otherwise there
will be a double free.

[   89.319884] ------------[ cut here ]------------
[   89.320286] kernel BUG at fs/inode.c:1764!
[   89.320656] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[   89.321051] CPU: 7 PID: 125 Comm: iou-sqp-124 Not tainted 6.2.0+ torvalds#361
[   89.321535] RIP: 0010:iput+0x1ff/0x240
[   89.321808] Code: d1 83 e1 03 48 83 f9 02 75 09 48 81 fa 00 10 00 00 77 05 83 e2 01 75 1f 4c 89 ef e8 fb d2 ba 00 e9 80 fe ff ff c3 cc cc cc cc <0f> 0b 0f 0b e9 d0 fe ff ff 0f 0b eb 8d 49 8d b4 24 08 01 00 00 48
[   89.322760] RSP: 0018:ffffbdd60068bd50 EFLAGS: 00010202
[   89.323036] RAX: 0000000000000000 RBX: ffff9d7ad3cacac0 RCX: 0000000000001107
[   89.323412] RDX: 000000000003af00 RSI: 0000000000000000 RDI: ffff9d7ad3cacb40
[   89.323785] RBP: ffffbdd60068bd68 R08: ffffffffffffffff R09: ffffffffab606438
[   89.324157] R10: ffffffffacb3dfa0 R11: 6465686361657256 R12: ffff9d7ad3cacb40
[   89.324529] R13: 0000000080000001 R14: 0000000080000001 R15: 0000000000000002
[   89.324904] FS:  00007f7b28516740(0000) GS:ffff9d7aeb1c0000(0000) knlGS:0000000000000000
[   89.325328] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   89.325629] CR2: 00007f0af52e96c0 CR3: 0000000002a02006 CR4: 0000000000770ee0
[   89.326004] PKRU: 55555554
[   89.326161] Call Trace:
[   89.326298]  <TASK>
[   89.326419]  __sock_release+0xb5/0xc0
[   89.326632]  __sys_socket_file+0xb2/0xd0
[   89.326844]  io_socket+0x88/0x100
[   89.327039]  ? io_issue_sqe+0x6a/0x430
[   89.327258]  io_issue_sqe+0x67/0x430
[   89.327450]  io_submit_sqes+0x1fe/0x670
[   89.327661]  io_sq_thread+0x2e6/0x530
[   89.327859]  ? __pfx_autoremove_wake_function+0x10/0x10
[   89.328145]  ? __pfx_io_sq_thread+0x10/0x10
[   89.328367]  ret_from_fork+0x29/0x50
[   89.328576] RIP: 0033:0x0
[   89.328732] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   89.329073] RSP: 002b:0000000000000000 EFLAGS: 00000202 ORIG_RAX: 00000000000001a9
[   89.329477] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f7b28637a3d
[   89.329845] RDX: 00007fff4e4318a8 RSI: 00007fff4e4318b0 RDI: 0000000000000400
[   89.330216] RBP: 00007fff4e431830 R08: 00007fff4e431711 R09: 00007fff4e4318b0
[   89.330584] R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff4e441b38
[   89.330950] R13: 0000563835e3e725 R14: 0000563835e40d10 R15: 00007f7b28784040
[   89.331318]  </TASK>
[   89.331441] Modules linked in:
[   89.331617] ---[ end trace 0000000000000000 ]---

Fixes: da214a4 ("net: add __sys_socket_file()")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230307173707.468744-1-cascardo@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Mar 10, 2023
commit 649c15c upstream.

When sock_alloc_file fails to allocate a file, it will call sock_release.
__sys_socket_file should then not call sock_release again, otherwise there
will be a double free.

[   89.319884] ------------[ cut here ]------------
[   89.320286] kernel BUG at fs/inode.c:1764!
[   89.320656] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[   89.321051] CPU: 7 PID: 125 Comm: iou-sqp-124 Not tainted 6.2.0+ torvalds#361
[   89.321535] RIP: 0010:iput+0x1ff/0x240
[   89.321808] Code: d1 83 e1 03 48 83 f9 02 75 09 48 81 fa 00 10 00 00 77 05 83 e2 01 75 1f 4c 89 ef e8 fb d2 ba 00 e9 80 fe ff ff c3 cc cc cc cc <0f> 0b 0f 0b e9 d0 fe ff ff 0f 0b eb 8d 49 8d b4 24 08 01 00 00 48
[   89.322760] RSP: 0018:ffffbdd60068bd50 EFLAGS: 00010202
[   89.323036] RAX: 0000000000000000 RBX: ffff9d7ad3cacac0 RCX: 0000000000001107
[   89.323412] RDX: 000000000003af00 RSI: 0000000000000000 RDI: ffff9d7ad3cacb40
[   89.323785] RBP: ffffbdd60068bd68 R08: ffffffffffffffff R09: ffffffffab606438
[   89.324157] R10: ffffffffacb3dfa0 R11: 6465686361657256 R12: ffff9d7ad3cacb40
[   89.324529] R13: 0000000080000001 R14: 0000000080000001 R15: 0000000000000002
[   89.324904] FS:  00007f7b28516740(0000) GS:ffff9d7aeb1c0000(0000) knlGS:0000000000000000
[   89.325328] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   89.325629] CR2: 00007f0af52e96c0 CR3: 0000000002a02006 CR4: 0000000000770ee0
[   89.326004] PKRU: 55555554
[   89.326161] Call Trace:
[   89.326298]  <TASK>
[   89.326419]  __sock_release+0xb5/0xc0
[   89.326632]  __sys_socket_file+0xb2/0xd0
[   89.326844]  io_socket+0x88/0x100
[   89.327039]  ? io_issue_sqe+0x6a/0x430
[   89.327258]  io_issue_sqe+0x67/0x430
[   89.327450]  io_submit_sqes+0x1fe/0x670
[   89.327661]  io_sq_thread+0x2e6/0x530
[   89.327859]  ? __pfx_autoremove_wake_function+0x10/0x10
[   89.328145]  ? __pfx_io_sq_thread+0x10/0x10
[   89.328367]  ret_from_fork+0x29/0x50
[   89.328576] RIP: 0033:0x0
[   89.328732] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   89.329073] RSP: 002b:0000000000000000 EFLAGS: 00000202 ORIG_RAX: 00000000000001a9
[   89.329477] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f7b28637a3d
[   89.329845] RDX: 00007fff4e4318a8 RSI: 00007fff4e4318b0 RDI: 0000000000000400
[   89.330216] RBP: 00007fff4e431830 R08: 00007fff4e431711 R09: 00007fff4e4318b0
[   89.330584] R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff4e441b38
[   89.330950] R13: 0000563835e3e725 R14: 0000563835e40d10 R15: 00007f7b28784040
[   89.331318]  </TASK>
[   89.331441] Modules linked in:
[   89.331617] ---[ end trace 0000000000000000 ]---

Fixes: da214a4 ("net: add __sys_socket_file()")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230307173707.468744-1-cascardo@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Mar 10, 2023
commit 649c15c upstream.

When sock_alloc_file fails to allocate a file, it will call sock_release.
__sys_socket_file should then not call sock_release again, otherwise there
will be a double free.

[   89.319884] ------------[ cut here ]------------
[   89.320286] kernel BUG at fs/inode.c:1764!
[   89.320656] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[   89.321051] CPU: 7 PID: 125 Comm: iou-sqp-124 Not tainted 6.2.0+ torvalds#361
[   89.321535] RIP: 0010:iput+0x1ff/0x240
[   89.321808] Code: d1 83 e1 03 48 83 f9 02 75 09 48 81 fa 00 10 00 00 77 05 83 e2 01 75 1f 4c 89 ef e8 fb d2 ba 00 e9 80 fe ff ff c3 cc cc cc cc <0f> 0b 0f 0b e9 d0 fe ff ff 0f 0b eb 8d 49 8d b4 24 08 01 00 00 48
[   89.322760] RSP: 0018:ffffbdd60068bd50 EFLAGS: 00010202
[   89.323036] RAX: 0000000000000000 RBX: ffff9d7ad3cacac0 RCX: 0000000000001107
[   89.323412] RDX: 000000000003af00 RSI: 0000000000000000 RDI: ffff9d7ad3cacb40
[   89.323785] RBP: ffffbdd60068bd68 R08: ffffffffffffffff R09: ffffffffab606438
[   89.324157] R10: ffffffffacb3dfa0 R11: 6465686361657256 R12: ffff9d7ad3cacb40
[   89.324529] R13: 0000000080000001 R14: 0000000080000001 R15: 0000000000000002
[   89.324904] FS:  00007f7b28516740(0000) GS:ffff9d7aeb1c0000(0000) knlGS:0000000000000000
[   89.325328] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   89.325629] CR2: 00007f0af52e96c0 CR3: 0000000002a02006 CR4: 0000000000770ee0
[   89.326004] PKRU: 55555554
[   89.326161] Call Trace:
[   89.326298]  <TASK>
[   89.326419]  __sock_release+0xb5/0xc0
[   89.326632]  __sys_socket_file+0xb2/0xd0
[   89.326844]  io_socket+0x88/0x100
[   89.327039]  ? io_issue_sqe+0x6a/0x430
[   89.327258]  io_issue_sqe+0x67/0x430
[   89.327450]  io_submit_sqes+0x1fe/0x670
[   89.327661]  io_sq_thread+0x2e6/0x530
[   89.327859]  ? __pfx_autoremove_wake_function+0x10/0x10
[   89.328145]  ? __pfx_io_sq_thread+0x10/0x10
[   89.328367]  ret_from_fork+0x29/0x50
[   89.328576] RIP: 0033:0x0
[   89.328732] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   89.329073] RSP: 002b:0000000000000000 EFLAGS: 00000202 ORIG_RAX: 00000000000001a9
[   89.329477] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f7b28637a3d
[   89.329845] RDX: 00007fff4e4318a8 RSI: 00007fff4e4318b0 RDI: 0000000000000400
[   89.330216] RBP: 00007fff4e431830 R08: 00007fff4e431711 R09: 00007fff4e4318b0
[   89.330584] R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff4e441b38
[   89.330950] R13: 0000563835e3e725 R14: 0000563835e40d10 R15: 00007f7b28784040
[   89.331318]  </TASK>
[   89.331441] Modules linked in:
[   89.331617] ---[ end trace 0000000000000000 ]---

Fixes: da214a4 ("net: add __sys_socket_file()")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230307173707.468744-1-cascardo@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mj22226 pushed a commit to mj22226/linux that referenced this pull request Apr 21, 2023
When sock_alloc_file fails to allocate a file, it will call sock_release.
__sys_socket_file should then not call sock_release again, otherwise there
will be a double free.

[   89.319884] ------------[ cut here ]------------
[   89.320286] kernel BUG at fs/inode.c:1764!
[   89.320656] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[   89.321051] CPU: 7 PID: 125 Comm: iou-sqp-124 Not tainted 6.2.0+ torvalds#361
[   89.321535] RIP: 0010:iput+0x1ff/0x240
[   89.321808] Code: d1 83 e1 03 48 83 f9 02 75 09 48 81 fa 00 10 00 00 77 05 83 e2 01 75 1f 4c 89 ef e8 fb d2 ba 00 e9 80 fe ff ff c3 cc cc cc cc <0f> 0b 0f 0b e9 d0 fe ff ff 0f 0b eb 8d 49 8d b4 24 08 01 00 00 48
[   89.322760] RSP: 0018:ffffbdd60068bd50 EFLAGS: 00010202
[   89.323036] RAX: 0000000000000000 RBX: ffff9d7ad3cacac0 RCX: 0000000000001107
[   89.323412] RDX: 000000000003af00 RSI: 0000000000000000 RDI: ffff9d7ad3cacb40
[   89.323785] RBP: ffffbdd60068bd68 R08: ffffffffffffffff R09: ffffffffab606438
[   89.324157] R10: ffffffffacb3dfa0 R11: 6465686361657256 R12: ffff9d7ad3cacb40
[   89.324529] R13: 0000000080000001 R14: 0000000080000001 R15: 0000000000000002
[   89.324904] FS:  00007f7b28516740(0000) GS:ffff9d7aeb1c0000(0000) knlGS:0000000000000000
[   89.325328] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   89.325629] CR2: 00007f0af52e96c0 CR3: 0000000002a02006 CR4: 0000000000770ee0
[   89.326004] PKRU: 55555554
[   89.326161] Call Trace:
[   89.326298]  <TASK>
[   89.326419]  __sock_release+0xb5/0xc0
[   89.326632]  __sys_socket_file+0xb2/0xd0
[   89.326844]  io_socket+0x88/0x100
[   89.327039]  ? io_issue_sqe+0x6a/0x430
[   89.327258]  io_issue_sqe+0x67/0x430
[   89.327450]  io_submit_sqes+0x1fe/0x670
[   89.327661]  io_sq_thread+0x2e6/0x530
[   89.327859]  ? __pfx_autoremove_wake_function+0x10/0x10
[   89.328145]  ? __pfx_io_sq_thread+0x10/0x10
[   89.328367]  ret_from_fork+0x29/0x50
[   89.328576] RIP: 0033:0x0
[   89.328732] Code: Unable to access opcode bytes at 0xffffffffffffffd6.
[   89.329073] RSP: 002b:0000000000000000 EFLAGS: 00000202 ORIG_RAX: 00000000000001a9
[   89.329477] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f7b28637a3d
[   89.329845] RDX: 00007fff4e4318a8 RSI: 00007fff4e4318b0 RDI: 0000000000000400
[   89.330216] RBP: 00007fff4e431830 R08: 00007fff4e431711 R09: 00007fff4e4318b0
[   89.330584] R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff4e441b38
[   89.330950] R13: 0000563835e3e725 R14: 0000563835e40d10 R15: 00007f7b28784040
[   89.331318]  </TASK>
[   89.331441] Modules linked in:
[   89.331617] ---[ end trace 0000000000000000 ]---

Fixes: da214a4 ("net: add __sys_socket_file()")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230307173707.468744-1-cascardo@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Oct 27, 2023
Enable cpu v4 tests for LoongArch. Currently, we don't
have BPF trampoline in LoongArch JIT, so the fentry
test `test_ptr_struct_arg` still failed, will followup.
Test result attached below:

  # ./test_progs -t verifier_sdiv,verifier_movsx,verifier_ldsx,verifier_gotol,verifier_bswap
  torvalds#316/1   verifier_bswap/BSWAP, 16:OK
  torvalds#316/2   verifier_bswap/BSWAP, 16 @unpriv:OK
  torvalds#316/3   verifier_bswap/BSWAP, 32:OK
  torvalds#316/4   verifier_bswap/BSWAP, 32 @unpriv:OK
  torvalds#316/5   verifier_bswap/BSWAP, 64:OK
  torvalds#316/6   verifier_bswap/BSWAP, 64 @unpriv:OK
  torvalds#316     verifier_bswap:OK
  torvalds#330/1   verifier_gotol/gotol, small_imm:OK
  torvalds#330/2   verifier_gotol/gotol, small_imm @unpriv:OK
  torvalds#330     verifier_gotol:OK
  torvalds#338/1   verifier_ldsx/LDSX, S8:OK
  torvalds#338/2   verifier_ldsx/LDSX, S8 @unpriv:OK
  torvalds#338/3   verifier_ldsx/LDSX, S16:OK
  torvalds#338/4   verifier_ldsx/LDSX, S16 @unpriv:OK
  torvalds#338/5   verifier_ldsx/LDSX, S32:OK
  torvalds#338/6   verifier_ldsx/LDSX, S32 @unpriv:OK
  torvalds#338/7   verifier_ldsx/LDSX, S8 range checking, privileged:OK
  torvalds#338/8   verifier_ldsx/LDSX, S16 range checking:OK
  torvalds#338/9   verifier_ldsx/LDSX, S16 range checking @unpriv:OK
  torvalds#338/10  verifier_ldsx/LDSX, S32 range checking:OK
  torvalds#338/11  verifier_ldsx/LDSX, S32 range checking @unpriv:OK
  torvalds#338     verifier_ldsx:OK
  torvalds#349/1   verifier_movsx/MOV32SX, S8:OK
  torvalds#349/2   verifier_movsx/MOV32SX, S8 @unpriv:OK
  torvalds#349/3   verifier_movsx/MOV32SX, S16:OK
  torvalds#349/4   verifier_movsx/MOV32SX, S16 @unpriv:OK
  torvalds#349/5   verifier_movsx/MOV64SX, S8:OK
  torvalds#349/6   verifier_movsx/MOV64SX, S8 @unpriv:OK
  torvalds#349/7   verifier_movsx/MOV64SX, S16:OK
  torvalds#349/8   verifier_movsx/MOV64SX, S16 @unpriv:OK
  torvalds#349/9   verifier_movsx/MOV64SX, S32:OK
  torvalds#349/10  verifier_movsx/MOV64SX, S32 @unpriv:OK
  torvalds#349/11  verifier_movsx/MOV32SX, S8, range_check:OK
  torvalds#349/12  verifier_movsx/MOV32SX, S8, range_check @unpriv:OK
  torvalds#349/13  verifier_movsx/MOV32SX, S16, range_check:OK
  torvalds#349/14  verifier_movsx/MOV32SX, S16, range_check @unpriv:OK
  torvalds#349/15  verifier_movsx/MOV32SX, S16, range_check 2:OK
  torvalds#349/16  verifier_movsx/MOV32SX, S16, range_check 2 @unpriv:OK
  torvalds#349/17  verifier_movsx/MOV64SX, S8, range_check:OK
  torvalds#349/18  verifier_movsx/MOV64SX, S8, range_check @unpriv:OK
  torvalds#349/19  verifier_movsx/MOV64SX, S16, range_check:OK
  torvalds#349/20  verifier_movsx/MOV64SX, S16, range_check @unpriv:OK
  torvalds#349/21  verifier_movsx/MOV64SX, S32, range_check:OK
  torvalds#349/22  verifier_movsx/MOV64SX, S32, range_check @unpriv:OK
  torvalds#349/23  verifier_movsx/MOV64SX, S16, R10 Sign Extension:OK
  torvalds#349/24  verifier_movsx/MOV64SX, S16, R10 Sign Extension @unpriv:OK
  torvalds#349     verifier_movsx:OK
  torvalds#361/1   verifier_sdiv/SDIV32, non-zero imm divisor, check 1:OK
  torvalds#361/2   verifier_sdiv/SDIV32, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/3   verifier_sdiv/SDIV32, non-zero imm divisor, check 2:OK
  torvalds#361/4   verifier_sdiv/SDIV32, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/5   verifier_sdiv/SDIV32, non-zero imm divisor, check 3:OK
  torvalds#361/6   verifier_sdiv/SDIV32, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/7   verifier_sdiv/SDIV32, non-zero imm divisor, check 4:OK
  torvalds#361/8   verifier_sdiv/SDIV32, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/9   verifier_sdiv/SDIV32, non-zero imm divisor, check 5:OK
  torvalds#361/10  verifier_sdiv/SDIV32, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/11  verifier_sdiv/SDIV32, non-zero imm divisor, check 6:OK
  torvalds#361/12  verifier_sdiv/SDIV32, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/13  verifier_sdiv/SDIV32, non-zero imm divisor, check 7:OK
  torvalds#361/14  verifier_sdiv/SDIV32, non-zero imm divisor, check 7 @unpriv:OK
  torvalds#361/15  verifier_sdiv/SDIV32, non-zero imm divisor, check 8:OK
  torvalds#361/16  verifier_sdiv/SDIV32, non-zero imm divisor, check 8 @unpriv:OK
  torvalds#361/17  verifier_sdiv/SDIV32, non-zero reg divisor, check 1:OK
  torvalds#361/18  verifier_sdiv/SDIV32, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/19  verifier_sdiv/SDIV32, non-zero reg divisor, check 2:OK
  torvalds#361/20  verifier_sdiv/SDIV32, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/21  verifier_sdiv/SDIV32, non-zero reg divisor, check 3:OK
  torvalds#361/22  verifier_sdiv/SDIV32, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/23  verifier_sdiv/SDIV32, non-zero reg divisor, check 4:OK
  torvalds#361/24  verifier_sdiv/SDIV32, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/25  verifier_sdiv/SDIV32, non-zero reg divisor, check 5:OK
  torvalds#361/26  verifier_sdiv/SDIV32, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/27  verifier_sdiv/SDIV32, non-zero reg divisor, check 6:OK
  torvalds#361/28  verifier_sdiv/SDIV32, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/29  verifier_sdiv/SDIV32, non-zero reg divisor, check 7:OK
  torvalds#361/30  verifier_sdiv/SDIV32, non-zero reg divisor, check 7 @unpriv:OK
  torvalds#361/31  verifier_sdiv/SDIV32, non-zero reg divisor, check 8:OK
  torvalds#361/32  verifier_sdiv/SDIV32, non-zero reg divisor, check 8 @unpriv:OK
  torvalds#361/33  verifier_sdiv/SDIV64, non-zero imm divisor, check 1:OK
  torvalds#361/34  verifier_sdiv/SDIV64, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/35  verifier_sdiv/SDIV64, non-zero imm divisor, check 2:OK
  torvalds#361/36  verifier_sdiv/SDIV64, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/37  verifier_sdiv/SDIV64, non-zero imm divisor, check 3:OK
  torvalds#361/38  verifier_sdiv/SDIV64, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/39  verifier_sdiv/SDIV64, non-zero imm divisor, check 4:OK
  torvalds#361/40  verifier_sdiv/SDIV64, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/41  verifier_sdiv/SDIV64, non-zero imm divisor, check 5:OK
  torvalds#361/42  verifier_sdiv/SDIV64, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/43  verifier_sdiv/SDIV64, non-zero imm divisor, check 6:OK
  torvalds#361/44  verifier_sdiv/SDIV64, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/45  verifier_sdiv/SDIV64, non-zero reg divisor, check 1:OK
  torvalds#361/46  verifier_sdiv/SDIV64, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/47  verifier_sdiv/SDIV64, non-zero reg divisor, check 2:OK
  torvalds#361/48  verifier_sdiv/SDIV64, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/49  verifier_sdiv/SDIV64, non-zero reg divisor, check 3:OK
  torvalds#361/50  verifier_sdiv/SDIV64, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/51  verifier_sdiv/SDIV64, non-zero reg divisor, check 4:OK
  torvalds#361/52  verifier_sdiv/SDIV64, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/53  verifier_sdiv/SDIV64, non-zero reg divisor, check 5:OK
  torvalds#361/54  verifier_sdiv/SDIV64, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/55  verifier_sdiv/SDIV64, non-zero reg divisor, check 6:OK
  torvalds#361/56  verifier_sdiv/SDIV64, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/57  verifier_sdiv/SMOD32, non-zero imm divisor, check 1:OK
  torvalds#361/58  verifier_sdiv/SMOD32, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/59  verifier_sdiv/SMOD32, non-zero imm divisor, check 2:OK
  torvalds#361/60  verifier_sdiv/SMOD32, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/61  verifier_sdiv/SMOD32, non-zero imm divisor, check 3:OK
  torvalds#361/62  verifier_sdiv/SMOD32, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/63  verifier_sdiv/SMOD32, non-zero imm divisor, check 4:OK
  torvalds#361/64  verifier_sdiv/SMOD32, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/65  verifier_sdiv/SMOD32, non-zero imm divisor, check 5:OK
  torvalds#361/66  verifier_sdiv/SMOD32, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/67  verifier_sdiv/SMOD32, non-zero imm divisor, check 6:OK
  torvalds#361/68  verifier_sdiv/SMOD32, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/69  verifier_sdiv/SMOD32, non-zero reg divisor, check 1:OK
  torvalds#361/70  verifier_sdiv/SMOD32, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/71  verifier_sdiv/SMOD32, non-zero reg divisor, check 2:OK
  torvalds#361/72  verifier_sdiv/SMOD32, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/73  verifier_sdiv/SMOD32, non-zero reg divisor, check 3:OK
  torvalds#361/74  verifier_sdiv/SMOD32, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/75  verifier_sdiv/SMOD32, non-zero reg divisor, check 4:OK
  torvalds#361/76  verifier_sdiv/SMOD32, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/77  verifier_sdiv/SMOD32, non-zero reg divisor, check 5:OK
  torvalds#361/78  verifier_sdiv/SMOD32, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/79  verifier_sdiv/SMOD32, non-zero reg divisor, check 6:OK
  torvalds#361/80  verifier_sdiv/SMOD32, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/81  verifier_sdiv/SMOD64, non-zero imm divisor, check 1:OK
  torvalds#361/82  verifier_sdiv/SMOD64, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/83  verifier_sdiv/SMOD64, non-zero imm divisor, check 2:OK
  torvalds#361/84  verifier_sdiv/SMOD64, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/85  verifier_sdiv/SMOD64, non-zero imm divisor, check 3:OK
  torvalds#361/86  verifier_sdiv/SMOD64, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/87  verifier_sdiv/SMOD64, non-zero imm divisor, check 4:OK
  torvalds#361/88  verifier_sdiv/SMOD64, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/89  verifier_sdiv/SMOD64, non-zero imm divisor, check 5:OK
  torvalds#361/90  verifier_sdiv/SMOD64, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/91  verifier_sdiv/SMOD64, non-zero imm divisor, check 6:OK
  torvalds#361/92  verifier_sdiv/SMOD64, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/93  verifier_sdiv/SMOD64, non-zero imm divisor, check 7:OK
  torvalds#361/94  verifier_sdiv/SMOD64, non-zero imm divisor, check 7 @unpriv:OK
  torvalds#361/95  verifier_sdiv/SMOD64, non-zero imm divisor, check 8:OK
  torvalds#361/96  verifier_sdiv/SMOD64, non-zero imm divisor, check 8 @unpriv:OK
  torvalds#361/97  verifier_sdiv/SMOD64, non-zero reg divisor, check 1:OK
  torvalds#361/98  verifier_sdiv/SMOD64, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/99  verifier_sdiv/SMOD64, non-zero reg divisor, check 2:OK
  torvalds#361/100 verifier_sdiv/SMOD64, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/101 verifier_sdiv/SMOD64, non-zero reg divisor, check 3:OK
  torvalds#361/102 verifier_sdiv/SMOD64, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/103 verifier_sdiv/SMOD64, non-zero reg divisor, check 4:OK
  torvalds#361/104 verifier_sdiv/SMOD64, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/105 verifier_sdiv/SMOD64, non-zero reg divisor, check 5:OK
  torvalds#361/106 verifier_sdiv/SMOD64, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/107 verifier_sdiv/SMOD64, non-zero reg divisor, check 6:OK
  torvalds#361/108 verifier_sdiv/SMOD64, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/109 verifier_sdiv/SMOD64, non-zero reg divisor, check 7:OK
  torvalds#361/110 verifier_sdiv/SMOD64, non-zero reg divisor, check 7 @unpriv:OK
  torvalds#361/111 verifier_sdiv/SMOD64, non-zero reg divisor, check 8:OK
  torvalds#361/112 verifier_sdiv/SMOD64, non-zero reg divisor, check 8 @unpriv:OK
  torvalds#361/113 verifier_sdiv/SDIV32, zero divisor:OK
  torvalds#361/114 verifier_sdiv/SDIV32, zero divisor @unpriv:OK
  torvalds#361/115 verifier_sdiv/SDIV64, zero divisor:OK
  torvalds#361/116 verifier_sdiv/SDIV64, zero divisor @unpriv:OK
  torvalds#361/117 verifier_sdiv/SMOD32, zero divisor:OK
  torvalds#361/118 verifier_sdiv/SMOD32, zero divisor @unpriv:OK
  torvalds#361/119 verifier_sdiv/SMOD64, zero divisor:OK
  torvalds#361/120 verifier_sdiv/SMOD64, zero divisor @unpriv:OK
  torvalds#361     verifier_sdiv:OK
  Summary: 5/163 PASSED, 0 SKIPPED, 0 FAILED

  # ./test_progs -t ldsx_insn
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec
  libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524
  test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524)
  torvalds#116/1   ldsx_insn/map_val and probed_memory:FAIL
  torvalds#116/2   ldsx_insn/ctx_member_sign_ext:OK
  torvalds#116/3   ldsx_insn/ctx_member_narrow_sign_ext:OK
  torvalds#116     ldsx_insn:FAIL

  All error logs:
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec
  libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524
  test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524)
  torvalds#116/1   ldsx_insn/map_val and probed_memory:FAIL
  torvalds#116     ldsx_insn:FAIL
  Summary: 0/2 PASSED, 0 SKIPPED, 1 FAILED

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
mj22226 pushed a commit to mj22226/linux that referenced this pull request Nov 9, 2023
Enable the cpu v4 tests for LoongArch. Currently, we don't have BPF
trampoline in LoongArch JIT, so the fentry test `test_ptr_struct_arg`
still failed, will followup.

Test result attached below:

  # ./test_progs -t verifier_sdiv,verifier_movsx,verifier_ldsx,verifier_gotol,verifier_bswap
  torvalds#316/1   verifier_bswap/BSWAP, 16:OK
  torvalds#316/2   verifier_bswap/BSWAP, 16 @unpriv:OK
  torvalds#316/3   verifier_bswap/BSWAP, 32:OK
  torvalds#316/4   verifier_bswap/BSWAP, 32 @unpriv:OK
  torvalds#316/5   verifier_bswap/BSWAP, 64:OK
  torvalds#316/6   verifier_bswap/BSWAP, 64 @unpriv:OK
  torvalds#316     verifier_bswap:OK
  torvalds#330/1   verifier_gotol/gotol, small_imm:OK
  torvalds#330/2   verifier_gotol/gotol, small_imm @unpriv:OK
  torvalds#330     verifier_gotol:OK
  torvalds#338/1   verifier_ldsx/LDSX, S8:OK
  torvalds#338/2   verifier_ldsx/LDSX, S8 @unpriv:OK
  torvalds#338/3   verifier_ldsx/LDSX, S16:OK
  torvalds#338/4   verifier_ldsx/LDSX, S16 @unpriv:OK
  torvalds#338/5   verifier_ldsx/LDSX, S32:OK
  torvalds#338/6   verifier_ldsx/LDSX, S32 @unpriv:OK
  torvalds#338/7   verifier_ldsx/LDSX, S8 range checking, privileged:OK
  torvalds#338/8   verifier_ldsx/LDSX, S16 range checking:OK
  torvalds#338/9   verifier_ldsx/LDSX, S16 range checking @unpriv:OK
  torvalds#338/10  verifier_ldsx/LDSX, S32 range checking:OK
  torvalds#338/11  verifier_ldsx/LDSX, S32 range checking @unpriv:OK
  torvalds#338     verifier_ldsx:OK
  torvalds#349/1   verifier_movsx/MOV32SX, S8:OK
  torvalds#349/2   verifier_movsx/MOV32SX, S8 @unpriv:OK
  torvalds#349/3   verifier_movsx/MOV32SX, S16:OK
  torvalds#349/4   verifier_movsx/MOV32SX, S16 @unpriv:OK
  torvalds#349/5   verifier_movsx/MOV64SX, S8:OK
  torvalds#349/6   verifier_movsx/MOV64SX, S8 @unpriv:OK
  torvalds#349/7   verifier_movsx/MOV64SX, S16:OK
  torvalds#349/8   verifier_movsx/MOV64SX, S16 @unpriv:OK
  torvalds#349/9   verifier_movsx/MOV64SX, S32:OK
  torvalds#349/10  verifier_movsx/MOV64SX, S32 @unpriv:OK
  torvalds#349/11  verifier_movsx/MOV32SX, S8, range_check:OK
  torvalds#349/12  verifier_movsx/MOV32SX, S8, range_check @unpriv:OK
  torvalds#349/13  verifier_movsx/MOV32SX, S16, range_check:OK
  torvalds#349/14  verifier_movsx/MOV32SX, S16, range_check @unpriv:OK
  torvalds#349/15  verifier_movsx/MOV32SX, S16, range_check 2:OK
  torvalds#349/16  verifier_movsx/MOV32SX, S16, range_check 2 @unpriv:OK
  torvalds#349/17  verifier_movsx/MOV64SX, S8, range_check:OK
  torvalds#349/18  verifier_movsx/MOV64SX, S8, range_check @unpriv:OK
  torvalds#349/19  verifier_movsx/MOV64SX, S16, range_check:OK
  torvalds#349/20  verifier_movsx/MOV64SX, S16, range_check @unpriv:OK
  torvalds#349/21  verifier_movsx/MOV64SX, S32, range_check:OK
  torvalds#349/22  verifier_movsx/MOV64SX, S32, range_check @unpriv:OK
  torvalds#349/23  verifier_movsx/MOV64SX, S16, R10 Sign Extension:OK
  torvalds#349/24  verifier_movsx/MOV64SX, S16, R10 Sign Extension @unpriv:OK
  torvalds#349     verifier_movsx:OK
  torvalds#361/1   verifier_sdiv/SDIV32, non-zero imm divisor, check 1:OK
  torvalds#361/2   verifier_sdiv/SDIV32, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/3   verifier_sdiv/SDIV32, non-zero imm divisor, check 2:OK
  torvalds#361/4   verifier_sdiv/SDIV32, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/5   verifier_sdiv/SDIV32, non-zero imm divisor, check 3:OK
  torvalds#361/6   verifier_sdiv/SDIV32, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/7   verifier_sdiv/SDIV32, non-zero imm divisor, check 4:OK
  torvalds#361/8   verifier_sdiv/SDIV32, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/9   verifier_sdiv/SDIV32, non-zero imm divisor, check 5:OK
  torvalds#361/10  verifier_sdiv/SDIV32, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/11  verifier_sdiv/SDIV32, non-zero imm divisor, check 6:OK
  torvalds#361/12  verifier_sdiv/SDIV32, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/13  verifier_sdiv/SDIV32, non-zero imm divisor, check 7:OK
  torvalds#361/14  verifier_sdiv/SDIV32, non-zero imm divisor, check 7 @unpriv:OK
  torvalds#361/15  verifier_sdiv/SDIV32, non-zero imm divisor, check 8:OK
  torvalds#361/16  verifier_sdiv/SDIV32, non-zero imm divisor, check 8 @unpriv:OK
  torvalds#361/17  verifier_sdiv/SDIV32, non-zero reg divisor, check 1:OK
  torvalds#361/18  verifier_sdiv/SDIV32, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/19  verifier_sdiv/SDIV32, non-zero reg divisor, check 2:OK
  torvalds#361/20  verifier_sdiv/SDIV32, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/21  verifier_sdiv/SDIV32, non-zero reg divisor, check 3:OK
  torvalds#361/22  verifier_sdiv/SDIV32, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/23  verifier_sdiv/SDIV32, non-zero reg divisor, check 4:OK
  torvalds#361/24  verifier_sdiv/SDIV32, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/25  verifier_sdiv/SDIV32, non-zero reg divisor, check 5:OK
  torvalds#361/26  verifier_sdiv/SDIV32, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/27  verifier_sdiv/SDIV32, non-zero reg divisor, check 6:OK
  torvalds#361/28  verifier_sdiv/SDIV32, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/29  verifier_sdiv/SDIV32, non-zero reg divisor, check 7:OK
  torvalds#361/30  verifier_sdiv/SDIV32, non-zero reg divisor, check 7 @unpriv:OK
  torvalds#361/31  verifier_sdiv/SDIV32, non-zero reg divisor, check 8:OK
  torvalds#361/32  verifier_sdiv/SDIV32, non-zero reg divisor, check 8 @unpriv:OK
  torvalds#361/33  verifier_sdiv/SDIV64, non-zero imm divisor, check 1:OK
  torvalds#361/34  verifier_sdiv/SDIV64, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/35  verifier_sdiv/SDIV64, non-zero imm divisor, check 2:OK
  torvalds#361/36  verifier_sdiv/SDIV64, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/37  verifier_sdiv/SDIV64, non-zero imm divisor, check 3:OK
  torvalds#361/38  verifier_sdiv/SDIV64, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/39  verifier_sdiv/SDIV64, non-zero imm divisor, check 4:OK
  torvalds#361/40  verifier_sdiv/SDIV64, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/41  verifier_sdiv/SDIV64, non-zero imm divisor, check 5:OK
  torvalds#361/42  verifier_sdiv/SDIV64, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/43  verifier_sdiv/SDIV64, non-zero imm divisor, check 6:OK
  torvalds#361/44  verifier_sdiv/SDIV64, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/45  verifier_sdiv/SDIV64, non-zero reg divisor, check 1:OK
  torvalds#361/46  verifier_sdiv/SDIV64, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/47  verifier_sdiv/SDIV64, non-zero reg divisor, check 2:OK
  torvalds#361/48  verifier_sdiv/SDIV64, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/49  verifier_sdiv/SDIV64, non-zero reg divisor, check 3:OK
  torvalds#361/50  verifier_sdiv/SDIV64, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/51  verifier_sdiv/SDIV64, non-zero reg divisor, check 4:OK
  torvalds#361/52  verifier_sdiv/SDIV64, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/53  verifier_sdiv/SDIV64, non-zero reg divisor, check 5:OK
  torvalds#361/54  verifier_sdiv/SDIV64, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/55  verifier_sdiv/SDIV64, non-zero reg divisor, check 6:OK
  torvalds#361/56  verifier_sdiv/SDIV64, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/57  verifier_sdiv/SMOD32, non-zero imm divisor, check 1:OK
  torvalds#361/58  verifier_sdiv/SMOD32, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/59  verifier_sdiv/SMOD32, non-zero imm divisor, check 2:OK
  torvalds#361/60  verifier_sdiv/SMOD32, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/61  verifier_sdiv/SMOD32, non-zero imm divisor, check 3:OK
  torvalds#361/62  verifier_sdiv/SMOD32, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/63  verifier_sdiv/SMOD32, non-zero imm divisor, check 4:OK
  torvalds#361/64  verifier_sdiv/SMOD32, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/65  verifier_sdiv/SMOD32, non-zero imm divisor, check 5:OK
  torvalds#361/66  verifier_sdiv/SMOD32, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/67  verifier_sdiv/SMOD32, non-zero imm divisor, check 6:OK
  torvalds#361/68  verifier_sdiv/SMOD32, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/69  verifier_sdiv/SMOD32, non-zero reg divisor, check 1:OK
  torvalds#361/70  verifier_sdiv/SMOD32, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/71  verifier_sdiv/SMOD32, non-zero reg divisor, check 2:OK
  torvalds#361/72  verifier_sdiv/SMOD32, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/73  verifier_sdiv/SMOD32, non-zero reg divisor, check 3:OK
  torvalds#361/74  verifier_sdiv/SMOD32, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/75  verifier_sdiv/SMOD32, non-zero reg divisor, check 4:OK
  torvalds#361/76  verifier_sdiv/SMOD32, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/77  verifier_sdiv/SMOD32, non-zero reg divisor, check 5:OK
  torvalds#361/78  verifier_sdiv/SMOD32, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/79  verifier_sdiv/SMOD32, non-zero reg divisor, check 6:OK
  torvalds#361/80  verifier_sdiv/SMOD32, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/81  verifier_sdiv/SMOD64, non-zero imm divisor, check 1:OK
  torvalds#361/82  verifier_sdiv/SMOD64, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/83  verifier_sdiv/SMOD64, non-zero imm divisor, check 2:OK
  torvalds#361/84  verifier_sdiv/SMOD64, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/85  verifier_sdiv/SMOD64, non-zero imm divisor, check 3:OK
  torvalds#361/86  verifier_sdiv/SMOD64, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/87  verifier_sdiv/SMOD64, non-zero imm divisor, check 4:OK
  torvalds#361/88  verifier_sdiv/SMOD64, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/89  verifier_sdiv/SMOD64, non-zero imm divisor, check 5:OK
  torvalds#361/90  verifier_sdiv/SMOD64, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/91  verifier_sdiv/SMOD64, non-zero imm divisor, check 6:OK
  torvalds#361/92  verifier_sdiv/SMOD64, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/93  verifier_sdiv/SMOD64, non-zero imm divisor, check 7:OK
  torvalds#361/94  verifier_sdiv/SMOD64, non-zero imm divisor, check 7 @unpriv:OK
  torvalds#361/95  verifier_sdiv/SMOD64, non-zero imm divisor, check 8:OK
  torvalds#361/96  verifier_sdiv/SMOD64, non-zero imm divisor, check 8 @unpriv:OK
  torvalds#361/97  verifier_sdiv/SMOD64, non-zero reg divisor, check 1:OK
  torvalds#361/98  verifier_sdiv/SMOD64, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/99  verifier_sdiv/SMOD64, non-zero reg divisor, check 2:OK
  torvalds#361/100 verifier_sdiv/SMOD64, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/101 verifier_sdiv/SMOD64, non-zero reg divisor, check 3:OK
  torvalds#361/102 verifier_sdiv/SMOD64, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/103 verifier_sdiv/SMOD64, non-zero reg divisor, check 4:OK
  torvalds#361/104 verifier_sdiv/SMOD64, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/105 verifier_sdiv/SMOD64, non-zero reg divisor, check 5:OK
  torvalds#361/106 verifier_sdiv/SMOD64, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/107 verifier_sdiv/SMOD64, non-zero reg divisor, check 6:OK
  torvalds#361/108 verifier_sdiv/SMOD64, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/109 verifier_sdiv/SMOD64, non-zero reg divisor, check 7:OK
  torvalds#361/110 verifier_sdiv/SMOD64, non-zero reg divisor, check 7 @unpriv:OK
  torvalds#361/111 verifier_sdiv/SMOD64, non-zero reg divisor, check 8:OK
  torvalds#361/112 verifier_sdiv/SMOD64, non-zero reg divisor, check 8 @unpriv:OK
  torvalds#361/113 verifier_sdiv/SDIV32, zero divisor:OK
  torvalds#361/114 verifier_sdiv/SDIV32, zero divisor @unpriv:OK
  torvalds#361/115 verifier_sdiv/SDIV64, zero divisor:OK
  torvalds#361/116 verifier_sdiv/SDIV64, zero divisor @unpriv:OK
  torvalds#361/117 verifier_sdiv/SMOD32, zero divisor:OK
  torvalds#361/118 verifier_sdiv/SMOD32, zero divisor @unpriv:OK
  torvalds#361/119 verifier_sdiv/SMOD64, zero divisor:OK
  torvalds#361/120 verifier_sdiv/SMOD64, zero divisor @unpriv:OK
  torvalds#361     verifier_sdiv:OK
  Summary: 5/163 PASSED, 0 SKIPPED, 0 FAILED

  # ./test_progs -t ldsx_insn
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec
  libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524
  test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524)
  torvalds#116/1   ldsx_insn/map_val and probed_memory:FAIL
  torvalds#116/2   ldsx_insn/ctx_member_sign_ext:OK
  torvalds#116/3   ldsx_insn/ctx_member_narrow_sign_ext:OK
  torvalds#116     ldsx_insn:FAIL

  All error logs:
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec
  libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524
  test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524)
  torvalds#116/1   ldsx_insn/map_val and probed_memory:FAIL
  torvalds#116     ldsx_insn:FAIL
  Summary: 0/2 PASSED, 0 SKIPPED, 1 FAILED

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
yetist pushed a commit to loongarchlinux/linux that referenced this pull request Nov 13, 2023
Enable the cpu v4 tests for LoongArch. Currently, we don't have BPF
trampoline in LoongArch JIT, so the fentry test `test_ptr_struct_arg`
still failed, will followup.

Test result attached below:

  # ./test_progs -t verifier_sdiv,verifier_movsx,verifier_ldsx,verifier_gotol,verifier_bswap
  torvalds#316/1   verifier_bswap/BSWAP, 16:OK
  torvalds#316/2   verifier_bswap/BSWAP, 16 @unpriv:OK
  torvalds#316/3   verifier_bswap/BSWAP, 32:OK
  torvalds#316/4   verifier_bswap/BSWAP, 32 @unpriv:OK
  torvalds#316/5   verifier_bswap/BSWAP, 64:OK
  torvalds#316/6   verifier_bswap/BSWAP, 64 @unpriv:OK
  torvalds#316     verifier_bswap:OK
  torvalds#330/1   verifier_gotol/gotol, small_imm:OK
  torvalds#330/2   verifier_gotol/gotol, small_imm @unpriv:OK
  torvalds#330     verifier_gotol:OK
  torvalds#338/1   verifier_ldsx/LDSX, S8:OK
  torvalds#338/2   verifier_ldsx/LDSX, S8 @unpriv:OK
  torvalds#338/3   verifier_ldsx/LDSX, S16:OK
  torvalds#338/4   verifier_ldsx/LDSX, S16 @unpriv:OK
  torvalds#338/5   verifier_ldsx/LDSX, S32:OK
  torvalds#338/6   verifier_ldsx/LDSX, S32 @unpriv:OK
  torvalds#338/7   verifier_ldsx/LDSX, S8 range checking, privileged:OK
  torvalds#338/8   verifier_ldsx/LDSX, S16 range checking:OK
  torvalds#338/9   verifier_ldsx/LDSX, S16 range checking @unpriv:OK
  torvalds#338/10  verifier_ldsx/LDSX, S32 range checking:OK
  torvalds#338/11  verifier_ldsx/LDSX, S32 range checking @unpriv:OK
  torvalds#338     verifier_ldsx:OK
  torvalds#349/1   verifier_movsx/MOV32SX, S8:OK
  torvalds#349/2   verifier_movsx/MOV32SX, S8 @unpriv:OK
  torvalds#349/3   verifier_movsx/MOV32SX, S16:OK
  torvalds#349/4   verifier_movsx/MOV32SX, S16 @unpriv:OK
  torvalds#349/5   verifier_movsx/MOV64SX, S8:OK
  torvalds#349/6   verifier_movsx/MOV64SX, S8 @unpriv:OK
  torvalds#349/7   verifier_movsx/MOV64SX, S16:OK
  torvalds#349/8   verifier_movsx/MOV64SX, S16 @unpriv:OK
  torvalds#349/9   verifier_movsx/MOV64SX, S32:OK
  torvalds#349/10  verifier_movsx/MOV64SX, S32 @unpriv:OK
  torvalds#349/11  verifier_movsx/MOV32SX, S8, range_check:OK
  torvalds#349/12  verifier_movsx/MOV32SX, S8, range_check @unpriv:OK
  torvalds#349/13  verifier_movsx/MOV32SX, S16, range_check:OK
  torvalds#349/14  verifier_movsx/MOV32SX, S16, range_check @unpriv:OK
  torvalds#349/15  verifier_movsx/MOV32SX, S16, range_check 2:OK
  torvalds#349/16  verifier_movsx/MOV32SX, S16, range_check 2 @unpriv:OK
  torvalds#349/17  verifier_movsx/MOV64SX, S8, range_check:OK
  torvalds#349/18  verifier_movsx/MOV64SX, S8, range_check @unpriv:OK
  torvalds#349/19  verifier_movsx/MOV64SX, S16, range_check:OK
  torvalds#349/20  verifier_movsx/MOV64SX, S16, range_check @unpriv:OK
  torvalds#349/21  verifier_movsx/MOV64SX, S32, range_check:OK
  torvalds#349/22  verifier_movsx/MOV64SX, S32, range_check @unpriv:OK
  torvalds#349/23  verifier_movsx/MOV64SX, S16, R10 Sign Extension:OK
  torvalds#349/24  verifier_movsx/MOV64SX, S16, R10 Sign Extension @unpriv:OK
  torvalds#349     verifier_movsx:OK
  torvalds#361/1   verifier_sdiv/SDIV32, non-zero imm divisor, check 1:OK
  torvalds#361/2   verifier_sdiv/SDIV32, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/3   verifier_sdiv/SDIV32, non-zero imm divisor, check 2:OK
  torvalds#361/4   verifier_sdiv/SDIV32, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/5   verifier_sdiv/SDIV32, non-zero imm divisor, check 3:OK
  torvalds#361/6   verifier_sdiv/SDIV32, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/7   verifier_sdiv/SDIV32, non-zero imm divisor, check 4:OK
  torvalds#361/8   verifier_sdiv/SDIV32, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/9   verifier_sdiv/SDIV32, non-zero imm divisor, check 5:OK
  torvalds#361/10  verifier_sdiv/SDIV32, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/11  verifier_sdiv/SDIV32, non-zero imm divisor, check 6:OK
  torvalds#361/12  verifier_sdiv/SDIV32, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/13  verifier_sdiv/SDIV32, non-zero imm divisor, check 7:OK
  torvalds#361/14  verifier_sdiv/SDIV32, non-zero imm divisor, check 7 @unpriv:OK
  torvalds#361/15  verifier_sdiv/SDIV32, non-zero imm divisor, check 8:OK
  torvalds#361/16  verifier_sdiv/SDIV32, non-zero imm divisor, check 8 @unpriv:OK
  torvalds#361/17  verifier_sdiv/SDIV32, non-zero reg divisor, check 1:OK
  torvalds#361/18  verifier_sdiv/SDIV32, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/19  verifier_sdiv/SDIV32, non-zero reg divisor, check 2:OK
  torvalds#361/20  verifier_sdiv/SDIV32, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/21  verifier_sdiv/SDIV32, non-zero reg divisor, check 3:OK
  torvalds#361/22  verifier_sdiv/SDIV32, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/23  verifier_sdiv/SDIV32, non-zero reg divisor, check 4:OK
  torvalds#361/24  verifier_sdiv/SDIV32, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/25  verifier_sdiv/SDIV32, non-zero reg divisor, check 5:OK
  torvalds#361/26  verifier_sdiv/SDIV32, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/27  verifier_sdiv/SDIV32, non-zero reg divisor, check 6:OK
  torvalds#361/28  verifier_sdiv/SDIV32, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/29  verifier_sdiv/SDIV32, non-zero reg divisor, check 7:OK
  torvalds#361/30  verifier_sdiv/SDIV32, non-zero reg divisor, check 7 @unpriv:OK
  torvalds#361/31  verifier_sdiv/SDIV32, non-zero reg divisor, check 8:OK
  torvalds#361/32  verifier_sdiv/SDIV32, non-zero reg divisor, check 8 @unpriv:OK
  torvalds#361/33  verifier_sdiv/SDIV64, non-zero imm divisor, check 1:OK
  torvalds#361/34  verifier_sdiv/SDIV64, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/35  verifier_sdiv/SDIV64, non-zero imm divisor, check 2:OK
  torvalds#361/36  verifier_sdiv/SDIV64, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/37  verifier_sdiv/SDIV64, non-zero imm divisor, check 3:OK
  torvalds#361/38  verifier_sdiv/SDIV64, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/39  verifier_sdiv/SDIV64, non-zero imm divisor, check 4:OK
  torvalds#361/40  verifier_sdiv/SDIV64, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/41  verifier_sdiv/SDIV64, non-zero imm divisor, check 5:OK
  torvalds#361/42  verifier_sdiv/SDIV64, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/43  verifier_sdiv/SDIV64, non-zero imm divisor, check 6:OK
  torvalds#361/44  verifier_sdiv/SDIV64, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/45  verifier_sdiv/SDIV64, non-zero reg divisor, check 1:OK
  torvalds#361/46  verifier_sdiv/SDIV64, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/47  verifier_sdiv/SDIV64, non-zero reg divisor, check 2:OK
  torvalds#361/48  verifier_sdiv/SDIV64, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/49  verifier_sdiv/SDIV64, non-zero reg divisor, check 3:OK
  torvalds#361/50  verifier_sdiv/SDIV64, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/51  verifier_sdiv/SDIV64, non-zero reg divisor, check 4:OK
  torvalds#361/52  verifier_sdiv/SDIV64, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/53  verifier_sdiv/SDIV64, non-zero reg divisor, check 5:OK
  torvalds#361/54  verifier_sdiv/SDIV64, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/55  verifier_sdiv/SDIV64, non-zero reg divisor, check 6:OK
  torvalds#361/56  verifier_sdiv/SDIV64, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/57  verifier_sdiv/SMOD32, non-zero imm divisor, check 1:OK
  torvalds#361/58  verifier_sdiv/SMOD32, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/59  verifier_sdiv/SMOD32, non-zero imm divisor, check 2:OK
  torvalds#361/60  verifier_sdiv/SMOD32, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/61  verifier_sdiv/SMOD32, non-zero imm divisor, check 3:OK
  torvalds#361/62  verifier_sdiv/SMOD32, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/63  verifier_sdiv/SMOD32, non-zero imm divisor, check 4:OK
  torvalds#361/64  verifier_sdiv/SMOD32, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/65  verifier_sdiv/SMOD32, non-zero imm divisor, check 5:OK
  torvalds#361/66  verifier_sdiv/SMOD32, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/67  verifier_sdiv/SMOD32, non-zero imm divisor, check 6:OK
  torvalds#361/68  verifier_sdiv/SMOD32, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/69  verifier_sdiv/SMOD32, non-zero reg divisor, check 1:OK
  torvalds#361/70  verifier_sdiv/SMOD32, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/71  verifier_sdiv/SMOD32, non-zero reg divisor, check 2:OK
  torvalds#361/72  verifier_sdiv/SMOD32, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/73  verifier_sdiv/SMOD32, non-zero reg divisor, check 3:OK
  torvalds#361/74  verifier_sdiv/SMOD32, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/75  verifier_sdiv/SMOD32, non-zero reg divisor, check 4:OK
  torvalds#361/76  verifier_sdiv/SMOD32, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/77  verifier_sdiv/SMOD32, non-zero reg divisor, check 5:OK
  torvalds#361/78  verifier_sdiv/SMOD32, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/79  verifier_sdiv/SMOD32, non-zero reg divisor, check 6:OK
  torvalds#361/80  verifier_sdiv/SMOD32, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/81  verifier_sdiv/SMOD64, non-zero imm divisor, check 1:OK
  torvalds#361/82  verifier_sdiv/SMOD64, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/83  verifier_sdiv/SMOD64, non-zero imm divisor, check 2:OK
  torvalds#361/84  verifier_sdiv/SMOD64, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/85  verifier_sdiv/SMOD64, non-zero imm divisor, check 3:OK
  torvalds#361/86  verifier_sdiv/SMOD64, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/87  verifier_sdiv/SMOD64, non-zero imm divisor, check 4:OK
  torvalds#361/88  verifier_sdiv/SMOD64, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/89  verifier_sdiv/SMOD64, non-zero imm divisor, check 5:OK
  torvalds#361/90  verifier_sdiv/SMOD64, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/91  verifier_sdiv/SMOD64, non-zero imm divisor, check 6:OK
  torvalds#361/92  verifier_sdiv/SMOD64, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/93  verifier_sdiv/SMOD64, non-zero imm divisor, check 7:OK
  torvalds#361/94  verifier_sdiv/SMOD64, non-zero imm divisor, check 7 @unpriv:OK
  torvalds#361/95  verifier_sdiv/SMOD64, non-zero imm divisor, check 8:OK
  torvalds#361/96  verifier_sdiv/SMOD64, non-zero imm divisor, check 8 @unpriv:OK
  torvalds#361/97  verifier_sdiv/SMOD64, non-zero reg divisor, check 1:OK
  torvalds#361/98  verifier_sdiv/SMOD64, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/99  verifier_sdiv/SMOD64, non-zero reg divisor, check 2:OK
  torvalds#361/100 verifier_sdiv/SMOD64, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/101 verifier_sdiv/SMOD64, non-zero reg divisor, check 3:OK
  torvalds#361/102 verifier_sdiv/SMOD64, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/103 verifier_sdiv/SMOD64, non-zero reg divisor, check 4:OK
  torvalds#361/104 verifier_sdiv/SMOD64, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/105 verifier_sdiv/SMOD64, non-zero reg divisor, check 5:OK
  torvalds#361/106 verifier_sdiv/SMOD64, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/107 verifier_sdiv/SMOD64, non-zero reg divisor, check 6:OK
  torvalds#361/108 verifier_sdiv/SMOD64, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/109 verifier_sdiv/SMOD64, non-zero reg divisor, check 7:OK
  torvalds#361/110 verifier_sdiv/SMOD64, non-zero reg divisor, check 7 @unpriv:OK
  torvalds#361/111 verifier_sdiv/SMOD64, non-zero reg divisor, check 8:OK
  torvalds#361/112 verifier_sdiv/SMOD64, non-zero reg divisor, check 8 @unpriv:OK
  torvalds#361/113 verifier_sdiv/SDIV32, zero divisor:OK
  torvalds#361/114 verifier_sdiv/SDIV32, zero divisor @unpriv:OK
  torvalds#361/115 verifier_sdiv/SDIV64, zero divisor:OK
  torvalds#361/116 verifier_sdiv/SDIV64, zero divisor @unpriv:OK
  torvalds#361/117 verifier_sdiv/SMOD32, zero divisor:OK
  torvalds#361/118 verifier_sdiv/SMOD32, zero divisor @unpriv:OK
  torvalds#361/119 verifier_sdiv/SMOD64, zero divisor:OK
  torvalds#361/120 verifier_sdiv/SMOD64, zero divisor @unpriv:OK
  torvalds#361     verifier_sdiv:OK
  Summary: 5/163 PASSED, 0 SKIPPED, 0 FAILED

  # ./test_progs -t ldsx_insn
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec
  libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524
  test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524)
  torvalds#116/1   ldsx_insn/map_val and probed_memory:FAIL
  torvalds#116/2   ldsx_insn/ctx_member_sign_ext:OK
  torvalds#116/3   ldsx_insn/ctx_member_narrow_sign_ext:OK
  torvalds#116     ldsx_insn:FAIL

  All error logs:
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec
  libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524
  test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524)
  torvalds#116/1   ldsx_insn/map_val and probed_memory:FAIL
  torvalds#116     ldsx_insn:FAIL
  Summary: 0/2 PASSED, 0 SKIPPED, 1 FAILED

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
RevySR pushed a commit to RevySR/linux that referenced this pull request Nov 23, 2023
Enable the cpu v4 tests for LoongArch. Currently, we don't have BPF
trampoline in LoongArch JIT, so the fentry test `test_ptr_struct_arg`
still failed, will followup.

Test result attached below:

  # ./test_progs -t verifier_sdiv,verifier_movsx,verifier_ldsx,verifier_gotol,verifier_bswap
  torvalds#316/1   verifier_bswap/BSWAP, 16:OK
  torvalds#316/2   verifier_bswap/BSWAP, 16 @unpriv:OK
  torvalds#316/3   verifier_bswap/BSWAP, 32:OK
  torvalds#316/4   verifier_bswap/BSWAP, 32 @unpriv:OK
  torvalds#316/5   verifier_bswap/BSWAP, 64:OK
  torvalds#316/6   verifier_bswap/BSWAP, 64 @unpriv:OK
  torvalds#316     verifier_bswap:OK
  torvalds#330/1   verifier_gotol/gotol, small_imm:OK
  torvalds#330/2   verifier_gotol/gotol, small_imm @unpriv:OK
  torvalds#330     verifier_gotol:OK
  torvalds#338/1   verifier_ldsx/LDSX, S8:OK
  torvalds#338/2   verifier_ldsx/LDSX, S8 @unpriv:OK
  torvalds#338/3   verifier_ldsx/LDSX, S16:OK
  torvalds#338/4   verifier_ldsx/LDSX, S16 @unpriv:OK
  torvalds#338/5   verifier_ldsx/LDSX, S32:OK
  torvalds#338/6   verifier_ldsx/LDSX, S32 @unpriv:OK
  torvalds#338/7   verifier_ldsx/LDSX, S8 range checking, privileged:OK
  torvalds#338/8   verifier_ldsx/LDSX, S16 range checking:OK
  torvalds#338/9   verifier_ldsx/LDSX, S16 range checking @unpriv:OK
  torvalds#338/10  verifier_ldsx/LDSX, S32 range checking:OK
  torvalds#338/11  verifier_ldsx/LDSX, S32 range checking @unpriv:OK
  torvalds#338     verifier_ldsx:OK
  torvalds#349/1   verifier_movsx/MOV32SX, S8:OK
  torvalds#349/2   verifier_movsx/MOV32SX, S8 @unpriv:OK
  torvalds#349/3   verifier_movsx/MOV32SX, S16:OK
  torvalds#349/4   verifier_movsx/MOV32SX, S16 @unpriv:OK
  torvalds#349/5   verifier_movsx/MOV64SX, S8:OK
  torvalds#349/6   verifier_movsx/MOV64SX, S8 @unpriv:OK
  torvalds#349/7   verifier_movsx/MOV64SX, S16:OK
  torvalds#349/8   verifier_movsx/MOV64SX, S16 @unpriv:OK
  torvalds#349/9   verifier_movsx/MOV64SX, S32:OK
  torvalds#349/10  verifier_movsx/MOV64SX, S32 @unpriv:OK
  torvalds#349/11  verifier_movsx/MOV32SX, S8, range_check:OK
  torvalds#349/12  verifier_movsx/MOV32SX, S8, range_check @unpriv:OK
  torvalds#349/13  verifier_movsx/MOV32SX, S16, range_check:OK
  torvalds#349/14  verifier_movsx/MOV32SX, S16, range_check @unpriv:OK
  torvalds#349/15  verifier_movsx/MOV32SX, S16, range_check 2:OK
  torvalds#349/16  verifier_movsx/MOV32SX, S16, range_check 2 @unpriv:OK
  torvalds#349/17  verifier_movsx/MOV64SX, S8, range_check:OK
  torvalds#349/18  verifier_movsx/MOV64SX, S8, range_check @unpriv:OK
  torvalds#349/19  verifier_movsx/MOV64SX, S16, range_check:OK
  torvalds#349/20  verifier_movsx/MOV64SX, S16, range_check @unpriv:OK
  torvalds#349/21  verifier_movsx/MOV64SX, S32, range_check:OK
  torvalds#349/22  verifier_movsx/MOV64SX, S32, range_check @unpriv:OK
  torvalds#349/23  verifier_movsx/MOV64SX, S16, R10 Sign Extension:OK
  torvalds#349/24  verifier_movsx/MOV64SX, S16, R10 Sign Extension @unpriv:OK
  torvalds#349     verifier_movsx:OK
  torvalds#361/1   verifier_sdiv/SDIV32, non-zero imm divisor, check 1:OK
  torvalds#361/2   verifier_sdiv/SDIV32, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/3   verifier_sdiv/SDIV32, non-zero imm divisor, check 2:OK
  torvalds#361/4   verifier_sdiv/SDIV32, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/5   verifier_sdiv/SDIV32, non-zero imm divisor, check 3:OK
  torvalds#361/6   verifier_sdiv/SDIV32, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/7   verifier_sdiv/SDIV32, non-zero imm divisor, check 4:OK
  torvalds#361/8   verifier_sdiv/SDIV32, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/9   verifier_sdiv/SDIV32, non-zero imm divisor, check 5:OK
  torvalds#361/10  verifier_sdiv/SDIV32, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/11  verifier_sdiv/SDIV32, non-zero imm divisor, check 6:OK
  torvalds#361/12  verifier_sdiv/SDIV32, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/13  verifier_sdiv/SDIV32, non-zero imm divisor, check 7:OK
  torvalds#361/14  verifier_sdiv/SDIV32, non-zero imm divisor, check 7 @unpriv:OK
  torvalds#361/15  verifier_sdiv/SDIV32, non-zero imm divisor, check 8:OK
  torvalds#361/16  verifier_sdiv/SDIV32, non-zero imm divisor, check 8 @unpriv:OK
  torvalds#361/17  verifier_sdiv/SDIV32, non-zero reg divisor, check 1:OK
  torvalds#361/18  verifier_sdiv/SDIV32, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/19  verifier_sdiv/SDIV32, non-zero reg divisor, check 2:OK
  torvalds#361/20  verifier_sdiv/SDIV32, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/21  verifier_sdiv/SDIV32, non-zero reg divisor, check 3:OK
  torvalds#361/22  verifier_sdiv/SDIV32, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/23  verifier_sdiv/SDIV32, non-zero reg divisor, check 4:OK
  torvalds#361/24  verifier_sdiv/SDIV32, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/25  verifier_sdiv/SDIV32, non-zero reg divisor, check 5:OK
  torvalds#361/26  verifier_sdiv/SDIV32, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/27  verifier_sdiv/SDIV32, non-zero reg divisor, check 6:OK
  torvalds#361/28  verifier_sdiv/SDIV32, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/29  verifier_sdiv/SDIV32, non-zero reg divisor, check 7:OK
  torvalds#361/30  verifier_sdiv/SDIV32, non-zero reg divisor, check 7 @unpriv:OK
  torvalds#361/31  verifier_sdiv/SDIV32, non-zero reg divisor, check 8:OK
  torvalds#361/32  verifier_sdiv/SDIV32, non-zero reg divisor, check 8 @unpriv:OK
  torvalds#361/33  verifier_sdiv/SDIV64, non-zero imm divisor, check 1:OK
  torvalds#361/34  verifier_sdiv/SDIV64, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/35  verifier_sdiv/SDIV64, non-zero imm divisor, check 2:OK
  torvalds#361/36  verifier_sdiv/SDIV64, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/37  verifier_sdiv/SDIV64, non-zero imm divisor, check 3:OK
  torvalds#361/38  verifier_sdiv/SDIV64, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/39  verifier_sdiv/SDIV64, non-zero imm divisor, check 4:OK
  torvalds#361/40  verifier_sdiv/SDIV64, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/41  verifier_sdiv/SDIV64, non-zero imm divisor, check 5:OK
  torvalds#361/42  verifier_sdiv/SDIV64, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/43  verifier_sdiv/SDIV64, non-zero imm divisor, check 6:OK
  torvalds#361/44  verifier_sdiv/SDIV64, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/45  verifier_sdiv/SDIV64, non-zero reg divisor, check 1:OK
  torvalds#361/46  verifier_sdiv/SDIV64, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/47  verifier_sdiv/SDIV64, non-zero reg divisor, check 2:OK
  torvalds#361/48  verifier_sdiv/SDIV64, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/49  verifier_sdiv/SDIV64, non-zero reg divisor, check 3:OK
  torvalds#361/50  verifier_sdiv/SDIV64, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/51  verifier_sdiv/SDIV64, non-zero reg divisor, check 4:OK
  torvalds#361/52  verifier_sdiv/SDIV64, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/53  verifier_sdiv/SDIV64, non-zero reg divisor, check 5:OK
  torvalds#361/54  verifier_sdiv/SDIV64, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/55  verifier_sdiv/SDIV64, non-zero reg divisor, check 6:OK
  torvalds#361/56  verifier_sdiv/SDIV64, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/57  verifier_sdiv/SMOD32, non-zero imm divisor, check 1:OK
  torvalds#361/58  verifier_sdiv/SMOD32, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/59  verifier_sdiv/SMOD32, non-zero imm divisor, check 2:OK
  torvalds#361/60  verifier_sdiv/SMOD32, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/61  verifier_sdiv/SMOD32, non-zero imm divisor, check 3:OK
  torvalds#361/62  verifier_sdiv/SMOD32, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/63  verifier_sdiv/SMOD32, non-zero imm divisor, check 4:OK
  torvalds#361/64  verifier_sdiv/SMOD32, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/65  verifier_sdiv/SMOD32, non-zero imm divisor, check 5:OK
  torvalds#361/66  verifier_sdiv/SMOD32, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/67  verifier_sdiv/SMOD32, non-zero imm divisor, check 6:OK
  torvalds#361/68  verifier_sdiv/SMOD32, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/69  verifier_sdiv/SMOD32, non-zero reg divisor, check 1:OK
  torvalds#361/70  verifier_sdiv/SMOD32, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/71  verifier_sdiv/SMOD32, non-zero reg divisor, check 2:OK
  torvalds#361/72  verifier_sdiv/SMOD32, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/73  verifier_sdiv/SMOD32, non-zero reg divisor, check 3:OK
  torvalds#361/74  verifier_sdiv/SMOD32, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/75  verifier_sdiv/SMOD32, non-zero reg divisor, check 4:OK
  torvalds#361/76  verifier_sdiv/SMOD32, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/77  verifier_sdiv/SMOD32, non-zero reg divisor, check 5:OK
  torvalds#361/78  verifier_sdiv/SMOD32, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/79  verifier_sdiv/SMOD32, non-zero reg divisor, check 6:OK
  torvalds#361/80  verifier_sdiv/SMOD32, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/81  verifier_sdiv/SMOD64, non-zero imm divisor, check 1:OK
  torvalds#361/82  verifier_sdiv/SMOD64, non-zero imm divisor, check 1 @unpriv:OK
  torvalds#361/83  verifier_sdiv/SMOD64, non-zero imm divisor, check 2:OK
  torvalds#361/84  verifier_sdiv/SMOD64, non-zero imm divisor, check 2 @unpriv:OK
  torvalds#361/85  verifier_sdiv/SMOD64, non-zero imm divisor, check 3:OK
  torvalds#361/86  verifier_sdiv/SMOD64, non-zero imm divisor, check 3 @unpriv:OK
  torvalds#361/87  verifier_sdiv/SMOD64, non-zero imm divisor, check 4:OK
  torvalds#361/88  verifier_sdiv/SMOD64, non-zero imm divisor, check 4 @unpriv:OK
  torvalds#361/89  verifier_sdiv/SMOD64, non-zero imm divisor, check 5:OK
  torvalds#361/90  verifier_sdiv/SMOD64, non-zero imm divisor, check 5 @unpriv:OK
  torvalds#361/91  verifier_sdiv/SMOD64, non-zero imm divisor, check 6:OK
  torvalds#361/92  verifier_sdiv/SMOD64, non-zero imm divisor, check 6 @unpriv:OK
  torvalds#361/93  verifier_sdiv/SMOD64, non-zero imm divisor, check 7:OK
  torvalds#361/94  verifier_sdiv/SMOD64, non-zero imm divisor, check 7 @unpriv:OK
  torvalds#361/95  verifier_sdiv/SMOD64, non-zero imm divisor, check 8:OK
  torvalds#361/96  verifier_sdiv/SMOD64, non-zero imm divisor, check 8 @unpriv:OK
  torvalds#361/97  verifier_sdiv/SMOD64, non-zero reg divisor, check 1:OK
  torvalds#361/98  verifier_sdiv/SMOD64, non-zero reg divisor, check 1 @unpriv:OK
  torvalds#361/99  verifier_sdiv/SMOD64, non-zero reg divisor, check 2:OK
  torvalds#361/100 verifier_sdiv/SMOD64, non-zero reg divisor, check 2 @unpriv:OK
  torvalds#361/101 verifier_sdiv/SMOD64, non-zero reg divisor, check 3:OK
  torvalds#361/102 verifier_sdiv/SMOD64, non-zero reg divisor, check 3 @unpriv:OK
  torvalds#361/103 verifier_sdiv/SMOD64, non-zero reg divisor, check 4:OK
  torvalds#361/104 verifier_sdiv/SMOD64, non-zero reg divisor, check 4 @unpriv:OK
  torvalds#361/105 verifier_sdiv/SMOD64, non-zero reg divisor, check 5:OK
  torvalds#361/106 verifier_sdiv/SMOD64, non-zero reg divisor, check 5 @unpriv:OK
  torvalds#361/107 verifier_sdiv/SMOD64, non-zero reg divisor, check 6:OK
  torvalds#361/108 verifier_sdiv/SMOD64, non-zero reg divisor, check 6 @unpriv:OK
  torvalds#361/109 verifier_sdiv/SMOD64, non-zero reg divisor, check 7:OK
  torvalds#361/110 verifier_sdiv/SMOD64, non-zero reg divisor, check 7 @unpriv:OK
  torvalds#361/111 verifier_sdiv/SMOD64, non-zero reg divisor, check 8:OK
  torvalds#361/112 verifier_sdiv/SMOD64, non-zero reg divisor, check 8 @unpriv:OK
  torvalds#361/113 verifier_sdiv/SDIV32, zero divisor:OK
  torvalds#361/114 verifier_sdiv/SDIV32, zero divisor @unpriv:OK
  torvalds#361/115 verifier_sdiv/SDIV64, zero divisor:OK
  torvalds#361/116 verifier_sdiv/SDIV64, zero divisor @unpriv:OK
  torvalds#361/117 verifier_sdiv/SMOD32, zero divisor:OK
  torvalds#361/118 verifier_sdiv/SMOD32, zero divisor @unpriv:OK
  torvalds#361/119 verifier_sdiv/SMOD64, zero divisor:OK
  torvalds#361/120 verifier_sdiv/SMOD64, zero divisor @unpriv:OK
  torvalds#361     verifier_sdiv:OK
  Summary: 5/163 PASSED, 0 SKIPPED, 0 FAILED

  # ./test_progs -t ldsx_insn
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec
  libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524
  test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524)
  torvalds#116/1   ldsx_insn/map_val and probed_memory:FAIL
  torvalds#116/2   ldsx_insn/ctx_member_sign_ext:OK
  torvalds#116/3   ldsx_insn/ctx_member_narrow_sign_ext:OK
  torvalds#116     ldsx_insn:FAIL

  All error logs:
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec
  test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec
  libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22
  libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524
  test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524)
  torvalds#116/1   ldsx_insn/map_val and probed_memory:FAIL
  torvalds#116     ldsx_insn:FAIL
  Summary: 0/2 PASSED, 0 SKIPPED, 1 FAILED

Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant