Skip to content

Commit

Permalink
Fix "sys [-t]|mod -S" after "mod -t" when crash runs with -s option
Browse files Browse the repository at this point in the history
When crash runs with -s option, SIZE(taint_flag) and OFFSET(tnt_false)
are not set during initialization.  If the "mod -t" option is executed,
it sets the former but does not set the latter.  After that, the "sys"
command uses OFFSET(tnt_false) without setting it, because it checks
only whether SIZE(taint_flag) is set.

Without the patch, the "sys [-t]" and "mod -S" options after "mod -t"
option fail with the error message:

  sys: invalid structure member offset: tnt_false
       FILE: kernel.c  LINE: 11203  FUNCTION: show_kernel_taints_v4_10()

Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
  • Loading branch information
k-hagio committed Jan 25, 2021
1 parent e4c1617 commit 1be446c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel.c
Expand Up @@ -11160,7 +11160,8 @@ show_kernel_taints_v4_10(char *buf, int verbose)
ulong tainted_mask, *tainted_mask_ptr;
struct syment *sp;

if (!VALID_STRUCT(taint_flag)) {
if (!(VALID_STRUCT(taint_flag) &&
VALID_MEMBER(tnt_true) && VALID_MEMBER(tnt_false))) {
STRUCT_SIZE_INIT(taint_flag, "taint_flag");
MEMBER_OFFSET_INIT(tnt_true, "taint_flag", "true");
MEMBER_OFFSET_INIT(tnt_false, "taint_flag", "false");
Expand Down

0 comments on commit 1be446c

Please sign in to comment.