Re: [PATCH v5 2/2] kallsyms: Don't leak pointers for unresolved symbols

From: Sebastian Andrzej Siewior

Date: Mon Nov 02 2026 - 06:44:33 EST


On 2026-10-27 17:00:12 [+0100], Petr Mladek wrote:
> Both Sashiko and the intel test robot reports that this triggers:
>
> kernel/kallsyms.c: In function '__sprint_symbol':
> >> kernel/kallsyms.c:486:44: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'long unsigned int' [-Wformat=]
> 486 | return sprintf(buffer, "0x%p", address - symbol_offset);
> | ~^ ~~~~~~~~~~~~~~~~~~~~~~~
> | | |
> | void * long unsigned int
> | %ld
>
> So, it should be:
>
> return sprintf(buffer, "0x%p", (void *)(address - symbol_offset));

yes. I do see it locally after double checking. Not sure how I missed
it.

> > offset -= symbol_offset;
>
> Otherwise, it looks good to me. So, with the added cast:
>
> Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>
>
> There is no need to send v6. I could fix this when pushing.
> I am going to wait few more days for potential feedback.
> I will queue it for 7.5 unless anyone complains in the meantime.

Okay, thank you.

> Best Regards,
> Petr

Sebastian