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

Steven Rostedt <[email protected]>
Newsgroups org.kernel.vger.linux-toolchains,org.kernel.vger.linux-kernel,org.kernel.vger.linux-perf-users
Message-ID <[email protected]>
On Thu, 7 Nov 2024 17:59:08 +0100
Jens Remus <[email protected]> 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;
> > +
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.