From 8a2433cd17d4156b722c6547605d0e47f896b424 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 11 May 2020 17:39:59 -0400 Subject: [PATCH] Fixes for 4.19 Signed-off-by: Sasha Levin --- queue-4.19/series | 2 + ...bes-fix-a-double-initialization-typo.patch | 41 ++++++++++++ ...onsole-freeing-with-a-common-interfa.patch | 62 +++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 queue-4.19/tracing-kprobes-fix-a-double-initialization-typo.patch create mode 100644 queue-4.19/vt-fix-unicode-console-freeing-with-a-common-interfa.patch diff --git a/queue-4.19/series b/queue-4.19/series index 396b83be1c6..347b611f19c 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -1 +1,3 @@ usb-serial-qcserial-add-dw5816e-support.patch +tracing-kprobes-fix-a-double-initialization-typo.patch +vt-fix-unicode-console-freeing-with-a-common-interfa.patch diff --git a/queue-4.19/tracing-kprobes-fix-a-double-initialization-typo.patch b/queue-4.19/tracing-kprobes-fix-a-double-initialization-typo.patch new file mode 100644 index 00000000000..685b312a39c --- /dev/null +++ b/queue-4.19/tracing-kprobes-fix-a-double-initialization-typo.patch @@ -0,0 +1,41 @@ +From 6db3576d84e6d097243906f9dee8a36c0dfa702b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 25 Apr 2020 14:49:09 +0900 +Subject: tracing/kprobes: Fix a double initialization typo + +From: Masami Hiramatsu + +[ Upstream commit dcbd21c9fca5e954fd4e3d91884907eb6d47187e ] + +Fix a typo that resulted in an unnecessary double +initialization to addr. + +Link: http://lkml.kernel.org/r/158779374968.6082.2337484008464939919.stgit@devnote2 + +Cc: Tom Zanussi +Cc: Ingo Molnar +Cc: stable@vger.kernel.org +Fixes: c7411a1a126f ("tracing/kprobe: Check whether the non-suffixed symbol is notrace") +Signed-off-by: Masami Hiramatsu +Signed-off-by: Steven Rostedt (VMware) +Signed-off-by: Sasha Levin +--- + kernel/trace/trace_kprobe.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c +index 65b4e28ff425f..c45b017bacd47 100644 +--- a/kernel/trace/trace_kprobe.c ++++ b/kernel/trace/trace_kprobe.c +@@ -538,7 +538,7 @@ static bool __within_notrace_func(unsigned long addr) + + static bool within_notrace_func(struct trace_kprobe *tk) + { +- unsigned long addr = addr = trace_kprobe_address(tk); ++ unsigned long addr = trace_kprobe_address(tk); + char symname[KSYM_NAME_LEN], *p; + + if (!__within_notrace_func(addr)) +-- +2.20.1 + diff --git a/queue-4.19/vt-fix-unicode-console-freeing-with-a-common-interfa.patch b/queue-4.19/vt-fix-unicode-console-freeing-with-a-common-interfa.patch new file mode 100644 index 00000000000..f7cb0bcfe54 --- /dev/null +++ b/queue-4.19/vt-fix-unicode-console-freeing-with-a-common-interfa.patch @@ -0,0 +1,62 @@ +From 2afe427e5d16d37ab1cb8e1a5c002f6ea71d1e4c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 2 May 2020 11:01:07 -0400 +Subject: vt: fix unicode console freeing with a common interface + +From: Nicolas Pitre + +[ Upstream commit 57d38f26d81e4275748b69372f31df545dcd9b71 ] + +By directly using kfree() in different places we risk missing one if +it is switched to using vfree(), especially if the corresponding +vmalloc() is hidden away within a common abstraction. + +Oh wait, that's exactly what happened here. + +So let's fix this by creating a common abstraction for the free case +as well. + +Signed-off-by: Nicolas Pitre +Reported-by: syzbot+0bfda3ade1ee9288a1be@syzkaller.appspotmail.com +Fixes: 9a98e7a80f95 ("vt: don't use kmalloc() for the unicode screen buffer") +Cc: +Reviewed-by: Sam Ravnborg +Link: https://lore.kernel.org/r/nycvar.YSQ.7.76.2005021043110.2671@knanqh.ubzr +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/tty/vt/vt.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c +index ca8c6ddc1ca8c..5c7a968a5ea67 100644 +--- a/drivers/tty/vt/vt.c ++++ b/drivers/tty/vt/vt.c +@@ -365,9 +365,14 @@ static struct uni_screen *vc_uniscr_alloc(unsigned int cols, unsigned int rows) + return uniscr; + } + ++static void vc_uniscr_free(struct uni_screen *uniscr) ++{ ++ vfree(uniscr); ++} ++ + static void vc_uniscr_set(struct vc_data *vc, struct uni_screen *new_uniscr) + { +- vfree(vc->vc_uni_screen); ++ vc_uniscr_free(vc->vc_uni_screen); + vc->vc_uni_screen = new_uniscr; + } + +@@ -1233,7 +1238,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, + err = resize_screen(vc, new_cols, new_rows, user); + if (err) { + kfree(newscreen); +- kfree(new_uniscr); ++ vc_uniscr_free(new_uniscr); + return err; + } + +-- +2.20.1 + -- 2.47.3