Re: [PATCH] crash: Show module taint flags via cmd_mod

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> Hi Dave, et al,
> 
> 
> Example output:
> 
> crash> mod
>      MODULE       NAME                  TAINT           SIZE  OBJECT
>      FILE
> ffffffffa0008ee0  scsi_transport_iscsi  (PFUT)         57491  (not loaded)  [CONFIG_KALLSYMS]
> ffffffffa0021020  libiscsi                             50543  (not loaded)  [CONFIG_KALLSYMS]
> ffffffffa0055a20  qla4xxx               (U)           221130  (not loaded)  [CONFIG_KALLSYMS]
> ffffffffa0060160  video                                18992  (not loaded)  [CONFIG_KALLSYMS]
> ffffffffa0065000  mdio                                 13436  (not loaded)  [CONFIG_KALLSYMS]
> ffffffffa006c000  libiscsi_tcp          (T)            24177  (not loaded)  [CONFIG_KALLSYMS]
> ffffffffa007c040  libcxgbi                             56493  (not loaded)  [CONFIG_KALLSYMS]
> ...
> 
> Any thoughts?
> 
> Regards,
> 
> Aaron
> 

Well, the concept is interesting, especially for us enterprise-types, but I 
have to say that I don't think too much of the patch as-is...

First, I prefer to avoid hardwiring codes like this if at all possible:

 --- defs.h.org  2013-02-14 20:38:54.000000000 +0000
 +++ defs.h      2013-03-15 16:36:16.505726642 +0000
 @@ -177,6 +177,17 @@
  };
 
  /*
 + * Module taint flags
 + */
 +
 +#define TAINT_PROPRIETARY_MODULE        0
 +#define TAINT_FORCED_MODULE             1
 +#define TAINT_UNSIGNED_MODULE           6
 +#define TAINT_CRAP                     10
 +#define TAINT_OOT_MODULE               12
 +#define TAINT_TECH_PREVIEW             29
 +
 +/*
   *  program_context flags
   */
  #define LIVE_SYSTEM                 (0x1ULL)
 
Although, there's probably no way around it.  And if they've changed
over kernel-version time, that's even worse.

Secondly, I prefer to keep the mod command output line at 80 columns 
or less prior to loading the debuginfo object files.

For example, on my Fedora 17 machine, it looks like this, with an 80-column
line shown in comparison:

12345678901234567890123456789012345678901234567890123456789012345678901234567890

crash> mod
     MODULE       NAME                     SIZE  OBJECT FILE
ffffffffa0008ee0  scsi_transport_iscsi    57491  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa00125c0  iscsi_boot_sysfs        15642  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0021020  libiscsi                50543  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0055a20  qla4xxx                221130  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0060160  video                   18992  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0065000  mdio                    13436  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa006c000  libiscsi_tcp            24177  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa007c040  libcxgbi                56493  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa00a0860  cxgb3                  155602  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa00ab320  uio                     19045  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa00b88c0  cxgb3i                  32951  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa00d31a0  cxgb4                  113494  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa00dfa60  cxgb4i                  32880  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa00f1180  cnic                    66882  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0100440  bnx2i                   54715  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0106000  i2c_algo_bit            13258  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa011d3c0  be2iscsi                93412  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0124240  wmi                     18698  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0153ea0  sunrpc                 255581  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa016a1a0  sdhci_pci               18661  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0173340  ghash_clmulni_intel     13260  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0178020  soundcore               14492  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0181600  i2c_core                38354  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0189060  uinput                  17615  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa01be0e0  drm                    264190  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa01d52a0  drm_kms_helper          44759  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa024fa00  i915                   567858  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0297a00  e1000e                 240492  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa02a5280  macvtap                 18241  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa02ac0c0  macvlan                 18732  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa02c3be0  mmc_core               106983  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa02d34a0  sdhci                   37836  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa02db320  tun                     22939  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa02e1180  crc32c_intel            12902  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0336e00  kvm                    431794  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0355600  vhost_net               33860  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa035c3a0  microcode               23449  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0363380  rfkill                  21737  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0385420  kvm_intel              132720  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa038e040  mfd_core                13183  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0393000  iTCO_vendor_support     13420  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0398120  coretemp                13394  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa03c54e0  cfg80211               201717  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa03d3d60  lpc_ich                 17062  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa03d9040  snd_page_alloc          18269  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa03f0240  iwlwifi                103188  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0405180  mei                     75354  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0410080  snd_timer               28691  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa04161a0  iTCO_wdt                13481  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa041b060  snd_seq_device          14137  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa042d2c0  snd                     79380  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa04382e0  i2c_i801                18135  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0449180  thinkpad_acpi           79359  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa04b93c0  mac80211               540054  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa05080e0  iwldvm                 241608  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa05140c0  media                   20445  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0519080  videobuf2_memops        13391  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa052e540  snd_pcm                 98005  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0541280  snd_seq                 64878  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0549060  snd_hwdep               17651  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa054f240  arc4                    12616  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0568ec0  videodev               120901  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0573060  videobuf2_vmalloc       12968  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0580000  videobuf2_core          34281  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa059b260  snd_hda_codec          131731  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa05ad020  snd_hda_codec_hdmi      36749  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa05b85e0  snd_hda_intel           37938  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa05be080  xt_state                12579  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa05d0e40  snd_hda_codec_realtek   78233  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa05e7ee0  uvcvideo                80925  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa05fa7a0  nf_conntrack            84256  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0607240  ip6_tables              26943  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa060d2a0  iscsi_tcp               18334  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0616060  ip6table_filter         12816  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa061c4a0  nf_defrag_ipv6          18206  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0625060  nf_defrag_ipv4          12674  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0633e60  ib_core                 74065  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa063f460  nf_conntrack_ipv6       18624  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0647520  nf_conntrack_ipv4       14809  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa064c0e0  ib_addr                 13786  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa06541a0  ip6t_REJECT             12940  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0660060  ib_mad                  46341  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa066a080  ib_sa                   32956  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa067a300  ib_cm                   41726  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0681000  iw_cm                   18222  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa068c0a0  rdma_cm                 42167  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa06920e0  llc                     14046  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa06d15a0  bluetooth              319586  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa06ec2a0  ib_iser                 37806  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa06f20c0  stp                     12869  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa06f8660  bnep                    19702  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa070c800  lockd                   93438  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0723f20  bridge                  91098  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa072d080  xt_CHECKSUM             12550  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0736040  iptable_mangle          12696  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa073d380  nf_nat                  25642  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0743180  iptable_nat             13012  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0748000  nf_nat_ipv4             13200  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa074d120  ipt_MASQUERADE          12881  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0756180  ebtables                30758  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa075f260  ebtable_nat             12808  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0771180  fuse                    78033  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0779080  dns_resolver            13097  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0788360  fscache                 55156  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa07ad920  nfs                    169253  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa07c0000  nfs_acl                 12742  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa07c5140  crash                   12577  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa07d12c0  auth_rpcgss             48595  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0809420  nfsv4                  238218  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa081e640  nfsv3                   39243  (not loaded)  [CONFIG_KALLSYMS]
crash> 

