Red Hat Bugzilla – Bug 206641
Kudzu incomplete scsi probe with many scsi devices
Last modified: 2014-03-16 23:02:23 EDT
So we have a SunFire X4200 running RHEL4U4 x86_64 with an HBA card connected to
an external StorEdge with 31+ disks.
When running 'kudzu -p -c HD', kudzu can only probe 25 disks, instead of the 38
available (31 external, 4 internal, cdrom, virtual cdrom, virtual floppy).
Turns out the bug is this: kudzu reads from /proc/scsi/scsi with a read()
command, but does not check the actual value returned by read() (the actual
number of bytes read). read buffer is 16k, so for a regular file this shouldn't
be a problem. In our case, with so many scsi devices, /proc/scsi/scsi has about
6k characters, so no prob for a 16k buffer. But /proc/scsi/scsi is no regular
file, and the first call to read() returns only about 3800 bytes, which breaks
the realloc loop. You'll understand easily when you look at the code.
Please find attached patch. Note this affects kudzu 22.214.171.124. I think kudzu
1.2.x uses sysfs and therefore should be ok (didn't verify though).
Corresponding Issue Tracker: 97738.
Sun Microsystems, Inc.
Created attachment 136356 [details]
Patch for scsi.c, fixes /proc/scsi/scsi read loop
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
*** Bug 203811 has been marked as a duplicate of this bug. ***
Added, will be in 126.96.36.199-1 or later.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.