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

Additional doc warning fixes for issues at next-20200915 #78

Closed
wants to merge 1 commit into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: Additional doc warning fixes for issues at next-20200915
version: 1
url: https://patchwork.ozlabs.org/project/netdev/list/?series=202347

@kernel-patches-bot
Copy link
Author

Master branch: c64779e
series: https://patchwork.ozlabs.org/project/netdev/list/?series=202347
version: 1

Pull request is NOT updated. Failed to apply https://patchwork.ozlabs.org/project/netdev/patch/442b27cc035ab7f9e5e000f2ac44ce88ea8b16a6.1600328701.git.mchehab+huawei@kernel.org/, error message was:
Cmd('git') failed due to: exit code(1)
cmdline: git apply -3 /tmp/tmp3d8jfplt
stderr: 'error: patch failed: Documentation/bpf/ringbuf.rst:197
Falling back to three-way merge...
Applied patch to 'Documentation/bpf/ringbuf.rst' with conflicts.
U Documentation/bpf/ringbuf.rst'

@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.ozlabs.org/project/netdev/list/?series=202347 expired. Closing PR.

@kernel-patches-bot kernel-patches-bot deleted the series/202347=>bpf-next branch September 30, 2020 16:13
kernel-patches-bot pushed a commit that referenced this pull request Mar 16, 2021
setup_fritz() in avmfritz.c might fail with -EIO and in this case the
isac.type and isac.write_reg is not initialized and remains 0(NULL).
A subsequent call to isac_release() will dereference isac->write_reg and
crash.

[    1.737444] BUG: kernel NULL pointer dereference, address: 0000000000000000
[    1.737809] #PF: supervisor instruction fetch in kernel mode
[    1.738106] #PF: error_code(0x0010) - not-present page
[    1.738378] PGD 0 P4D 0
[    1.738515] Oops: 0010 [#1] SMP NOPTI
[    1.738711] CPU: 0 PID: 180 Comm: systemd-udevd Not tainted 5.12.0-rc2+ #78
[    1.739077] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-48-gd9c812dda519-p
rebuilt.qemu.org 04/01/2014
[    1.739664] RIP: 0010:0x0
[    1.739807] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
[    1.740200] RSP: 0018:ffffc9000027ba10 EFLAGS: 00010202
[    1.740478] RAX: 0000000000000000 RBX: ffff888102f41840 RCX: 0000000000000027
[    1.740853] RDX: 00000000000000ff RSI: 0000000000000020 RDI: ffff888102f41800
[    1.741226] RBP: ffffc9000027ba20 R08: ffff88817bc18440 R09: ffffc9000027b808
[    1.741600] R10: 0000000000000001 R11: 0000000000000001 R12: ffff888102f41840
[    1.741976] R13: 00000000fffffffb R14: ffff888102f41800 R15: ffff8881008b0000
[    1.742351] FS:  00007fda3a38a8c0(0000) GS:ffff88817bc00000(0000) knlGS:0000000000000000
[    1.742774] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    1.743076] CR2: ffffffffffffffd6 CR3: 00000001021ec000 CR4: 00000000000006f0
[    1.743452] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    1.743828] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[    1.744206] Call Trace:
[    1.744339]  isac_release+0xcc/0xe0 [mISDNipac]
[    1.744582]  fritzpci_probe.cold+0x282/0x739 [avmfritz]
[    1.744861]  local_pci_probe+0x48/0x80
[    1.745063]  pci_device_probe+0x10f/0x1c0
[    1.745278]  really_probe+0xfb/0x420
[    1.745471]  driver_probe_device+0xe9/0x160
[    1.745693]  device_driver_attach+0x5d/0x70
[    1.745917]  __driver_attach+0x8f/0x150
[    1.746123]  ? device_driver_attach+0x70/0x70
[    1.746354]  bus_for_each_dev+0x7e/0xc0
[    1.746560]  driver_attach+0x1e/0x20
[    1.746751]  bus_add_driver+0x152/0x1f0
[    1.746957]  driver_register+0x74/0xd0
[    1.747157]  ? 0xffffffffc00d8000
[    1.747334]  __pci_register_driver+0x54/0x60
[    1.747562]  AVM_init+0x36/0x1000 [avmfritz]
[    1.747791]  do_one_initcall+0x48/0x1d0
[    1.747997]  ? __cond_resched+0x19/0x30
[    1.748206]  ? kmem_cache_alloc_trace+0x390/0x440
[    1.748458]  ? do_init_module+0x28/0x250
[    1.748669]  do_init_module+0x62/0x250
[    1.748870]  load_module+0x23ee/0x26a0
[    1.749073]  __do_sys_finit_module+0xc2/0x120
[    1.749307]  ? __do_sys_finit_module+0xc2/0x120
[    1.749549]  __x64_sys_finit_module+0x1a/0x20
[    1.749782]  do_syscall_64+0x38/0x90

