Re: [PATCH v1] tracing: Avoid possible signed 64-bit truncation

Steven Rostedt
2026-01-07T19:26:08Z

On Tue, 9 Dec 2025 21:31:35 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> > ---
> > kernel/trace/trace.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index d1e527cf2aae..e6a80cbe9326 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -6057,8 +6057,10 @@ static int cmp_mod_entry(const void *key, const void *pivot)
> >
> > if (addr >= ent[0].mod_addr && addr < ent[1].mod_addr)
> > return 0;
> > + else if (addr > ent->mod_addr)
> > + return 1;
> > else
> > - return addr - ent->mod_addr;
> > + return -1;
>
> Could we still keep this down to a single if check?
>
> if (addr < ent->mod_addr)
> return -1;
>
> return addr >= ent[1].mod_addr;

Care to send a v2?

-- Steve