From: Greg Kroah-Hartman Date: Sun, 28 Feb 2021 14:01:42 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.4.259~83 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=341c068e0ff5d45e8707a317225d7dfa440b1fdc;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: kdb-make-memory-allocations-more-robust.patch mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch --- diff --git a/queue-4.4/kdb-make-memory-allocations-more-robust.patch b/queue-4.4/kdb-make-memory-allocations-more-robust.patch new file mode 100644 index 00000000000..dc5d5430a51 --- /dev/null +++ b/queue-4.4/kdb-make-memory-allocations-more-robust.patch @@ -0,0 +1,40 @@ +From 93f7a6d818deef69d0ba652d46bae6fbabbf365c Mon Sep 17 00:00:00 2001 +From: Sumit Garg +Date: Fri, 22 Jan 2021 16:35:56 +0530 +Subject: kdb: Make memory allocations more robust + +From: Sumit Garg + +commit 93f7a6d818deef69d0ba652d46bae6fbabbf365c upstream. + +Currently kdb uses in_interrupt() to determine whether its library +code has been called from the kgdb trap handler or from a saner calling +context such as driver init. This approach is broken because +in_interrupt() alone isn't able to determine kgdb trap handler entry from +normal task context. This can happen during normal use of basic features +such as breakpoints and can also be trivially reproduced using: +echo g > /proc/sysrq-trigger + +We can improve this by adding check for in_dbg_master() instead which +explicitly determines if we are running in debugger context. + +Cc: stable@vger.kernel.org +Signed-off-by: Sumit Garg +Link: https://lore.kernel.org/r/1611313556-4004-1-git-send-email-sumit.garg@linaro.org +Signed-off-by: Daniel Thompson +Signed-off-by: Greg Kroah-Hartman +--- + kernel/debug/kdb/kdb_private.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/debug/kdb/kdb_private.h ++++ b/kernel/debug/kdb/kdb_private.h +@@ -234,7 +234,7 @@ extern struct task_struct *kdb_curr_task + #define kdb_do_each_thread(g, p) do_each_thread(g, p) + #define kdb_while_each_thread(g, p) while_each_thread(g, p) + +-#define GFP_KDB (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL) ++#define GFP_KDB (in_dbg_master() ? GFP_ATOMIC : GFP_KERNEL) + + extern void *debug_kmalloc(size_t size, gfp_t flags); + extern void debug_kfree(void *); diff --git a/queue-4.4/mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch b/queue-4.4/mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch new file mode 100644 index 00000000000..097fef8b13b --- /dev/null +++ b/queue-4.4/mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch @@ -0,0 +1,66 @@ +From 8ac7c87acdcac156670f9920c8acbd84308ff4b1 Mon Sep 17 00:00:00 2001 +From: Alexander Lobakin +Date: Sun, 10 Jan 2021 11:56:08 +0000 +Subject: MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section + +From: Alexander Lobakin + +commit 8ac7c87acdcac156670f9920c8acbd84308ff4b1 upstream. + +MIPS uses its own declaration of rwdata, and thus it should be kept +in sync with the asm-generic one. Currently PAGE_ALIGNED_DATA() is +missing from the linker script, which emits the following ld +warnings: + +mips-alpine-linux-musl-ld: warning: orphan section +`.data..page_aligned' from `arch/mips/kernel/vdso.o' being placed +in section `.data..page_aligned' +mips-alpine-linux-musl-ld: warning: orphan section +`.data..page_aligned' from `arch/mips/vdso/vdso-image.o' being placed +in section `.data..page_aligned' + +Add the necessary declaration, so the mentioned structures will be +placed in vmlinux as intended: + +ffffffff80630580 D __end_once +ffffffff80630580 D __start___dyndbg +ffffffff80630580 D __start_once +ffffffff80630580 D __stop___dyndbg +ffffffff80634000 d mips_vdso_data +ffffffff80638000 d vdso_data +ffffffff80638580 D _gp +ffffffff8063c000 T __init_begin +ffffffff8063c000 D _edata +ffffffff8063c000 T _sinittext + +-> + +ffffffff805a4000 D __end_init_task +ffffffff805a4000 D __nosave_begin +ffffffff805a4000 D __nosave_end +ffffffff805a4000 d mips_vdso_data +ffffffff805a8000 d vdso_data +ffffffff805ac000 D mmlist_lock +ffffffff805ac080 D tasklist_lock + +Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") +Signed-off-by: Alexander Lobakin +Reviewed-by: Kees Cook +Reviewed-by: Nathan Chancellor +Cc: stable@vger.kernel.org # 4.4+ +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/kernel/vmlinux.lds.S | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/mips/kernel/vmlinux.lds.S ++++ b/arch/mips/kernel/vmlinux.lds.S +@@ -90,6 +90,7 @@ SECTIONS + + INIT_TASK_DATA(THREAD_SIZE) + NOSAVE_DATA ++ PAGE_ALIGNED_DATA(PAGE_SIZE) + CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) + READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) + DATA_DATA diff --git a/queue-4.4/series b/queue-4.4/series index bb7e743be3f..e9fb6217e4c 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -4,3 +4,5 @@ xen-netback-delete-napi-instance-when-queue-fails-to-initialize.patch ntfs-check-for-valid-standard-information-attribute.patch igb-remove-incorrect-unexpected-sys-wrap-log-message.patch scripts-recordmcount.pl-support-big-endian-for-arch-.patch +kdb-make-memory-allocations-more-robust.patch +mips-vmlinux.lds.s-add-missing-page_aligned_data-section.patch