From: Sasha Levin Date: Mon, 16 Aug 2021 02:27:20 +0000 (-0400) Subject: Fixes for 5.13 X-Git-Tag: v5.4.142~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b98d1a35cd7cc078443949d8221efdea299b92d2;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.13 Signed-off-by: Sasha Levin --- diff --git a/queue-5.13/arm64-efi-kaslr-fix-occasional-random-alloc-and-boot.patch b/queue-5.13/arm64-efi-kaslr-fix-occasional-random-alloc-and-boot.patch new file mode 100644 index 00000000000..a38f50e2c19 --- /dev/null +++ b/queue-5.13/arm64-efi-kaslr-fix-occasional-random-alloc-and-boot.patch @@ -0,0 +1,50 @@ +From ab95d2c85fe5c21d6439520381c7ad02eda6db44 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Jul 2021 21:14:05 +1000 +Subject: arm64: efi: kaslr: Fix occasional random alloc (and boot) failure + +From: Benjamin Herrenschmidt + +[ Upstream commit 4152433c397697acc4b02c4a10d17d5859c2730d ] + +The EFI stub random allocator used for kaslr on arm64 has a subtle +bug. In function get_entry_num_slots() which counts the number of +possible allocation "slots" for the image in a given chunk of free +EFI memory, "last_slot" can become negative if the chunk is smaller +than the requested allocation size. + +The test "if (first_slot > last_slot)" doesn't catch it because +both first_slot and last_slot are unsigned. + +I chose not to make them signed to avoid problems if this is ever +used on architectures where there are meaningful addresses with the +top bit set. Instead, fix it with an additional test against the +allocation size. + +This can cause a boot failure in addition to a loss of randomisation +due to another bug in the arm64 stub fixed separately. + +Signed-off-by: Benjamin Herrenschmidt +Fixes: 2ddbfc81eac8 ("efi: stub: add implementation of efi_random_alloc()") +Signed-off-by: Ard Biesheuvel +Signed-off-by: Sasha Levin +--- + drivers/firmware/efi/libstub/randomalloc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/firmware/efi/libstub/randomalloc.c b/drivers/firmware/efi/libstub/randomalloc.c +index a408df474d83..724155b9e10d 100644 +--- a/drivers/firmware/efi/libstub/randomalloc.c ++++ b/drivers/firmware/efi/libstub/randomalloc.c +@@ -30,6 +30,8 @@ static unsigned long get_entry_num_slots(efi_memory_desc_t *md, + + region_end = min(md->phys_addr + md->num_pages * EFI_PAGE_SIZE - 1, + (u64)ULONG_MAX); ++ if (region_end < size) ++ return 0; + + first_slot = round_up(md->phys_addr, align); + last_slot = round_down(region_end - size + 1, align); +-- +2.30.2 + diff --git a/queue-5.13/efi-libstub-arm64-force-image-reallocation-if-bss-wa.patch b/queue-5.13/efi-libstub-arm64-force-image-reallocation-if-bss-wa.patch new file mode 100644 index 00000000000..daf09763624 --- /dev/null +++ b/queue-5.13/efi-libstub-arm64-force-image-reallocation-if-bss-wa.patch @@ -0,0 +1,101 @@ +From 8043efd0b15838a5cede89f89faf627b22446df7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Jul 2021 11:38:41 +0200 +Subject: efi/libstub: arm64: Force Image reallocation if BSS was not reserved + +From: Ard Biesheuvel + +[ Upstream commit 5b94046efb4706b3429c9c8e7377bd8d1621d588 ] + +Distro versions of GRUB replace the usual LoadImage/StartImage calls +used to load the kernel image with some local code that fails to honor +the allocation requirements described in the PE/COFF header, as it +does not account for the image's BSS section at all: it fails to +allocate space for it, and fails to zero initialize it. + +Since the EFI stub itself is allocated in the .init segment, which is +in the middle of the image, its BSS section is not impacted by this, +and the main consequence of this omission is that the BSS section may +overlap with memory regions that are already used by the firmware. + +So let's warn about this condition, and force image reallocation to +occur in this case, which works around the problem. + +Fixes: 82046702e288 ("efi/libstub/arm64: Replace 'preferred' offset with alignment check") +Signed-off-by: Ard Biesheuvel +Tested-by: Benjamin Herrenschmidt +Signed-off-by: Sasha Levin +--- + drivers/firmware/efi/libstub/arm64-stub.c | 49 ++++++++++++++++++++++- + 1 file changed, 48 insertions(+), 1 deletion(-) + +diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c +index 7bf0a7acae5e..3698c1ce2940 100644 +--- a/drivers/firmware/efi/libstub/arm64-stub.c ++++ b/drivers/firmware/efi/libstub/arm64-stub.c +@@ -34,6 +34,51 @@ efi_status_t check_platform_features(void) + return EFI_SUCCESS; + } + ++/* ++ * Distro versions of GRUB may ignore the BSS allocation entirely (i.e., fail ++ * to provide space, and fail to zero it). Check for this condition by double ++ * checking that the first and the last byte of the image are covered by the ++ * same EFI memory map entry. ++ */ ++static bool check_image_region(u64 base, u64 size) ++{ ++ unsigned long map_size, desc_size, buff_size; ++ efi_memory_desc_t *memory_map; ++ struct efi_boot_memmap map; ++ efi_status_t status; ++ bool ret = false; ++ int map_offset; ++ ++ map.map = &memory_map; ++ map.map_size = &map_size; ++ map.desc_size = &desc_size; ++ map.desc_ver = NULL; ++ map.key_ptr = NULL; ++ map.buff_size = &buff_size; ++ ++ status = efi_get_memory_map(&map); ++ if (status != EFI_SUCCESS) ++ return false; ++ ++ for (map_offset = 0; map_offset < map_size; map_offset += desc_size) { ++ efi_memory_desc_t *md = (void *)memory_map + map_offset; ++ u64 end = md->phys_addr + md->num_pages * EFI_PAGE_SIZE; ++ ++ /* ++ * Find the region that covers base, and return whether ++ * it covers base+size bytes. ++ */ ++ if (base >= md->phys_addr && base < end) { ++ ret = (base + size) <= end; ++ break; ++ } ++ } ++ ++ efi_bs_call(free_pool, memory_map); ++ ++ return ret; ++} ++ + /* + * Although relocatable kernels can fix up the misalignment with respect to + * MIN_KIMG_ALIGN, the resulting virtual text addresses are subtly out of +@@ -92,7 +137,9 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, + } + + if (status != EFI_SUCCESS) { +- if (IS_ALIGNED((u64)_text, min_kimg_align())) { ++ if (!check_image_region((u64)_text, kernel_memsize)) { ++ efi_err("FIRMWARE BUG: Image BSS overlaps adjacent EFI memory region\n"); ++ } else if (IS_ALIGNED((u64)_text, min_kimg_align())) { + /* + * Just execute from wherever we were loaded by the + * UEFI PE/COFF loader if the alignment is suitable. +-- +2.30.2 + diff --git a/queue-5.13/efi-libstub-arm64-relax-2m-alignment-again-for-reloc.patch b/queue-5.13/efi-libstub-arm64-relax-2m-alignment-again-for-reloc.patch new file mode 100644 index 00000000000..8b3cf5e5270 --- /dev/null +++ b/queue-5.13/efi-libstub-arm64-relax-2m-alignment-again-for-reloc.patch @@ -0,0 +1,103 @@ +From 290a182b8bf9442ce801b5c4402e66f635771ddf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Jul 2021 12:10:31 +0200 +Subject: efi/libstub: arm64: Relax 2M alignment again for relocatable kernels + +From: Ard Biesheuvel + +[ Upstream commit 3a262423755b83a5f85009ace415d6e7f572dfe8 ] + +Commit 82046702e288 ("efi/libstub/arm64: Replace 'preferred' offset with +alignment check") simplified the way the stub moves the kernel image +around in memory before booting it, given that a relocatable image does +not need to be copied to a 2M aligned offset if it was loaded on a 64k +boundary by EFI. + +Commit d32de9130f6c ("efi/arm64: libstub: Deal gracefully with +EFI_RNG_PROTOCOL failure") inadvertently defeated this logic by +overriding the value of efi_nokaslr if EFI_RNG_PROTOCOL is not +available, which was mistaken by the loader logic as an explicit request +on the part of the user to disable KASLR and any associated relocation +of an Image not loaded on a 2M boundary. + +So let's reinstate this functionality, by capturing the value of +efi_nokaslr at function entry to choose the minimum alignment. + +Fixes: d32de9130f6c ("efi/arm64: libstub: Deal gracefully with EFI_RNG_PROTOCOL failure") +Signed-off-by: Ard Biesheuvel +Tested-by: Benjamin Herrenschmidt +Signed-off-by: Sasha Levin +--- + drivers/firmware/efi/libstub/arm64-stub.c | 28 +++++++++++------------ + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c +index 3698c1ce2940..6f214c9c303e 100644 +--- a/drivers/firmware/efi/libstub/arm64-stub.c ++++ b/drivers/firmware/efi/libstub/arm64-stub.c +@@ -79,18 +79,6 @@ static bool check_image_region(u64 base, u64 size) + return ret; + } + +-/* +- * Although relocatable kernels can fix up the misalignment with respect to +- * MIN_KIMG_ALIGN, the resulting virtual text addresses are subtly out of +- * sync with those recorded in the vmlinux when kaslr is disabled but the +- * image required relocation anyway. Therefore retain 2M alignment unless +- * KASLR is in use. +- */ +-static u64 min_kimg_align(void) +-{ +- return efi_nokaslr ? MIN_KIMG_ALIGN : EFI_KIMG_ALIGN; +-} +- + efi_status_t handle_kernel_image(unsigned long *image_addr, + unsigned long *image_size, + unsigned long *reserve_addr, +@@ -101,6 +89,16 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, + unsigned long kernel_size, kernel_memsize = 0; + u32 phys_seed = 0; + ++ /* ++ * Although relocatable kernels can fix up the misalignment with ++ * respect to MIN_KIMG_ALIGN, the resulting virtual text addresses are ++ * subtly out of sync with those recorded in the vmlinux when kaslr is ++ * disabled but the image required relocation anyway. Therefore retain ++ * 2M alignment if KASLR was explicitly disabled, even if it was not ++ * going to be activated to begin with. ++ */ ++ u64 min_kimg_align = efi_nokaslr ? MIN_KIMG_ALIGN : EFI_KIMG_ALIGN; ++ + if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) { + if (!efi_nokaslr) { + status = efi_get_random_bytes(sizeof(phys_seed), +@@ -130,7 +128,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, + * If KASLR is enabled, and we have some randomness available, + * locate the kernel at a randomized offset in physical memory. + */ +- status = efi_random_alloc(*reserve_size, min_kimg_align(), ++ status = efi_random_alloc(*reserve_size, min_kimg_align, + reserve_addr, phys_seed); + } else { + status = EFI_OUT_OF_RESOURCES; +@@ -139,7 +137,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, + if (status != EFI_SUCCESS) { + if (!check_image_region((u64)_text, kernel_memsize)) { + efi_err("FIRMWARE BUG: Image BSS overlaps adjacent EFI memory region\n"); +- } else if (IS_ALIGNED((u64)_text, min_kimg_align())) { ++ } else if (IS_ALIGNED((u64)_text, min_kimg_align)) { + /* + * Just execute from wherever we were loaded by the + * UEFI PE/COFF loader if the alignment is suitable. +@@ -150,7 +148,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, + } + + status = efi_allocate_pages_aligned(*reserve_size, reserve_addr, +- ULONG_MAX, min_kimg_align()); ++ ULONG_MAX, min_kimg_align); + + if (status != EFI_SUCCESS) { + efi_err("Failed to relocate kernel\n"); +-- +2.30.2 + diff --git a/queue-5.13/i2c-iproc-fix-race-between-client-unreg-and-tasklet.patch b/queue-5.13/i2c-iproc-fix-race-between-client-unreg-and-tasklet.patch new file mode 100644 index 00000000000..14a62414e08 --- /dev/null +++ b/queue-5.13/i2c-iproc-fix-race-between-client-unreg-and-tasklet.patch @@ -0,0 +1,122 @@ +From c7ad3d80f5c657b01428db96b834fd4b0074618e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 5 Aug 2021 14:49:05 -0700 +Subject: i2c: iproc: fix race between client unreg and tasklet + +From: Dhananjay Phadke + +[ Upstream commit bba676cc0b6122a74fa2e246f38a6b05c6f95b36 ] + +Similar NULL deref was originally fixed by graceful teardown sequence - + +https://lore.kernel.org/linux-i2c/1597106560-79693-1-git-send-email-dphadke@linux.microsoft.com + +After this, a tasklet was added to take care of FIFO full condition for large i2c +transaction. + +https://lore.kernel.org/linux-arm-kernel/20201102035433.6774-1-rayagonda.kokatanur@broadcom.com/ + +This introduced regression, a new race condition between tasklet enabling +interrupts and client unreg teardown sequence. + +Kill tasklet before unreg_slave() masks bits in IE_OFFSET. +Updated teardown sequence - +(1) disable_irq() +(2) Kill tasklet +(3) Mask event enable bits in control reg +(4) Erase slave address (avoid further writes to rx fifo) +(5) Flush tx and rx FIFOs +(6) Clear pending event (interrupt) bits in status reg +(7) Set client pointer to NULL +(8) enable_irq() + + -- + + Unable to handle kernel read from unreadable memory at virtual address 0000000000000320 + Mem abort info: + ESR = 0x96000004 + EC = 0x25: DABT (current EL), IL = 32 bits + SET = 0, FnV = 0 + EA = 0, S1PTW = 0 + Data abort info: + ISV = 0, ISS = 0x00000004 + CM = 0, WnR = 0 + user pgtable: 4k pages, 48-bit VAs, pgdp=000000009212a000 + [0000000000000320] pgd=0000000000000000, p4d=0000000000000000 + Internal error: Oops: 96000004 [#1] SMP + CPU: 0 PID: 0 Comm: swapper/0 Tainted: G O + Hardware name: Overlake (DT) + pstate: 40400085 (nZcv daIf +PAN -UAO -TCO BTYPE=--) + pc : bcm_iproc_i2c_slave_isr+0x2b8/0x8e4 + lr : bcm_iproc_i2c_slave_isr+0x1c8/0x8e4 + sp : ffff800010003e70 + x29: ffff800010003e80 x28: ffffda017acdc000 + x27: ffffda017b0ae000 x26: ffff800010004000 + x25: ffff800010000000 x24: ffffda017af4a168 + x23: 0000000000000073 x22: 0000000000000000 + x21: 0000000001400000 x20: 0000000001000000 + x19: ffff06f09583f880 x18: 00000000fa83b2da + x17: 000000000000b67e x16: 0000000002edb2f3 + x15: 00000000000002c7 x14: 00000000000002c7 + x13: 0000000000000006 x12: 0000000000000033 + x11: 0000000000000000 x10: 0000000001000000 + x9 : 0000000003289312 x8 : 0000000003289311 + x7 : 02d0cd03a303adbc x6 : 02d18e7f0a4dfc6c + x5 : 02edb2f33f76ea68 x4 : 00000000fa83b2da + x3 : ffffda017af43cd0 x2 : ffff800010003e74 + x1 : 0000000001400000 x0 : 0000000000000000 + Call trace: + bcm_iproc_i2c_slave_isr+0x2b8/0x8e4 + bcm_iproc_i2c_isr+0x178/0x290 + __handle_irq_event_percpu+0xd0/0x200 + handle_irq_event+0x60/0x1a0 + handle_fasteoi_irq+0x130/0x220 + __handle_domain_irq+0x8c/0xcc + gic_handle_irq+0xc0/0x120 + el1_irq+0xcc/0x180 + finish_task_switch+0x100/0x1d8 + __schedule+0x61c/0x7a0 + schedule_idle+0x28/0x44 + do_idle+0x254/0x28c + cpu_startup_entry+0x28/0x2c + rest_init+0xc4/0xd0 + arch_call_rest_init+0x14/0x1c + start_kernel+0x33c/0x3b8 + Code: f9423260 910013e2 11000509 b9047a69 (f9419009) + ---[ end trace 4781455b2a7bec15 ]--- + +Fixes: 4d658451c9d6 ("i2c: iproc: handle rx fifo full interrupt") + +Signed-off-by: Dhananjay Phadke +Acked-by: Ray Jui +Acked-by: Rayagonda Kokatanur +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-bcm-iproc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c +index cceaf69279a9..6304d1dd2dd6 100644 +--- a/drivers/i2c/busses/i2c-bcm-iproc.c ++++ b/drivers/i2c/busses/i2c-bcm-iproc.c +@@ -1224,14 +1224,14 @@ static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave) + + disable_irq(iproc_i2c->irq); + ++ tasklet_kill(&iproc_i2c->slave_rx_tasklet); ++ + /* disable all slave interrupts */ + tmp = iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET); + tmp &= ~(IE_S_ALL_INTERRUPT_MASK << + IE_S_ALL_INTERRUPT_SHIFT); + iproc_i2c_wr_reg(iproc_i2c, IE_OFFSET, tmp); + +- tasklet_kill(&iproc_i2c->slave_rx_tasklet); +- + /* Erase the slave address programmed */ + tmp = iproc_i2c_rd_reg(iproc_i2c, S_CFG_SMBUS_ADDR_OFFSET); + tmp &= ~BIT(S_CFG_EN_NIC_SMB_ADDR3_SHIFT); +-- +2.30.2 + diff --git a/queue-5.13/kvm-arm64-fix-off-by-one-in-range_is_memory.patch b/queue-5.13/kvm-arm64-fix-off-by-one-in-range_is_memory.patch new file mode 100644 index 00000000000..65a85d8a57f --- /dev/null +++ b/queue-5.13/kvm-arm64-fix-off-by-one-in-range_is_memory.patch @@ -0,0 +1,41 @@ +From 165594c921235da99eff5a39e0887d6fb774da4b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Jul 2021 15:32:31 +0000 +Subject: KVM: arm64: Fix off-by-one in range_is_memory + +From: David Brazdil + +[ Upstream commit facee1be7689f8cf573b9ffee6a5c28ee193615e ] + +Hyp checks whether an address range only covers RAM by checking the +start/endpoints against a list of memblock_region structs. However, +the endpoint here is exclusive but internally is treated as inclusive. +Fix the off-by-one error that caused valid address ranges to be +rejected. + +Cc: Quentin Perret +Fixes: 90134ac9cabb6 ("KVM: arm64: Protect the .hyp sections from the host") +Signed-off-by: David Brazdil +Signed-off-by: Marc Zyngier +Link: https://lore.kernel.org/r/20210728153232.1018911-2-dbrazdil@google.com +Signed-off-by: Sasha Levin +--- + arch/arm64/kvm/hyp/nvhe/mem_protect.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/kvm/hyp/nvhe/mem_protect.c b/arch/arm64/kvm/hyp/nvhe/mem_protect.c +index 4b60c0056c04..fa1b77fe629d 100644 +--- a/arch/arm64/kvm/hyp/nvhe/mem_protect.c ++++ b/arch/arm64/kvm/hyp/nvhe/mem_protect.c +@@ -190,7 +190,7 @@ static bool range_is_memory(u64 start, u64 end) + { + struct kvm_mem_range r1, r2; + +- if (!find_mem_range(start, &r1) || !find_mem_range(end, &r2)) ++ if (!find_mem_range(start, &r1) || !find_mem_range(end - 1, &r2)) + return false; + if (r1.start != r2.start) + return false; +-- +2.30.2 + diff --git a/queue-5.13/powerpc-kprobes-fix-kprobe-oops-happens-in-booke.patch b/queue-5.13/powerpc-kprobes-fix-kprobe-oops-happens-in-booke.patch new file mode 100644 index 00000000000..54625724fa0 --- /dev/null +++ b/queue-5.13/powerpc-kprobes-fix-kprobe-oops-happens-in-booke.patch @@ -0,0 +1,82 @@ +From 05eebd4b35c4589215e9f5870340210e83a28909 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 9 Aug 2021 10:36:58 +0800 +Subject: powerpc/kprobes: Fix kprobe Oops happens in booke + +From: Pu Lehui + +[ Upstream commit 43e8f76006592cb1573a959aa287c45421066f9c ] + +When using kprobe on powerpc booke series processor, Oops happens +as show bellow: + +/ # echo "p:myprobe do_nanosleep" > /sys/kernel/debug/tracing/kprobe_events +/ # echo 1 > /sys/kernel/debug/tracing/events/kprobes/myprobe/enable +/ # sleep 1 +[ 50.076730] Oops: Exception in kernel mode, sig: 5 [#1] +[ 50.077017] BE PAGE_SIZE=4K SMP NR_CPUS=24 QEMU e500 +[ 50.077221] Modules linked in: +[ 50.077462] CPU: 0 PID: 77 Comm: sleep Not tainted 5.14.0-rc4-00022-g251a1524293d #21 +[ 50.077887] NIP: c0b9c4e0 LR: c00ebecc CTR: 00000000 +[ 50.078067] REGS: c3883de0 TRAP: 0700 Not tainted (5.14.0-rc4-00022-g251a1524293d) +[ 50.078349] MSR: 00029000 CR: 24000228 XER: 20000000 +[ 50.078675] +[ 50.078675] GPR00: c00ebdf0 c3883e90 c313e300 c3883ea0 00000001 00000000 c3883ecc 00000001 +[ 50.078675] GPR08: c100598c c00ea250 00000004 00000000 24000222 102490c2 bff4180c 101e60d4 +[ 50.078675] GPR16: 00000000 102454ac 00000040 10240000 10241100 102410f8 10240000 00500000 +[ 50.078675] GPR24: 00000002 00000000 c3883ea0 00000001 00000000 0000c350 3b9b8d50 00000000 +[ 50.080151] NIP [c0b9c4e0] do_nanosleep+0x0/0x190 +[ 50.080352] LR [c00ebecc] hrtimer_nanosleep+0x14c/0x1e0 +[ 50.080638] Call Trace: +[ 50.080801] [c3883e90] [c00ebdf0] hrtimer_nanosleep+0x70/0x1e0 (unreliable) +[ 50.081110] [c3883f00] [c00ec004] sys_nanosleep_time32+0xa4/0x110 +[ 50.081336] [c3883f40] [c001509c] ret_from_syscall+0x0/0x28 +[ 50.081541] --- interrupt: c00 at 0x100a4d08 +[ 50.081749] NIP: 100a4d08 LR: 101b5234 CTR: 00000003 +[ 50.081931] REGS: c3883f50 TRAP: 0c00 Not tainted (5.14.0-rc4-00022-g251a1524293d) +[ 50.082183] MSR: 0002f902 CR: 24000222 XER: 00000000 +[ 50.082457] +[ 50.082457] GPR00: 000000a2 bf980040 1024b4d0 bf980084 bf980084 64000000 00555345 fefefeff +[ 50.082457] GPR08: 7f7f7f7f 101e0000 00000069 00000003 28000422 102490c2 bff4180c 101e60d4 +[ 50.082457] GPR16: 00000000 102454ac 00000040 10240000 10241100 102410f8 10240000 00500000 +[ 50.082457] GPR24: 00000002 bf9803f4 10240000 00000000 00000000 100039e0 00000000 102444e8 +[ 50.083789] NIP [100a4d08] 0x100a4d08 +[ 50.083917] LR [101b5234] 0x101b5234 +[ 50.084042] --- interrupt: c00 +[ 50.084238] Instruction dump: +[ 50.084483] 4bfffc40 60000000 60000000 60000000 9421fff0 39400402 914200c0 38210010 +[ 50.084841] 4bfffc20 00000000 00000000 00000000 <7fe00008> 7c0802a6 7c892378 93c10048 +[ 50.085487] ---[ end trace f6fffe98e2fa8f3e ]--- +[ 50.085678] +Trace/breakpoint trap + +There is no real mode for booke arch and the MMU translation is +always on. The corresponding MSR_IS/MSR_DS bit in booke is used +to switch the address space, but not for real mode judgment. + +Fixes: 21f8b2fa3ca5 ("powerpc/kprobes: Ignore traps that happened in real mode") +Signed-off-by: Pu Lehui +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20210809023658.218915-1-pulehui@huawei.com +Signed-off-by: Sasha Levin +--- + arch/powerpc/kernel/kprobes.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c +index e8c2a6373157..00fafc8b249e 100644 +--- a/arch/powerpc/kernel/kprobes.c ++++ b/arch/powerpc/kernel/kprobes.c +@@ -276,7 +276,8 @@ int kprobe_handler(struct pt_regs *regs) + if (user_mode(regs)) + return 0; + +- if (!(regs->msr & MSR_IR) || !(regs->msr & MSR_DR)) ++ if (!IS_ENABLED(CONFIG_BOOKE) && ++ (!(regs->msr & MSR_IR) || !(regs->msr & MSR_DR))) + return 0; + + /* +-- +2.30.2 + diff --git a/queue-5.13/series b/queue-5.13/series index 997dcae5399..e1fe536d413 100644 --- a/queue-5.13/series +++ b/queue-5.13/series @@ -111,3 +111,10 @@ drm-i915-only-access-sfc_done-when-media-domain-is-n.patch xen-events-fix-race-in-set_evtchn_to_irq.patch vsock-virtio-avoid-potential-deadlock-when-vsock-dev.patch nbd-aovid-double-completion-of-a-request.patch +arm64-efi-kaslr-fix-occasional-random-alloc-and-boot.patch +kvm-arm64-fix-off-by-one-in-range_is_memory.patch +efi-libstub-arm64-force-image-reallocation-if-bss-wa.patch +efi-libstub-arm64-relax-2m-alignment-again-for-reloc.patch +powerpc-kprobes-fix-kprobe-oops-happens-in-booke.patch +i2c-iproc-fix-race-between-client-unreg-and-tasklet.patch +x86-tools-fix-objdump-version-check-again.patch diff --git a/queue-5.13/x86-tools-fix-objdump-version-check-again.patch b/queue-5.13/x86-tools-fix-objdump-version-check-again.patch new file mode 100644 index 00000000000..aba055aa301 --- /dev/null +++ b/queue-5.13/x86-tools-fix-objdump-version-check-again.patch @@ -0,0 +1,42 @@ +From 2bebb0f91caeed8671501f494f027c521497a0de Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 30 Jul 2021 17:01:46 -0700 +Subject: x86/tools: Fix objdump version check again + +From: Randy Dunlap + +[ Upstream commit 839ad22f755132838f406751439363c07272ad87 ] + +Skip (omit) any version string info that is parenthesized. + +Warning: objdump version 15) is older than 2.19 +Warning: Skipping posttest. + +where 'objdump -v' says: +GNU objdump (GNU Binutils; SUSE Linux Enterprise 15) 2.35.1.20201123-7.18 + +Fixes: 8bee738bb1979 ("x86: Fix objdump version check in chkobjdump.awk for different formats.") +Signed-off-by: Randy Dunlap +Signed-off-by: Thomas Gleixner +Reviewed-by: Masami Hiramatsu +Link: https://lore.kernel.org/r/20210731000146.2720-1-rdunlap@infradead.org +Signed-off-by: Sasha Levin +--- + arch/x86/tools/chkobjdump.awk | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/tools/chkobjdump.awk b/arch/x86/tools/chkobjdump.awk +index fd1ab80be0de..a4cf678cf5c8 100644 +--- a/arch/x86/tools/chkobjdump.awk ++++ b/arch/x86/tools/chkobjdump.awk +@@ -10,6 +10,7 @@ BEGIN { + + /^GNU objdump/ { + verstr = "" ++ gsub(/\(.*\)/, ""); + for (i = 3; i <= NF; i++) + if (match($(i), "^[0-9]")) { + verstr = $(i); +-- +2.30.2 +