Thread (32 messages) 32 messages, 5 authors, 2022-07-03

Re: [PATCH v11 09/14] module: Move kallsyms support into a separate file

From: Aaron Tomlin <hidden>
Date: 2022-07-03 08:33:36
Also in: lkml
Subsystem: module support, the rest · Maintainers: Luis Chamberlain, Petr Pavlu, Daniel Gomez, Sami Tolvanen, Linus Torvalds

On Fri 2022-07-01 15:34 -0700, Luis Chamberlain wrote:
Poke, did you get to implement this yet?
Hi Luis, Steve,

Firstly, apologies for the delay.

I believe I found the issue:
diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c
index 1b0780e20aab..84808706af5c 100644
--- a/kernel/module/kallsyms.c
+++ b/kernel/module/kallsyms.c
@@ -197,7 +197,7 @@ void add_kallsyms(struct module *mod, const struct load_info *info)
                            mod->kallsyms->typetab[i];
                        dst[ndst] = src[i];
                        dst[ndst++].st_name = s - mod->core_kallsyms.strtab;
-                       s += strscpy(s, &mod->kallsyms->strtab[src[i].st_name],
+                       s += strlcpy(s, &mod->kallsyms->strtab[src[i].st_name],
                                     KSYM_NAME_LEN) + 1;
                }
        }
That being said, I need to examine the precise differences between each
implementation; albeit, I believe we can revert this particular change. I
will send a patch for a wider discussion shortly.

 - Before

      $ grep -a -E '^[0-9a-f]{16} [^a-z].*\[virtio_console\]' /proc/kallsyms
      0000000000000000  notifier_del_vio      [virtio_console]
      0000000000000000  show_port_name        [virtio_console]
      0000000000000000  port_debugfs_open     [virtio_console]

 - After the above modification

      $ grep -a -E '^[0-9a-f]{16} [^a-z].*\[virtio_console\]' /proc/kallsyms
      $ grep -a -m 3 -E '^[0-9a-f]{16} [a-z].*\[virtio_console\]' /proc/kallsyms
      0000000000000000 t notifier_del_vio     [virtio_console]
      0000000000000000 t show_port_name       [virtio_console]
      0000000000000000 t port_debugfs_open    [virtio_console]


Kind regards,

-- 
Aaron Tomlin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help