Re: [PATCH v3 09/19] unwind: Introduce sframe user space unwinding

From: Steven Rostedt
Date: Wed Nov 13 2024 - 15:50:36 EST


On Thu, 7 Nov 2024 17:59:08 +0100
Jens Remus <jremus@xxxxxxxxxxxxx> wrote:

> On 28.10.2024 22:47, Josh Poimboeuf wrote:
> ...
> > diff --git a/kernel/unwind/sframe.c b/kernel/unwind/sframe.c
> ...
> > +static int find_fde(struct sframe_section *sec, unsigned long ip,
> > + struct sframe_fde *fde)
> > +{
> > + struct sframe_fde __user *first, *last, *found = NULL;
> > + u32 ip_off, func_off_low = 0, func_off_high = -1;
> > +
> > + ip_off = ip - sec->sframe_addr;
> > +
> > + first = (void __user *)sec->fdes_addr;
> > + last = first + sec->fdes_nr;
>
> Could it be that this needs to be:
>
> last = first + sec->fdes_nr - 1;

Yep, I discovered the same issue.

-- Steve

>
> > + while (first <= last) {
> > + struct sframe_fde __user *mid;
> > + u32 func_off;
> > +