# Re: \[PATCH 2/2\] powerpc/xmon: use KSYM\_NAME\_LEN in array size

- From: Michael Ellerman \<mpe@ellerman.id.au\>
- Date: 2023-06-01 02:02:30 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2023/06/2216972
- Thread: https://ratatoskr.run/linuxppc-dev/2023/05/2213081/t.md

```text
Miguel Ojeda [ref] writes:
> On Mon, May 29, 2023 at 1:14 PM Maninder Singh [ref] wrote:
>>
>> +static char tmpstr[KSYM_NAME_LEN];
>
> Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
>
> Side-note: in `get_function_bounds()`, I see `kallsyms_lookup()` being
> used, but the name seems discarded? Can
> `kallsyms_lookup_size_offset()` be used instead, thus avoiding the
> usage of the buffer there to begin with?

A few lines below it uses the modname, and AFAICS there's no (easy) way
to lookup the modname without also looking up the name.

> Side-note 2: in `scanhex()`, I see a loop `i<63` using `tmpstr` which
> then is used to do a `kallsyms_lookup_name()`, so I guess symbols
> larger than 64 couldn't be found. I have no idea about what are the
> external constraints here, but perhaps it is possible to increase the
> `line` buffer etc. to then allow for bigger symbols to be found.

Yeah that looks wrong. I don't see any symbols that long in current
kernels, but we should fix it.

Thanks for looking.

cheers
```
