[20.04 FEAT] Enable proper kprobes on ftrace support
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu on IBM z Systems |
Fix Released
|
High
|
Frank Heimes | ||
linux (Ubuntu) |
Fix Released
|
High
|
Frank Heimes |
Bug Description
Our architecture backend already provides kprobes on ftrace support by allowing to setting a kprobe on the first instruction even if it is the ftrace nop or ftrace mcount instruction block.
This however still means that an illegal instruction is placed to the first instruction, which causes an exception and subsequent single stepping of the replaced instruction.
With proper kprobes on ftrace support there won't be an exception nor any single stepping - which means that kprobes placed at the first instruction will be much faster than now.
As a side effect by implementing this both the ftrace as well as the kprobes code will get a bit simpler.
Mandatory requirement for Performance Measurements!
Code available with kernel 5.6
https:/
CVE References
tags: | added: architecture-s39064 bugnameltc-184162 severity-high targetmilestone-inin2004 |
Changed in ubuntu: | |
assignee: | nobody → Skipper Bug Screeners (skipper-screen-team) |
affects: | ubuntu → linux (Ubuntu) |
Changed in linux (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in ubuntu-z-systems: | |
status: | In Progress → Fix Committed |
tags: |
added: verification-done-focal removed: verification-needed-focal |
Changed in ubuntu-z-systems: | |
status: | Fix Committed → Fix Released |
Looks like commit 657480d9c015 "s390: support KPROBES_ON_FTRACE" is in since 5.6-rc1
I tried to cherry pick (on top of focal master-next) but it failed:
$ git cherry-pick -x -s -e 657480d9c015 kernel/ mcount. S kernel/ mcount. S
Auto-merging arch/s390/
CONFLICT (content): Merge conflict in arch/s390/
Auto-merging arch/s390/Kconfig
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 1670 and retry the command.
error: could not apply 657480d9c015... s390: support KPROBES_ON_FTRACE
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
git status master- next'.
On branch master-next
Your branch is up to date with 'origin/
You are currently cherry-picking commit 657480d9c015.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed: features/ debug/kprobes- on-ftrace/ arch-support. txt include/ asm/kprobes. h kernel/ ftrace. c kernel/ kprobes. c
modified: Documentation/
modified: arch/s390/Kconfig
modified: arch/s390/
modified: arch/s390/
modified: arch/s390/
Unmerged paths: kernel/ mcount. S
(use "git add <file>..." to mark resolution)
both modified: arch/s390/
$ git difftool kernel/ mcount. S 7458dcfd6464. .000000000000 s390/kernel/ mcount. S s390/kernel/ mcount. S SYMBOL( _mcount ftrace_ caller) regs_caller, ftrace_ caller _SF_GPRS+ 8*8)(%r15) # save traced function caller CC_USING_ HOTPATCH) || defined( CC_USING_ NOP_MCOUNT) ) RETURN_ FIXUP
diff --cc arch/s390/
index 3431b2d5e334,
--- a/arch/
+++ b/arch/
@@@ -41,6 -41,10 +41,13 @@@ EXPORT_
ENTRY(
.globl ftrace_regs_caller
.set ftrace_
++<<<<<<< HEAD
++=======
+ stg %r14,(_
+ lghi %r14,0 # save condition code
+ ipm %r14 # don't put any instructions
+ sllg %r14,%r14,16 # clobbering CC before this point
++>>>>>>> 657480d9c015... s390: support KPROBES_ON_FTRACE
lgr %r1,%r15
#if !(defined(
aghi %r0,MCOUNT_
The conflict is in "arch/s390/ kernel/ mcount. S" assembler code.
Are there add. commits needed as pre-reqs? Or a backport?
Please can you check on top of focal master-next? /git.launchpad. net/~ubuntu- kernel/ ubuntu/ +source/ linux/+ git/focal --branch master-next --single-branch
$ git clone https:/