WSL2-Linux-Kernel/arch/arm
Haibo Li 1eae6e9196 ARM: 9295/1: unwind:fix unwind abort for uleb128 case
[ Upstream commit fa3eeb638d ]

When unwind instruction is 0xb2,the subsequent instructions
are uleb128 bytes.
For now,it uses only the first uleb128 byte in code.

For vsp increments of 0x204~0x400,use one uleb128 byte like below:
0xc06a00e4 <unwind_test_work>: 0x80b27fac
  Compact model index: 0
  0xb2 0x7f vsp = vsp + 1024
  0xac      pop {r4, r5, r6, r7, r8, r14}

For vsp increments larger than 0x400,use two uleb128 bytes like below:
0xc06a00e4 <unwind_test_work>: @0xc0cc9e0c
  Compact model index: 1
  0xb2 0x81 0x01 vsp = vsp + 1032
  0xac      pop {r4, r5, r6, r7, r8, r14}
The unwind works well since the decoded uleb128 byte is also 0x81.

For vsp increments larger than 0x600,use two uleb128 bytes like below:
0xc06a00e4 <unwind_test_work>: @0xc0cc9e0c
  Compact model index: 1
  0xb2 0x81 0x02 vsp = vsp + 1544
  0xac      pop {r4, r5, r6, r7, r8, r14}
In this case,the decoded uleb128 result is 0x101(vsp=0x204+(0x101<<2)).
While the uleb128 used in code is 0x81(vsp=0x204+(0x81<<2)).
The unwind aborts at this frame since it gets incorrect vsp.

To fix this,add uleb128 decode to cover all the above case.

Signed-off-by: Haibo Li <haibo.li@mediatek.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-09 10:32:20 +02:00
..
boot ARM: dts: stm32: fix AV96 board SAI2 pin muxing on stm32mp15 2023-05-30 13:55:29 +01:00
common
configs ARM: bcm2835_defconfig: Enable the framebuffer 2023-03-10 09:39:01 +01:00
crypto crypto: blake2s - remove shash module 2022-08-17 14:24:19 +02:00
include ARM: renumber bits related to _TIF_WORK_MASK 2023-01-12 11:59:05 +01:00
kernel ARM: 9295/1: unwind:fix unwind abort for uleb128 case 2023-06-09 10:32:20 +02:00
lib ARM: 9290/1: uaccess: Fix KASAN false-positives 2023-04-20 12:13:54 +02:00
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: at91: pm: avoid soft resetting AC DLL 2022-11-26 09:24:34 +01:00
mach-axxia ARM: Fix refcount leak in axxia_boot_secondary 2022-06-29 09:03:31 +02:00
mach-bcm ARM: bcm: Fix refcount leak in bcm_kona_smc_init 2022-08-17 14:23:06 +02:00
mach-berlin
mach-clps711x
mach-cns3xxx ARM: cns3xxx: Fix refcount leak in cns3xxx_init 2022-06-29 09:03:31 +02:00
mach-davinci ARM: davinci: da850-evm: Avoid NULL pointer dereference 2022-04-20 09:34:20 +02:00
mach-digicolor
mach-dove
mach-ep93xx
mach-exynos ARM: exynos: Fix refcount leak in exynos_map_pmu 2022-06-29 09:03:30 +02:00
mach-footbridge
mach-gemini
mach-highbank
mach-hisi ARM: hisi: Add missing of_node_put after of_find_compatible_node 2022-06-09 10:22:42 +02:00
mach-imx ARM: imx: Call ida_simple_remove() for ida_simple_get 2023-03-10 09:39:01 +01:00
mach-integrator
mach-iop32x ARM: iop32x: offset IRQ numbers by 1 2022-04-08 14:24:11 +02:00
mach-ixp4xx
mach-keystone
mach-lpc18xx
mach-lpc32xx
mach-mediatek arm: mediatek: select arch timer for mt7629 2022-06-09 10:23:07 +02:00
mach-meson ARM: meson: Fix refcount leak in meson_smp_prepare_cpus 2022-07-12 16:35:11 +02:00
mach-milbeaut
mach-mmp ARM: mmp: fix timer_read delay 2022-12-31 13:14:00 +01:00
mach-moxart
mach-mstar ARM: mstar: Select HAVE_ARM_ARCH_TIMER 2022-04-08 14:22:46 +02:00
mach-mv78xx0
mach-mvebu
mach-mxs ARM: mxs: fix memory leak in mxs_machine_init() 2022-12-02 17:41:04 +01:00
mach-nomadik
mach-npcm
mach-nspire
mach-omap1 ARM: OMAP1: call platform_device_put() in error case in omap1_dm_timer_init() 2023-03-10 09:39:01 +01:00
mach-omap2 ARM: OMAP2+: Fix memory leak in realtime_counter_init() 2023-03-10 09:38:57 +01:00
mach-orion5x
mach-oxnas
mach-pxa ARM: pxa: maybe fix gpio lookup tables 2022-06-09 10:23:29 +02:00
mach-qcom
mach-rda
mach-realtek
mach-realview
mach-rockchip
mach-rpc
mach-s3c ARM: s3c: fix s3c64xx_set_timer_source prototype 2023-03-10 09:39:01 +01:00
mach-s5pv210
mach-sa1100 ARM: 9296/1: HP Jornada 7XX: fix kernel-doc warnings 2023-05-24 17:36:41 +01:00
mach-shmobile ARM: shmobile: rcar-gen2: Increase refcount for new reference 2022-08-17 14:23:04 +02:00
mach-socfpga ARM: socfpga: fix missing RESET_CONTROLLER 2022-02-16 12:56:19 +01:00
mach-spear
mach-sti
mach-stm32
mach-sunxi
mach-tegra
mach-uniphier
mach-ux500
mach-versatile
mach-vexpress ARM: versatile: Add missing of_node_put in dcscb_init 2022-06-09 10:22:42 +02:00
mach-vt8500
mach-zynq ARM: zynq: Fix refcount leak in zynq_early_slcr_init 2023-03-10 09:38:58 +01:00
mm ARM: 9280/1: mm: fix warning on phys_addr_t to void pointer assignment 2023-02-01 08:27:25 +01:00
net
nwfpe ARM: 9256/1: NWFPE: avoid compiler-generated __aeabi_uldivmod 2023-01-12 11:58:55 +01:00
plat-omap
plat-orion
plat-pxa
plat-versatile
probes kprobes: treewide: Cleanup the error messages for kprobes 2023-02-22 12:57:00 +01:00
tools
vdso
vfp
xen xen/arm: Fix race in RB-tree based P2M accounting 2022-07-07 17:53:32 +02:00
Kbuild
Kconfig ARM: Drop CMDLINE_* dependency on ATAGS 2022-10-26 12:35:00 +02:00
Kconfig-nommu
Kconfig.assembler
Kconfig.debug ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART 2022-01-27 11:04:29 +01:00
Makefile