Bug 206641 - Kudzu incomplete scsi probe with many scsi devices
Summary: Kudzu incomplete scsi probe with many scsi devices
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kudzu
Version: 4.4
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
: 203811 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2006-09-15 13:38 UTC by Denis Leroy
Modified: 2014-03-17 03:02 UTC (History)
6 users (show)

Clone Of:
Last Closed: 2007-05-08 00:20:59 UTC

Attachments (Terms of Use)
Patch for scsi.c, fixes /proc/scsi/scsi read loop (732 bytes, patch)
2006-09-15 13:38 UTC, Denis Leroy
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0292 normal SHIPPED_LIVE kudzu bug fix update 2007-04-28 19:02:12 UTC

Description Denis Leroy 2006-09-15 13:38:04 UTC
(Hi Bill)

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 I think kudzu
1.2.x uses sysfs and therefore should be ok (didn't verify though).

Corresponding Issue Tracker: 97738.

Denis Leroy
Sun Microsystems, Inc.

Comment 1 Denis Leroy 2006-09-15 13:38:04 UTC
Created attachment 136356 [details]
Patch for scsi.c, fixes /proc/scsi/scsi read loop

Comment 3 RHEL Product and Program Management 2006-09-15 16:04:00 UTC
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

Comment 5 David Aquilina 2006-09-21 22:06:13 UTC
*** Bug 203811 has been marked as a duplicate of this bug. ***

Comment 6 Bill Nottingham 2006-11-21 23:54:51 UTC
Added, will be in or later.

Comment 20 Red Hat Bugzilla 2007-05-08 00:21:00 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.