not able to unwind the stack from within __kernel_clock_gettime in the Linux vDSO
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
The Ubuntu-power-systems project |
Fix Released
|
High
|
Canonical Kernel Team | ||
linux (Ubuntu) |
Fix Released
|
High
|
Joseph Salisbury | ||
Bionic |
Fix Released
|
High
|
Joseph Salisbury | ||
Cosmic |
Fix Released
|
High
|
Joseph Salisbury |
Bug Description
== SRU Justification ==
IBM is requesting this commit in Bionic and Cosmic. They report that they
are not able to unwind the stack from within __kernel_
Linux vDSO on Summit. This affects both DDT and MAP (via GDB and libunwind).
The issue is more serious than may first appear as the function appears to
be called somewhat often by the CUDA runtime, and can defer to a syscall
making it relatively time consuming (making it more likely to be encountered).
This commit is currently still in linux-next.
== Fix ==
56d20861c027 ("powerpc/vdso: Correct call frame information") linux-next
== Regression Potential ==
Low. Limited to powerpc.
Original Bug Description
We're not able to unwind the stack from within __kernel_
To reproduce:
Compile $CUDA_DIR/
Run the following GDB commands:
user@deb3qwsp1:
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc64le-
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://
Find the GDB manual and other documentation resources online at:
<http://
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./matrixMul...(no debugging symbols found)...done.
(gdb) break main
Breakpoint 1 at 0x8284
(gdb) run
Starting program: /usr/local/
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc64
Breakpoint 1, 0x0000000100008284 in main ()
(gdb) break *(__kernel_
Breakpoint 2 at 0x7ffff7f805e4: file /build/
(gdb) continue
Continuing.
[Matrix Multiply Using CUDA] - Starting...
Breakpoint 2, __kernel_
127 /build/
(gdb) bt
#0 __kernel_
#1 0x00007ffff7b8f530 in ?? () from /lib/powerpc64l
#2 0x00007ffff6b81118 in ?? () from /usr/lib/
#3 0x00007ffff6a69c70 in ?? () from /usr/lib/
#4 0x00007ffff6bf0ba0 in cuInit () from /usr/lib/
#5 0x000000010003ca50 in cudart:
#6 0x00007ffff7f05274 in __pthread_once_slow (
once_
init_
#7 0x000000010008ea88 in cudart:
#8 0x00000001000410a8 in cudart:
#9 0x000000010005ec90 in cudaGetDeviceCount ()
#10 0x0000000100009930 in gpuGetMaxGflops
#11 0x0000000100009bf4 in findCudaDevice(int, char const**) ()
#12 0x000000010000836c in main ()
(gdb) step
128 in /build/
(gdb) bt
#0 __kernel_
#1 0x0000000000000000 in ?? ()
(gdb)
Note: __kernel_
Note that a backtrace can be collected before entering the syscall, but not during. The inability to unwind also prevents GDB from being able to "finish" (step out of) the function:
(gdb) finish
Run till exit from #0 __kernel_
at /build/
Warning:
Cannot insert breakpoint 0.
Cannot access memory at address 0x0
Command aborted.
(gdb)
The cause of the issue is a lack of Call Frame Information (CFI) in the syscall code path, and so a potential fix here could be to save the link register and add the corresponding CFI directive for the syscall code path (as is done for the alternative code path).[Less]
This is now upstream accepted in the powerpc tree as git commit
https:/
("powerpc/vdso: Correct call frame information")
CVE References
tags: | added: architecture-ppc64le bugnameltc-172349 severity-high targetmilestone-inin1804 |
Changed in ubuntu: | |
assignee: | nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) |
affects: | ubuntu → linux (Ubuntu) |
Changed in ubuntu-power-systems: | |
importance: | Undecided → High |
assignee: | nobody → Canonical Kernel Team (canonical-kernel-team) |
Changed in linux (Ubuntu): | |
importance: | Undecided → High |
Changed in linux (Ubuntu): | |
assignee: | Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → Canonical Kernel Team (canonical-kernel-team) |
Changed in ubuntu-power-systems: | |
status: | New → In Progress |
Changed in linux (Ubuntu Bionic): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Cosmic): | |
status: | In Progress → Fix Committed |
Changed in ubuntu-power-systems: | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu): | |
status: | Fix Committed → Fix Released |
Changed in ubuntu-power-systems: | |
status: | Fix Committed → Fix Released |
tags: | added: cscc |
I built a test kernel with linux-next commit 56d20861c027. The test kernel can be downloaded from: kernel. ubuntu. com/~jsalisbury /lp1797963
http://
Can you test this kernel and see if it resolves this bug?
Note about installing test kernels: unsigned .deb packages.
• If the test kernel is prior to 4.15(Bionic) you need to install the linux-image and linux-image-extra .deb packages.
• If the test kernel is 4.15(Bionic) or newer, you need to install the linux-modules, linux-modules-extra and linux-image-
Thanks in advance!