Signed-off-by: Tong Zhang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
kernel-patches-bot pushed a commit that referenced this pull request Apr 30, 2021
Avoid a warning if the error percolates back up:

[440700.376476] CIFS VFS: \\otters.example.com crypt_message: Could not get encryption key
[440700.386947] ------------[ cut here ]------------
[440700.386948] err = 1
[440700.386977] WARNING: CPU: 11 PID: 2733 at /build/linux-hwe-5.4-p6lk6L/linux-hwe-5.4-5.4.0/lib/errseq.c:74 errseq_set+0x5c/0x70
...
[440700.397304] CPU: 11 PID: 2733 Comm: tar Tainted: G           OE     5.4.0-70-generic #78~18.04.1-Ubuntu
...
[440700.397334] Call Trace:
[440700.397346]  __filemap_set_wb_err+0x1a/0x70
[440700.397419]  cifs_writepages+0x9c7/0xb30 [cifs]
[440700.397426]  do_writepages+0x4b/0xe0
[440700.397444]  __filemap_fdatawrite_range+0xcb/0x100
[440700.397455]  filemap_write_and_wait+0x42/0xa0
[440700.397486]  cifs_setattr+0x68b/0xf30 [cifs]
[440700.397493]  notify_change+0x358/0x4a0
[440700.397500]  utimes_common+0xe9/0x1c0
[440700.397510]  do_utimes+0xc5/0x150
[440700.397520]  __x64_sys_utimensat+0x88/0xd0

Fixes: 61cfac6 ("CIFS: Fix possible use after free in demultiplex thread")
Signed-off-by: Paul Aurich <[email protected]>
CC: [email protected]
Signed-off-by: Steve French <[email protected]>
kernel-patches-bot pushed a commit that referenced this pull request Jul 16, 2021
commit 03623b4 ("rtc: pcf2127: add tamper detection support")
added support for timestamp interrupts. However they are not being
handled in the irq handler. If a timestamp interrupt occurs it
results in kernel disabling the interrupt and displaying the call
trace:

[  121.145580] irq 78: nobody cared (try booting with the "irqpoll" option)
...
[  121.238087] [<00000000c4d69393>] irq_default_primary_handler threaded [<000000000a90d25b>] pcf2127_rtc_irq [rtc_pcf2127]
[  121.248971] Disabling IRQ #78

Handle timestamp interrupts in pcf2127_rtc_irq(). Save time stamp
before clearing TSF1 and TSF2 flags so that it can't be overwritten.
Set a flag to mark if the timestamp is valid and only report to sysfs
if the flag is set. To mimic the hardware behavior, don’t save
another timestamp until the first one has been read by the userspace.

However, if the alarm irq is not configured, keep the old way of
handling timestamp interrupt in the timestamp0 sysfs calls.

Signed-off-by: Mian Yousaf Kaukab <[email protected]>
Reviewed-by: Bruno Thomsen <[email protected]>
Tested-by: Bruno Thomsen <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
kernel-patches-bot pushed a commit that referenced this pull request Dec 12, 2022
Fix the following NULL pointer dereference avoiding to run
mt76u_status_worker thread if the device is not running yet.

