Re: [PATCH 2/2] powerpc/xmon: use KSYM_NAME_LEN in array size

From
Benjamin Gray <hidden>
Date
2023-08-03 05:47:05
Also in
lkml
Reply to
Miguel Ojeda, 2023-05-30
On 30/5/23 10:54 pm, Miguel Ojeda wrote:
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?
I'm not familiar with the kallsyms infrastructure, but looking over the implementations of kallsyms_lookup() and kallsyms_lookup_size_offset() it looks like the existing kallsyms_lookup()
 handles an extra case over kallsyms_lookup_size_offset()?

kallsyms_lookup_buildid() (the implementation of kallsyms_lookup()) has

  /* See if it's in a module or a BPF JITed image. */
  ret = module_address_lookup(addr, symbolsize, offset,
                              modname, modbuildid, namebuf);
  if (!ret)
          ret = bpf_address_lookup(addr, symbolsize,
                                   offset, modname, namebuf);

  if (!ret)
          ret = ftrace_mod_address_lookup(addr, symbolsize,
                                          offset, modname, namebuf);

while kallsyms_lookup_size_offset() is missing the ftrace case

  return !!module_address_lookup(addr, symbolsize, offset,
                                 NULL, NULL, namebuf) ||
         !!__bpf_address_lookup(addr, symbolsize, offset, namebuf);

Might this be a concern for xmon?
Thread (12 messages) 12 messages, 7 authors, last reply 2023-08-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help