- 论坛徽章:
- 0
|
Bug ID 6335549\r\nSynopsis prtdiag: can\'t get smbios tables on toshiba tecra s1 laptop\r\nState 10-Fix Delivered (Fix available in build)\r\nCategory:Subcategory library:libsmbios\r\nKeywords onnv_triage | opensolaris | oss-request | thumper\r\nSponsor \r\nSubmitter jk\r\nResponsible Engineer Michael Shapiro\r\nReported Against snv_23 , s10u2_02\r\nDuplicate Of \r\nIntroduced In \r\nCommit to Fix snv_32\r\nFixed In snv_32\r\nRelease Fixed solaris_nevada(snv_32) , solaris_10u2(s10u2_07) (Bug ID:2135035)\r\nRelated Bugs 6335547 , 6335559\r\nSubmit Date 11-OCT-2005\r\nLast Update Date 24-APR-2006\r\nDescription \r\n\r\nCategory\r\n kernel\r\nSub-Category\r\n ras\r\nDescription\r\n prtdiag (or smbios) does not work on a Toshiba Tecra S1 laptop.\r\n% prtdiag\r\nprtdiag: failed to open SMBIOS: System does not export an SMBIOS table\r\n/var/adm/messages:\r\nOct 8 15:03:37 max unix: [ID 672469 kern.notice] SMBIOS not loaded (SMBIOS data structure is corrupted)\r\nOpen of /dev/smbios fails with ENXIO, because in the kernel, ksmbios == NULL.\r\nThis happens in post_startup():\r\n ksmbios = smbios_open(NULL, SMB_VERSION, ksmbios_flags, NULL);\r\nRoot cause:\r\nAccording to the length of the smbios data structure, it ends four bytes\r\nafter the final 0x7f (END-OF-TABLE) record.\r\nusr/src/common/smbios/smb_open.c function smbios_bufopen() checks that\r\neach smbios structure contains valid bytes, including two extra\r\nbytes for a (empty) string table:\r\n 167 if ((const uchar_t *)hp + hp->smbh_len > q - 2)\r\n 168 return (smb_open_error(shp, errp, ESMB_CORRUPT));\r\nIt\'s the missing text string table (the two \'\\0\' bytes for an empty string\r\ntable) that is missing with Toshiba\'s SMBIOS for the end-of-table \r\nstructure.\r\nText strings for the end-of-table record are not need my the smbios driver or\r\nthe prtdiag / smbios utility, so the check could be relaxed to allow and\r\nend-of-table record without string table.\r\nFrequency\r\n Always\r\nRegression\r\n Solaris 10\r\nSteps to Reproduce\r\n Try to run prtdiag (or smbios) on a Tecra S1 laptop running snv_23.\r\nExpected Result\r\n prtdiag prints system information (from smbios tables).\r\nActual Result\r\n % prtdiag\r\nprtdiag: failed to open SMBIOS: System does not export an SMBIOS table\r\nError Message(s)\r\n prtdiag: failed to open SMBIOS: System does not export an SMBIOS table\r\nOct 8 15:03:37 max unix: [ID 672469 kern.notice] SMBIOS not loaded (SMBIOS data structure is corrupted)\r\nTest Case\r\nSubmitter wants to work on bug\r\n Yes\r\nAdditional configuration information\r\n Toshiba Tecra S1 laptop\r\nDiskless snv_22 client, bfu\'ed to snv_23\r\n\r\nWork Around \r\n\r\nSuggested fix:\r\n- check the structure\'s length without looking at the string table\r\n before the structure loop is terminated by the end-of-table entry\r\n- for table entrys != end-of-table, make sure that the string table\r\n is present\r\n- while we\'re at it: add a check for minimum structure length (must\r\n be at least 4 bytes), according to SMBIOS specification Appendix 4.\r\n \"Conformance Guidelines\", check 3.3.\r\n--- usr/src/common/smbios/smb_open.c-orig Sa Okt 8 17:01:37 2005\r\n+++ usr/src/common/smbios/smb_open.c Sa Okt 8 17:13:20 2005\r\n@@ -164,12 +164,30 @@\r\n smb_dprintf(shp, \"struct [%u] type %u len %u hdl %u at %p\\n\",\r\n i, hp->smbh_type, hp->smbh_len, hp->smbh_hdl, (void *)hp);\r\n \r\n- if ((const uchar_t *)hp + hp->smbh_len > q - 2)\r\n+ /*\r\n+ * Check the length of the formatted portion of the structure\r\n+ * first.\r\n+ *\r\n+ * A lot of SMBIOSes don\'t include the text string table for\r\n+ * the end-of-table entry in the smbios table length field\r\n+ * smbe_stlen; we allow an end-of-table entry without string\r\n+ * table, before we check for the presence of a text string\r\n+ * table.\r\n+ *\r\n+ * For all other entries, the formatted portion of the entry\r\n+ * must be followed by at least the two terminating null\r\n+ * bytes for the text string table.\r\n+ */\r\n+ if (hp->smbh_len < sizeof (smb_header_t)\r\n+ || (const uchar_t *)hp + hp->smbh_len > q)\r\n return (smb_open_error(shp, errp, ESMB_CORRUPT));\r\n \r\n if (hp->smbh_type == SMB_TYPE_EOT)\r\n break; /* ignore any entries beyond end-of-table */\r\n \r\n+ if ((const uchar_t *)hp + hp->smbh_len > q - 2)\r\n+ return (smb_open_error(shp, errp, ESMB_CORRUPT));\r\n+\r\n h = hp->smbh_hdl & (shp->sh_hashlen - 1);\r\n p = s = (const uchar_t *)hp + hp->smbh_len; |
|