Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ARM: unwinder: fix bisection to find origin in .idx section

The bisection implemented in unwind_find_origin() stopped to early. If
there is only a single entry left to check the original code just took
the end point as origin which might be wrong.

This was introduced in commit de66a979012d ("ARM: 7187/1: fix unwinding
for XIP kernels").

Reported-and-tested-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Uwe Kleine-König and committed by
Linus Torvalds
ddf5a25c 42ebfc61

+2 -2
+2 -2
arch/arm/kernel/unwind.c
··· 160 160 const struct unwind_idx *start, const struct unwind_idx *stop) 161 161 { 162 162 pr_debug("%s(%p, %p)\n", __func__, start, stop); 163 - while (start < stop - 1) { 163 + while (start < stop) { 164 164 const struct unwind_idx *mid = start + ((stop - start) >> 1); 165 165 166 166 if (mid->addr_offset >= 0x40000000) 167 167 /* negative offset */ 168 - start = mid; 168 + start = mid + 1; 169 169 else 170 170 /* positive offset */ 171 171 stop = mid;