Re: [PATCH] parisc: unwind: Replace open-coded binary search with bsearch()

From: Helge Deller

Date: Tue Sep 15 2026 - 03:43:27 EST


On 9/13/26 16:12, Sean Young wrote:
There is a bug in the binary search where hi can underflow. If
addr is less than the first entry, then "hi = mid - 1" will underflow
to ULONG_MAX. Then we have an out-of-bounds read.

Replace the open-coded binary search with bsearch().

Issue found by an LLM.

Signed-off-by: Sean Young <sean@xxxxxxxx>
---
arch/parisc/kernel/unwind.c | 33 +++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)
Applied.

Thanks!
Helge