diff options
author | Sven Schnelle <svens@stackframe.org> | 2019-07-23 22:37:54 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2019-07-31 16:20:57 +0200 |
commit | 740f05f30a8c49ec63668055d28feedd906d3c50 (patch) | |
tree | 7177aaf87236e725de630783278873059f41d023 /net/ncsi | |
parent | c5df04521b521f14c30de327aa1e880f1190a355 (diff) | |
download | linux-740f05f30a8c49ec63668055d28feedd906d3c50.tar.bz2 |
parisc: fix race condition in patching code
Assume the following ftrace code sequence that was patched in earlier by
ftrace_make_call():
PAGE A:
ffc: addr of ftrace_caller()
PAGE B:
000: 0x6fc10080 /* stw,ma r1,40(sp) */
004: 0x48213fd1 /* ldw -18(r1),r1 */
008: 0xe820c002 /* bv,n r0(r1) */
00c: 0xe83f1fdf /* b,l,n .-c,r1 */
When a Code sequences that is to be patched spans a page break, we might
have already cleared the part on the PAGE A. If an interrupt is coming in
during the remap of the fixed mapping to PAGE B, it might execute the
patched function with only parts of the FTRACE code cleared. To prevent
this, clear the jump to our mini trampoline first, and clear the remaining
parts after this. This might also happen when patch_text() patches a
function that it calls during remap.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Cc: <stable@vger.kernel.org> # 5.2+
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'net/ncsi')
0 files changed, 0 insertions, 0 deletions