KASAN: null-ptr-deref in range
[0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 98 Comm: kworker/u2:2 Not tainted 5.14.0+ #78 Hardware
name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
Workqueue: mt76 mt76u_tx_status_data
RIP: 0010:mt76x02_mac_fill_tx_status.isra.0+0x82c/0x9e0
Code: c5 48 b8 00 00 00 00 00 fc ff df 80 3c 02 00 0f 85 94 01 00 00
48 b8 00 00 00 00 00 fc ff df 4d 8b 34 24 4c 89 f2 48 c1 ea 03 <0f>
b6
04 02 84 c0 74 08 3c 03 0f 8e 89 01 00 00 41 8b 16 41 0f b7
RSP: 0018:ffffc900005af988 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffffc900005afae8 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff832fc661 RDI: ffffc900005afc2a
RBP: ffffc900005afae0 R08: 0000000000000001 R09: fffff520000b5f3c
R10: 0000000000000003 R11: fffff520000b5f3b R12: ffff88810b6132d8
R13: 000000000000ffff R14: 0000000000000000 R15: ffffc900005afc28
FS:  0000000000000000(0000) GS:ffff88811aa00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa0eda6a000 CR3: 0000000118f17000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
 mt76x02_send_tx_status+0x1d2/0xeb0
 mt76x02_tx_status_data+0x8e/0xd0
 mt76u_tx_status_data+0xe1/0x240
 process_one_work+0x92b/0x1460
 worker_thread+0x95/0xe00
 kthread+0x3a1/0x480
 ret_from_fork+0x1f/0x30
Modules linked in:
--[ end trace 8df5d20fc5040f65 ]--
RIP: 0010:mt76x02_mac_fill_tx_status.isra.0+0x82c/0x9e0
Code: c5 48 b8 00 00 00 00 00 fc ff df 80 3c 02 00 0f 85 94 01 00 00
48 b8 00 00 00 00 00 fc ff df 4d 8b 34 24 4c 89 f2 48 c1 ea 03 <0f>
b6
04 02 84 c0 74 08 3c 03 0f 8e 89 01 00 00 41 8b 16 41 0f b7
RSP: 0018:ffffc900005af988 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffffc900005afae8 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff832fc661 RDI: ffffc900005afc2a
RBP: ffffc900005afae0 R08: 0000000000000001 R09: fffff520000b5f3c
R10: 0000000000000003 R11: fffff520000b5f3b R12: ffff88810b6132d8
R13: 000000000000ffff R14: 0000000000000000 R15: ffffc900005afc28
FS:  0000000000000000(0000) GS:ffff88811aa00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa0eda6a000 CR3: 0000000118f17000 CR4: 0000000000750ef0
PKRU: 55555554

Moreover move stat_work schedule out of the for loop.

Reported-by: Dokyung Song <[email protected]>
Co-developed-by: Deren Wu <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
kernel-patches-bot pushed a commit that referenced this pull request Jan 6, 2023
We need to detach from the power domains also on remove, not just on
probe fail so a subsequent probe works as expected.

Otherwise the following error appears on re-probe:

[   29.452005] sysfs: cannot create duplicate filename '/devices/genpd:0:3000000.remoteproc'
[   29.477121] CPU: 1 PID: 483 Comm: sh Tainted: G        W          6.1.0-rc4-00075-g71a113770bda #78
[   29.510319] Hardware name: Fairphone 4 (DT)
[   29.538335] Call trace:
[   29.564470]  dump_backtrace.part.0+0xe0/0xf0
[   29.592602]  show_stack+0x18/0x30
[   29.619616]  dump_stack_lvl+0x64/0x80
[   29.646834]  dump_stack+0x18/0x34
[   29.673541]  sysfs_warn_dup+0x60/0x7c
[   29.700592]  sysfs_create_dir_ns+0xec/0x110
[   29.728057]  kobject_add_internal+0xb8/0x374
[   29.755530]  kobject_add+0x9c/0x104
[   29.782072]  device_add+0xbc/0x8a0
[   29.808445]  device_register+0x20/0x30
[   29.835175]  genpd_dev_pm_attach_by_id+0xa4/0x190
[   29.862851]  genpd_dev_pm_attach_by_name+0x3c/0xb0
[   29.890472]  dev_pm_domain_attach_by_name+0x20/0x30
[   29.918212]  adsp_probe+0x278/0x580
[   29.944384]  platform_probe+0x68/0xc0
[   29.970603]  really_probe+0xbc/0x2dc
[   29.996662]  __driver_probe_device+0x78/0xe0
[   30.023491]  device_driver_attach+0x48/0xac
[   30.050215]  bind_store+0xb8/0x114
[   30.075957]  drv_attr_store+0x24/0x3c
[   30.101874]  sysfs_kf_write+0x44/0x54
[   30.127751]  kernfs_fop_write_iter+0x120/0x1f0
[   30.154448]  vfs_write+0x1ac/0x380
[   30.179937]  ksys_write+0x70/0x104
[   30.205274]  __arm64_sys_write+0x1c/0x2c
[   30.231060]  invoke_syscall+0x48/0x114
[   30.256594]  el0_svc_common.constprop.0+0x44/0xec
[   30.283183]  do_el0_svc+0x2c/0xd0
[   30.308320]  el0_svc+0x2c/0x84
[   30.333059]  el0t_64_sync_handler+0xf4/0x120
[   30.359001]  el0t_64_sync+0x18c/0x190
[   30.384385] kobject_add_internal failed for genpd:0:3000000.remoteproc with -EEXIST, don't try to register things with the same name in the same directory.
[   30.406029] remoteproc remoteproc0: releasing 3000000.remoteproc
[   30.416064] qcom_q6v5_pas: probe of 3000000.remoteproc failed with error -17

Fixes: 17ee2fb ("remoteproc: qcom: pas: Vote for active/proxy power domains")
Reviewed-by: Sibi Sankar <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>
Signed-off-by: Luca Weiss <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 21, 2023
Add selftest for the fill_link_info of uprobe, kprobe and tracepoint.
The result:

  #78/1    fill_link_info/kprobe_link_info:OK
  #78/2    fill_link_info/kretprobe_link_info:OK
  #78/3    fill_link_info/fill_invalid_user_buff:OK
  #78/4    fill_link_info/tracepoint_link_info:OK
  #78/5    fill_link_info/uprobe_link_info:OK
  #78/6    fill_link_info/uretprobe_link_info:OK
  #78      fill_link_info:OK
  Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 24, 2023
Add selftest for the fill_link_info of uprobe, kprobe and tracepoint.
The result:

  #78/1    fill_link_info/kprobe_link_info:OK
  #78/2    fill_link_info/kretprobe_link_info:OK
  #78/3    fill_link_info/fill_invalid_user_buff:OK
  #78/4    fill_link_info/tracepoint_link_info:OK
  #78/5    fill_link_info/uprobe_link_info:OK
  #78/6    fill_link_info/uretprobe_link_info:OK
  #78      fill_link_info:OK
  Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 24, 2023
Add selftest for the fill_link_info of uprobe, kprobe and tracepoint.
The result:

  #78/1    fill_link_info/kprobe_link_info:OK
  #78/2    fill_link_info/kretprobe_link_info:OK
  #78/3    fill_link_info/fill_invalid_user_buff:OK
  #78/4    fill_link_info/tracepoint_link_info:OK
  #78/5    fill_link_info/uprobe_link_info:OK
  #78/6    fill_link_info/uretprobe_link_info:OK
  #78      fill_link_info:OK
  Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 25, 2023
Add selftest for the fill_link_info of uprobe, kprobe and tracepoint.
The result:

  #78/1    fill_link_info/kprobe_link_info:OK
  #78/2    fill_link_info/kretprobe_link_info:OK
  #78/3    fill_link_info/fill_invalid_user_buff:OK
  #78/4    fill_link_info/tracepoint_link_info:OK
  #78/5    fill_link_info/uprobe_link_info:OK
  #78/6    fill_link_info/uretprobe_link_info:OK
  #78      fill_link_info:OK
  Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 25, 2023
Add selftest for the fill_link_info of uprobe, kprobe and tracepoint.
The result:

  #78/1    fill_link_info/kprobe_link_info:OK
  #78/2    fill_link_info/kretprobe_link_info:OK
  #78/3    fill_link_info/fill_invalid_user_buff:OK
  #78/4    fill_link_info/tracepoint_link_info:OK
  #78/5    fill_link_info/uprobe_link_info:OK
  #78/6    fill_link_info/uretprobe_link_info:OK
  #78      fill_link_info:OK
  Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Yafang Shao <[email protected]>
laoar added a commit to laoar/bpf that referenced this pull request Jul 27, 2023
Add selftest for the fill_link_info of uprobe, kprobe and tracepoint.
The result:

  kernel-patches#78/1    fill_link_info/kprobe_link_info:OK
  kernel-patches#78/2    fill_link_info/kretprobe_link_info:OK
  kernel-patches#78/3    fill_link_info/fill_invalid_user_buff:OK
  kernel-patches#78/4    fill_link_info/tracepoint_link_info:OK
  kernel-patches#78/5    fill_link_info/uprobe_link_info:OK
  kernel-patches#78/6    fill_link_info/uretprobe_link_info:OK
  kernel-patches#78      fill_link_info:OK
  Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 27, 2023
Add selftest for the fill_link_info of uprobe, kprobe and tracepoint.
The result:

  #78/1    fill_link_info/kprobe_link_info:OK
  #78/2    fill_link_info/kretprobe_link_info:OK
  #78/3    fill_link_info/fill_invalid_user_buff:OK
  #78/4    fill_link_info/tracepoint_link_info:OK
  #78/5    fill_link_info/uprobe_link_info:OK
  #78/6    fill_link_info/uretprobe_link_info:OK
  #78      fill_link_info:OK
  Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Yafang Shao <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Nov 27, 2023
With latest upstream llvm18, the following test cases failed:
  $ ./test_progs -j
  #13/2    bpf_cookie/multi_kprobe_link_api:FAIL
  #13/3    bpf_cookie/multi_kprobe_attach_api:FAIL
  #13      bpf_cookie:FAIL
  #77      fentry_fexit:FAIL
  #78/1    fentry_test/fentry:FAIL
  #78      fentry_test:FAIL
  #82/1    fexit_test/fexit:FAIL
  #82      fexit_test:FAIL
  #112/1   kprobe_multi_test/skel_api:FAIL
  #112/2   kprobe_multi_test/link_api_addrs:FAIL
  ...
  #112     kprobe_multi_test:FAIL
  #356/17  test_global_funcs/global_func17:FAIL
  #356     test_global_funcs:FAIL

Further analysis shows llvm upstream patch [1] is responsible
for the above failures. For example, for function bpf_fentry_test7()
in net/bpf/test_run.c, without [1], the asm code is:
  0000000000000400 <bpf_fentry_test7>:
     400: f3 0f 1e fa                   endbr64
     404: e8 00 00 00 00                callq   0x409 <bpf_fentry_test7+0x9>
     409: 48 89 f8                      movq    %rdi, %rax
     40c: c3                            retq
     40d: 0f 1f 00                      nopl    (%rax)
and with [1], the asm code is:
  0000000000005d20 <bpf_fentry_test7.specialized.1>:
    5d20: e8 00 00 00 00                callq   0x5d25 <bpf_fentry_test7.specialized.1+0x5>
    5d25: c3                            retq
and <bpf_fentry_test7.specialized.1> is called instead of <bpf_fentry_test7>
and this caused test failures for #13/#77 etc. except #356.

For test case #356/17, with [1] (progs/test_global_func17.c)),
the main prog looks like:
  0000000000000000 <global_func17>:
       0:       b4 00 00 00 2a 00 00 00 w0 = 0x2a
       1:       95 00 00 00 00 00 00 00 exit
which passed verification while the test itself expects a verification
failure.

Let us add 'barrier_var' style asm code in both places to prevent
function specialization which caused selftests failure.

  [1] llvm/llvm-project#72903

Signed-off-by: Yonghong Song <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Nov 27, 2023
With latest upstream llvm18, the following test cases failed:

  $ ./test_progs -j
  #13/2    bpf_cookie/multi_kprobe_link_api:FAIL
  #13/3    bpf_cookie/multi_kprobe_attach_api:FAIL
  #13      bpf_cookie:FAIL
  #77      fentry_fexit:FAIL
  #78/1    fentry_test/fentry:FAIL
  #78      fentry_test:FAIL
  #82/1    fexit_test/fexit:FAIL
  #82      fexit_test:FAIL
  #112/1   kprobe_multi_test/skel_api:FAIL
  #112/2   kprobe_multi_test/link_api_addrs:FAIL
  [...]
  #112     kprobe_multi_test:FAIL
  #356/17  test_global_funcs/global_func17:FAIL
  #356     test_global_funcs:FAIL

Further analysis shows llvm upstream patch [1] is responsible for the above
failures. For example, for function bpf_fentry_test7() in net/bpf/test_run.c,
without [1], the asm code is:

  0000000000000400 <bpf_fentry_test7>:
     400: f3 0f 1e fa                   endbr64
     404: e8 00 00 00 00                callq   0x409 <bpf_fentry_test7+0x9>
     409: 48 89 f8                      movq    %rdi, %rax
     40c: c3                            retq
     40d: 0f 1f 00                      nopl    (%rax)

... and with [1], the asm code is:

  0000000000005d20 <bpf_fentry_test7.specialized.1>:
    5d20: e8 00 00 00 00                callq   0x5d25 <bpf_fentry_test7.specialized.1+0x5>
    5d25: c3                            retq

... and <bpf_fentry_test7.specialized.1> is called instead of <bpf_fentry_test7>
and this caused test failures for #13/#77 etc. except #356.

For test case #356/17, with [1] (progs/test_global_func17.c)), the main prog
looks like:

  0000000000000000 <global_func17>:
       0:       b4 00 00 00 2a 00 00 00 w0 = 0x2a
       1:       95 00 00 00 00 00 00 00 exit

... which passed verification while the test itself expects a verification
failure.

Let us add 'barrier_var' style asm code in both places to prevent function
specialization which caused selftests failure.

  [1] llvm/llvm-project#72903

Signed-off-by: Yonghong Song <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 9, 2024
Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch
platform, some "unexpected arg" errors occur:

'''
 #78/1    dummy_st_ops/dummy_st_ops_attach:OK
 test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \
				actual 0 != expected 4076074229
 #78/2    dummy_st_ops/dummy_init_ret_value:FAIL
 #78/3    dummy_st_ops/dummy_init_ptr_arg:SKIP
 test_dummy_multiple_args:FAIL:arg 0 unexpected arg 0: \
				actual 0 != expected 7
 test_dummy_multiple_args:FAIL:arg 1 unexpected arg 1: \
				actual 0 != expected -100
 test_dummy_multiple_args:FAIL:arg 2 unexpected arg 2: \
				actual 0 != expected 35423
 test_dummy_multiple_args:FAIL:arg 3 unexpected arg 3: \
				actual 0 != expected 99
 test_dummy_multiple_args:FAIL:arg 4 unexpected arg 4: \
				actual 0 != expected 1311768467139281697
 #78/4    dummy_st_ops/dummy_multiple_args:FAIL
 #78/5    dummy_st_ops/dummy_sleepable:SKIP
 #78/6    dummy_st_ops/dummy_sleepable_reject_null:OK
 #78/7    dummy_st_ops/test_unsupported_field_sleepable:OK
 #78      dummy_st_ops:FAIL
'''

This is because BPF trampoline is not implemented on Loongarch yet,
bpf_prog_test_run_opts() returns ENOTSUPP.

This patch checks the return values of bpf_prog_test_run_opts() in
dummy_st_ops to fix these errors. If error returned, goto the newly
added label "out" to destroy the skel.

Signed-off-by: Geliang Tang <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 9, 2024
Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch
platform, some "unexpected arg" errors occur:

'''
 #78/1    dummy_st_ops/dummy_st_ops_attach:OK
 test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \
				actual 0 != expected 4076074229
 #78/2    dummy_st_ops/dummy_init_ret_value:FAIL
 #78/3    dummy_st_ops/dummy_init_ptr_arg:SKIP
 test_dummy_multiple_args:FAIL:arg 0 unexpected arg 0: \
				actual 0 != expected 7
 test_dummy_multiple_args:FAIL:arg 1 unexpected arg 1: \
				actual 0 != expected -100
 test_dummy_multiple_args:FAIL:arg 2 unexpected arg 2: \
				actual 0 != expected 35423
 test_dummy_multiple_args:FAIL:arg 3 unexpected arg 3: \
				actual 0 != expected 99
 test_dummy_multiple_args:FAIL:arg 4 unexpected arg 4: \
				actual 0 != expected 1311768467139281697
 #78/4    dummy_st_ops/dummy_multiple_args:FAIL
 #78/5    dummy_st_ops/dummy_sleepable:SKIP
 #78/6    dummy_st_ops/dummy_sleepable_reject_null:OK
 #78/7    dummy_st_ops/test_unsupported_field_sleepable:OK
 #78      dummy_st_ops:FAIL
'''

This is because BPF trampoline is not implemented on Loongarch yet,
bpf_prog_test_run_opts() returns ENOTSUPP.

This patch checks the return values of bpf_prog_test_run_opts() in
dummy_st_ops to fix these errors. If error returned, goto the newly
added label "out" to destroy the skel.

Signed-off-by: Geliang Tang <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 9, 2024
Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch
platform, some "unexpected arg" errors occur:

'''
 #78/1    dummy_st_ops/dummy_st_ops_attach:OK
 test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \
				actual 0 != expected 4076074229
 #78/2    dummy_st_ops/dummy_init_ret_value:FAIL
 #78/3    dummy_st_ops/dummy_init_ptr_arg:SKIP
 test_dummy_multiple_args:FAIL:arg 0 unexpected arg 0: \
				actual 0 != expected 7
 test_dummy_multiple_args:FAIL:arg 1 unexpected arg 1: \
				actual 0 != expected -100
 test_dummy_multiple_args:FAIL:arg 2 unexpected arg 2: \
				actual 0 != expected 35423
 test_dummy_multiple_args:FAIL:arg 3 unexpected arg 3: \
				actual 0 != expected 99
 test_dummy_multiple_args:FAIL:arg 4 unexpected arg 4: \
				actual 0 != expected 1311768467139281697
 #78/4    dummy_st_ops/dummy_multiple_args:FAIL
 #78/5    dummy_st_ops/dummy_sleepable:SKIP
 #78/6    dummy_st_ops/dummy_sleepable_reject_null:OK
 #78/7    dummy_st_ops/test_unsupported_field_sleepable:OK
 #78      dummy_st_ops:FAIL
'''

This is because BPF trampoline is not implemented on Loongarch yet,
bpf_prog_test_run_opts() returns ENOTSUPP.

This patch checks the return values of bpf_prog_test_run_opts() in
dummy_st_ops to fix these errors. If error returned, goto the newly
added label "out" to destroy the skel.

Signed-off-by: Geliang Tang <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 10, 2024
Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch
platform, some "unexpected arg" errors occur:

'''
 #78/1    dummy_st_ops/dummy_st_ops_attach:OK
 test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \
				actual 0 != expected 4076074229
 #78/2    dummy_st_ops/dummy_init_ret_value:FAIL
 #78/3    dummy_st_ops/dummy_init_ptr_arg:SKIP
 test_dummy_multiple_args:FAIL:arg 0 unexpected arg 0: \
				actual 0 != expected 7
 test_dummy_multiple_args:FAIL:arg 1 unexpected arg 1: \
				actual 0 != expected -100
 test_dummy_multiple_args:FAIL:arg 2 unexpected arg 2: \
				actual 0 != expected 35423
 test_dummy_multiple_args:FAIL:arg 3 unexpected arg 3: \
				actual 0 != expected 99
 test_dummy_multiple_args:FAIL:arg 4 unexpected arg 4: \
				actual 0 != expected 1311768467139281697
 #78/4    dummy_st_ops/dummy_multiple_args:FAIL
 #78/5    dummy_st_ops/dummy_sleepable:SKIP
 #78/6    dummy_st_ops/dummy_sleepable_reject_null:OK
 #78/7    dummy_st_ops/test_unsupported_field_sleepable:OK
 #78      dummy_st_ops:FAIL
'''

This is because BPF trampoline is not implemented on Loongarch yet,
bpf_prog_test_run_opts() returns ENOTSUPP.

This patch checks the return values of bpf_prog_test_run_opts() in
dummy_st_ops to fix these errors. If error returned, goto the newly
added label "out" to destroy the skel.

Signed-off-by: Geliang Tang <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 10, 2024
Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch
platform, some "unexpected arg" errors occur:

'''
 #78/1    dummy_st_ops/dummy_st_ops_attach:OK
 test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \
				actual 0 != expected 4076074229
 #78/2    dummy_st_ops/dummy_init_ret_value:FAIL
 #78/3    dummy_st_ops/dummy_init_ptr_arg:SKIP
 test_dummy_multiple_args:FAIL:arg 0 unexpected arg 0: \
				actual 0 != expected 7
 test_dummy_multiple_args:FAIL:arg 1 unexpected arg 1: \
				actual 0 != expected -100
 test_dummy_multiple_args:FAIL:arg 2 unexpected arg 2: \
				actual 0 != expected 35423
 test_dummy_multiple_args:FAIL:arg 3 unexpected arg 3: \
				actual 0 != expected 99
 test_dummy_multiple_args:FAIL:arg 4 unexpected arg 4: \
				actual 0 != expected 1311768467139281697
 #78/4    dummy_st_ops/dummy_multiple_args:FAIL
 #78/5    dummy_st_ops/dummy_sleepable:SKIP
 #78/6    dummy_st_ops/dummy_sleepable_reject_null:OK
 #78/7    dummy_st_ops/test_unsupported_field_sleepable:OK
 #78      dummy_st_ops:FAIL
'''

This is because BPF trampoline is not implemented on Loongarch yet,
bpf_prog_test_run_opts() returns ENOTSUPP.

This patch checks the return values of bpf_prog_test_run_opts() in
dummy_st_ops to fix these errors. If error returned, goto the newly
added label "out" to destroy the skel.

Signed-off-by: Geliang Tang <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Jul 10, 2024
Run dummy_st_ops selftests (./test_progs -t dummy_st_ops) on a Loongarch
platform, some "unexpected arg" errors occur:

'''
 #78/1    dummy_st_ops/dummy_st_ops_attach:OK
 test_dummy_init_ret_value:FAIL:test_ret unexpected test_ret: \
				actual 0 != expected 4076074229
 #78/2    dummy_st_ops/dummy_init_ret_value:FAIL
 #78/3    dummy_st_ops/dummy_init_ptr_arg:SKIP
 test_dummy_multiple_args:FAIL:arg 0 unexpected arg 0: \
				actual 0 != expected 7
 test_dummy_multiple_args:FAIL:arg 1 unexpected arg 1: \
				actual 0 != expected -100
 test_dummy_multiple_args:FAIL:arg 2 unexpected arg 2: \
				actual 0 != expected 35423
 test_dummy_multiple_args:FAIL:arg 3 unexpected arg 3: \
				actual 0 != expected 99
 test_dummy_multiple_args:FAIL:arg 4 unexpected arg 4: \
				actual 0 != expected 1311768467139281697
 #78/4    dummy_st_ops/dummy_multiple_args:FAIL
 #78/5    dummy_st_ops/dummy_sleepable:SKIP
 #78/6    dummy_st_ops/dummy_sleepable_reject_null:OK
 #78/7    dummy_st_ops/test_unsupported_field_sleepable:OK
 #78      dummy_st_ops:FAIL
'''

This is because BPF trampoline is not implemented on Loongarch yet,
bpf_prog_test_run_opts() returns ENOTSUPP.

This patch checks the return values of bpf_prog_test_run_opts() in
dummy_st_ops to fix these errors. If error returned, goto the newly
added label "out" to destroy the skel.

Signed-off-by: Geliang Tang <[email protected]>
shunghsiyu pushed a commit to shunghsiyu/bpf that referenced this pull request Dec 18, 2024
[ Upstream commit 5c1806c ]

While fuzzing an arm64 kernel, Alexander Potapenko reported:

| BUG: KCSAN: data-race in ktime_get_mono_fast_ns / timekeeping_update
|
| write to 0xffffffc082e74248 of 56 bytes by interrupt on cpu 0:
|  update_fast_timekeeper kernel/time/timekeeping.c:430 [inline]
|  timekeeping_update+0x1d8/0x2d8 kernel/time/timekeeping.c:768
|  timekeeping_advance+0x9e8/0xb78 kernel/time/timekeeping.c:2344
|  update_wall_time+0x18/0x38 kernel/time/timekeeping.c:2360
|  [...]
|
| read to 0xffffffc082e74258 of 8 bytes by task 5260 on cpu 1:
|  __ktime_get_fast_ns kernel/time/timekeeping.c:372 [inline]
|  ktime_get_mono_fast_ns+0x88/0x174 kernel/time/timekeeping.c:489
|  init_srcu_struct_fields+0x40c/0x530 kernel/rcu/srcutree.c:263
|  init_srcu_struct+0x14/0x20 kernel/rcu/srcutree.c:311
|  [...]
|
| value changed: 0x000002f875d33266 -> 0x000002f877416866
|
| Reported by Kernel Concurrency Sanitizer on:
| CPU: 1 UID: 0 PID: 5260 Comm: syz.2.7483 Not tainted 6.12.0-rc3-dirty kernel-patches#78

This is a false positive data race between a seqcount latch writer and a reader
accessing stale data. Since its introduction, KCSAN has never understood the
seqcount_latch interface (due to being unannotated).

Unlike the regular seqlock interface, the seqcount_latch interface for latch
writers never has had a well-defined critical section, making it difficult to
teach tooling where the critical section starts and ends.

Introduce an instrumentable (non-raw) seqcount_latch interface, with
which we can clearly denote writer critical sections. This both helps
readability and tooling like KCSAN to understand when the writer is done
updating all latch copies.

Fixes: 88ecd15 ("seqlock, kcsan: Add annotations for KCSAN")
Reported-by: Alexander Potapenko <[email protected]>
Co-developed-by: "Peter Zijlstra (Intel)" <[email protected]>
Signed-off-by: "Peter Zijlstra (Intel)" <[email protected]>
Signed-off-by: Marco Elver <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
kernel-patches-daemon-bpf bot pushed a commit that referenced this pull request Dec 21, 2024
…uctions

Add the following ./test_progs tests:

  * atomics/load_acquire
  * atomics/store_release
  * arena_atomics/load_acquire
  * arena_atomics/store_release

They depend on the pre-defined __BPF_FEATURE_LOAD_ACQ_STORE_REL feature
macro, which implies -mcpu>=v4.

  $ ALLOWLIST=atomics/load_acquire,atomics/store_release,
  $ ALLOWLIST+=arena_atomics/load_acquire,arena_atomics/store_release

  $ ./test_progs-cpuv4 -a $ALLOWLIST

  #3/9     arena_atomics/load_acquire:OK
  #3/10    arena_atomics/store_release:OK
...
  #10/8    atomics/load_acquire:OK
  #10/9    atomics/store_release:OK

  $ ./test_progs -v -a $ALLOWLIST

  test_load_acquire:SKIP:Clang does not support BPF load-acquire or addr_space_cast
  #3/9     arena_atomics/load_acquire:SKIP
  test_store_release:SKIP:Clang does not support BPF store-release or addr_space_cast
  #3/10    arena_atomics/store_release:SKIP
...
  test_load_acquire:SKIP:Clang does not support BPF load-acquire
  #10/8    atomics/load_acquire:SKIP
  test_store_release:SKIP:Clang does not support BPF store-release
  #10/9    atomics/store_release:SKIP

Additionally, add several ./test_verifier tests:

  #65/u atomic BPF_LOAD_ACQ access through non-pointer  OK
  #65/p atomic BPF_LOAD_ACQ access through non-pointer  OK
  #66/u atomic BPF_STORE_REL access through non-pointer  OK
  #66/p atomic BPF_STORE_REL access through non-pointer  OK

  #67/u BPF_ATOMIC load-acquire, 8-bit OK
  #67/p BPF_ATOMIC load-acquire, 8-bit OK
  #68/u BPF_ATOMIC load-acquire, 16-bit OK
  #68/p BPF_ATOMIC load-acquire, 16-bit OK
  #69/u BPF_ATOMIC load-acquire, 32-bit OK
  #69/p BPF_ATOMIC load-acquire, 32-bit OK
  #70/u BPF_ATOMIC load-acquire, 64-bit OK
  #70/p BPF_ATOMIC load-acquire, 64-bit OK
  #71/u Cannot load-acquire from uninitialized src_reg OK
  #71/p Cannot load-acquire from uninitialized src_reg OK

  #76/u BPF_ATOMIC store-release, 8-bit OK
  #76/p BPF_ATOMIC store-release, 8-bit OK
  #77/u BPF_ATOMIC store-release, 16-bit OK
  #77/p BPF_ATOMIC store-release, 16-bit OK
  #78/u BPF_ATOMIC store-release, 32-bit OK
  #78/p BPF_ATOMIC store-release, 32-bit OK
  #79/u BPF_ATOMIC store-release, 64-bit OK
  #79/p BPF_ATOMIC store-release, 64-bit OK
  #80/u Cannot store-release from uninitialized src_reg OK
  #80/p Cannot store-release from uninitialized src_reg OK

Reviewed-by: Josh Don <[email protected]>
Signed-off-by: Peilin Ye <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant