From 2eadad07aab21897762250ce93f52f631683eae1 Mon Sep 17 00:00:00 2001 From: Dave Anderson Date: Fri, 22 Mar 2019 13:26:44 -0400 Subject: [PATCH] Fix for the "dis " option with kernel module text symbols on Linux 5.0 and later kernels. Without the patch, the disassembly may stop prematurely or extend into the next function because the st_size member of the Elf32_Sym or Elf64_Sym text symbol structures can no longer be used as the function size. (anderson@redhat.com) --- symbols.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/symbols.c b/symbols.c index e2c7abf..decf2c2 100644 --- a/symbols.c +++ b/symbols.c @@ -2986,6 +2986,9 @@ kallsyms_module_function_size(struct syment *sp, struct load_module *lm, ulong * if (!(lm->mod_flags & MOD_KALLSYMS) || !(kt->flags & KALLSYMS_V2)) return FALSE; + if (THIS_KERNEL_VERSION >= LINUX(5,0,0)) /* st_size not useable */ + return FALSE; + module_buf = GETBUF(lm->mod_size); modbuf = module_buf + (lm->module_struct - lm->mod_base);