* FAILED: patch "[PATCH] parisc: fix race condition in patching code" failed to apply to 5.2-stable tree
@ 2019-08-05 5:30 gregkh
2019-08-05 7:45 ` Sven Schnelle
0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2019-08-05 5:30 UTC (permalink / raw)
To: svens, deller, stable; +Cc: stable
The patch below does not apply to the 5.2-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 740f05f30a8c49ec63668055d28feedd906d3c50 Mon Sep 17 00:00:00 2001
From: Sven Schnelle <svens@stackframe.org>
Date: Tue, 23 Jul 2019 22:37:54 +0200
Subject: [PATCH] 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>
diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c
index d784ccdd8fef..b6fb30f2e4bf 100644
--- a/arch/parisc/kernel/ftrace.c
+++ b/arch/parisc/kernel/ftrace.c
@@ -181,8 +181,9 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
for (i = 0; i < ARRAY_SIZE(insn); i++)
insn[i] = INSN_NOP;
+ __patch_text((void *)rec->ip, INSN_NOP);
__patch_text_multiple((void *)rec->ip + 4 - sizeof(insn),
- insn, sizeof(insn));
+ insn, sizeof(insn)-4);
return 0;
}
#endif
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: FAILED: patch "[PATCH] parisc: fix race condition in patching code" failed to apply to 5.2-stable tree
2019-08-05 5:30 FAILED: patch "[PATCH] parisc: fix race condition in patching code" failed to apply to 5.2-stable tree gregkh
@ 2019-08-05 7:45 ` Sven Schnelle
2019-08-05 10:57 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Sven Schnelle @ 2019-08-05 7:45 UTC (permalink / raw)
To: gregkh; +Cc: deller, stable
On Mon, Aug 05, 2019 at 07:30:55AM +0200, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 5.2-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
The reason is that 5.2 doesn't have DYNAMIC_FTRACE suport, so this can be
ignored.
Regards
Sven
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: FAILED: patch "[PATCH] parisc: fix race condition in patching code" failed to apply to 5.2-stable tree
2019-08-05 7:45 ` Sven Schnelle
@ 2019-08-05 10:57 ` Greg KH
2019-08-05 11:12 ` Sven Schnelle
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2019-08-05 10:57 UTC (permalink / raw)
To: Sven Schnelle; +Cc: deller, stable
On Mon, Aug 05, 2019 at 09:45:24AM +0200, Sven Schnelle wrote:
> On Mon, Aug 05, 2019 at 07:30:55AM +0200, gregkh@linuxfoundation.org wrote:
> >
> > The patch below does not apply to the 5.2-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
>
> The reason is that 5.2 doesn't have DYNAMIC_FTRACE suport, so this can be
> ignored.
Then why did the patch have:
Cc: <stable@vger.kernel.org> # 5.2+
in it?
confused,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: FAILED: patch "[PATCH] parisc: fix race condition in patching code" failed to apply to 5.2-stable tree
2019-08-05 10:57 ` Greg KH
@ 2019-08-05 11:12 ` Sven Schnelle
2019-08-05 12:00 ` Aw: " Helge Deller
0 siblings, 1 reply; 5+ messages in thread
From: Sven Schnelle @ 2019-08-05 11:12 UTC (permalink / raw)
To: Greg KH; +Cc: deller, stable
Hi Greg,
On Mon, Aug 05, 2019 at 12:57:01PM +0200, Greg KH wrote:
> On Mon, Aug 05, 2019 at 09:45:24AM +0200, Sven Schnelle wrote:
> > On Mon, Aug 05, 2019 at 07:30:55AM +0200, gregkh@linuxfoundation.org wrote:
> > >
> > > The patch below does not apply to the 5.2-stable tree.
> > > If someone wants it applied there, or to any other stable or longterm
> > > tree, then please email the backport, including the original git commit
> > > id to <stable@vger.kernel.org>.
> >
> > The reason is that 5.2 doesn't have DYNAMIC_FTRACE suport, so this can be
> > ignored.
>
> Then why did the patch have:
> Cc: <stable@vger.kernel.org> # 5.2+
> in it?
My Fault. Helge asked me whether this patch should be added to 5.2 stable,
and i said "yes", assuming that DYNAMIC_FTRACE for PA-RISC is already in
Linux-5.2, which isn't the case. It got merged in 5.3.
Regards
Sven
^ permalink raw reply [flat|nested] 5+ messages in thread
* Aw: Re: FAILED: patch "[PATCH] parisc: fix race condition in patching code" failed to apply to 5.2-stable tree
2019-08-05 11:12 ` Sven Schnelle
@ 2019-08-05 12:00 ` Helge Deller
0 siblings, 0 replies; 5+ messages in thread
From: Helge Deller @ 2019-08-05 12:00 UTC (permalink / raw)
To: Sven Schnelle; +Cc: Greg KH, stable
> On Mon, Aug 05, 2019 at 12:57:01PM +0200, Greg KH wrote:
> > On Mon, Aug 05, 2019 at 09:45:24AM +0200, Sven Schnelle wrote:
> > > On Mon, Aug 05, 2019 at 07:30:55AM +0200, gregkh@linuxfoundation.org wrote:
> > > >
> > > > The patch below does not apply to the 5.2-stable tree.
> > > > If someone wants it applied there, or to any other stable or longterm
> > > > tree, then please email the backport, including the original git commit
> > > > id to <stable@vger.kernel.org>.
> > >
> > > The reason is that 5.2 doesn't have DYNAMIC_FTRACE suport, so this can be
> > > ignored.
> >
> > Then why did the patch have:
> > Cc: <stable@vger.kernel.org> # 5.2+
> > in it?
>
> My Fault. Helge asked me whether this patch should be added to 5.2 stable,
> and i said "yes", assuming that DYNAMIC_FTRACE for PA-RISC is already in
> Linux-5.2, which isn't the case. It got merged in 5.3.
Greg, It's actually my fault.
I did asked Sven, but usually I do test if the patches apply cleanly too.
So either I did missed that testing for this patch, or something else must have
been wrong on my side.
Sorry for that.
Helge
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-08-05 12:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-05 5:30 FAILED: patch "[PATCH] parisc: fix race condition in patching code" failed to apply to 5.2-stable tree gregkh
2019-08-05 7:45 ` Sven Schnelle
2019-08-05 10:57 ` Greg KH
2019-08-05 11:12 ` Sven Schnelle
2019-08-05 12:00 ` Aw: " Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).