Fix for the "dis <function>" 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)
This commit is contained in:
Dave Anderson 2019-03-22 13:26:44 -04:00
parent b0b3ef2eda
commit 2eadad07aa

View File

@ -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);