Skip to content

Commit

Permalink
Fix for the display of kernel module symbol types by the "sym"
Browse files Browse the repository at this point in the history
command in Linux 5.0 and later kernels if the module debuginfo
data has not been loaded into the crash session.  The st_info member
of the Elf32_Sym or Elf64_Sym structures has changed so as to not
contain ASCII symbol type characters, and as a result the "sym"
command will show unprintable data as the symbol type.  With the
patch, only text types ("t" or "T") will be displayed, and the
symbols others will show "?".
([email protected])
  • Loading branch information
Dave Anderson committed Mar 22, 2019
1 parent 942d813 commit 302396b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,14 @@ Elf32_Sym_to_common(Elf32_Sym *e32, struct elf_common *ec)
ec->st_name = (ulong)e32->st_name;
ec->st_value = (ulong)e32->st_value;
ec->st_shndx = (ulong)e32->st_shndx;
ec->st_info = e32->st_info;
if ((e32->st_info >= ' ') && (e32->st_info < 0x7f))
ec->st_info = e32->st_info;
else if (e32->st_info == 0x02)
ec->st_info = 't';
else if (e32->st_info == 0x12)
ec->st_info = 'T';
else
ec->st_info = '?';
ec->st_size = (ulong)e32->st_size;
}

Expand All @@ -2198,7 +2205,14 @@ Elf64_Sym_to_common(Elf64_Sym *e64, struct elf_common *ec)
ec->st_name = (ulong)e64->st_name;
ec->st_value = (ulong)e64->st_value;
ec->st_shndx = (ulong)e64->st_shndx;
ec->st_info = e64->st_info;
if ((e64->st_info >= ' ') && (e64->st_info < 0x7f))
ec->st_info = e64->st_info;
else if (e64->st_info == 0x02)
ec->st_info = 't';
else if (e64->st_info == 0x12)
ec->st_info = 'T';
else
ec->st_info = '?';
ec->st_size = (ulong)e64->st_size;
}

Expand Down

0 comments on commit 302396b

Please sign in to comment.