And if I run your patch on my Fedora 17 machine, not only does it extend the
output, it wastes a bunch of line space, but most unfortunately, it ends up just 
showing the first module.  What's happening there?:

crash> mod
     MODULE       NAME                 TAINT           SIZE  OBJECT FILE
ffffffffa0008ee0  scsi_transport_iscsi                57491  (not loaded)  [CONFIG_KALLSYMS]
crash>

On a Fedora 15 kernel, it shows only 5 of the 28 modules:

crash> mod
     MODULE       NAME            TAINT           SIZE  OBJECT FILE
ffffffffa0003cd0  i2c_core                       25468  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa00091f0  mperf                           1505  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa000fd10  i2c_algo_bit                    4950  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0013790  freq_table                      3963  (not loaded)  [CONFIG_KALLSYMS]
ffffffffa0038520  drm                           187648  (not loaded)  [CONFIG_KALLSYMS]
crash>

On a 2.6.30 system, just one module again:

crash> mod
     MODULE       NAME              TAINT           SIZE  OBJECT FILE
ffffffffa0007e00  ehci_hcd                         32772  (not loaded)  [CONFIG_KALLSYMS]
crash>

On RHEL5 system, it shows a garbage graphics character, and if I
transpose it into this file, it's looks like it's trying to display
a ^P character?:

crash> mod
     MODULE       NAME             TAINT            SIZE  OBJECT FILE
ffffffff88007e80  ehci_hcd         ^P               65741  (not loaded)  [CONFIG_KALLSYMS]
ffffffff88017800  ohci_hcd         ^P               55925  (not loaded)  [CONFIG_KALLSYMS]
ffffffff88026e00  uhci_hcd         ^P               57433  (not loaded)  [CONFIG_KALLSYMS]
ffffffff8803fd80  jbd              ^P               94257  (not loaded)  [CONFIG_KALLSYMS]
ffffffff8806ae00  ext3             ^P              168017  (not loaded)  [CONFIG_KALLSYMS]
ffffffff88077c80  megaraid_mm      ^P               44793  (not loaded)  [CONFIG_KALLSYMS]
ffffffff880a8a80  scsi_mod         ^P              196569  (not loaded)  [CONFIG_KALLSYMS]
ffffffff880b7a00  sd_mod           ^P               56385  (not loaded)  [CONFIG_KALLSYMS]
ffffffff880c8f00  megaraid_mbox    ^P               65873  (not loaded)  [CONFIG_KALLSYMS]
...

On RHEL5 Xen kernel, it shows multiple garbage graphic characters, and I 
cannot even transpose it, because it must have a CR, LF, or something else
embedded in the garbarge.

If you want to re-post, fix the module list truncation issue, try to do 
something to handle kernel versions that do not have the same #define's 
as what you're hardwiring, and perhaps make it into a "mod -t" option 
that displays just the module name and its TAINT flag.

Dave

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility


[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux