bin/72177: camcontrol's getdevtree fails
Doug Haigh
dhaigh at mail.com
Wed Sep 29 11:20:27 PDT 2004
>Number: 72177
>Category: bin
>Synopsis: camcontrol's getdevtree fails
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 29 18:20:25 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Doug Haigh
>Release: 5.2.1
>Organization:
>Environment:
Environment independent - error in base code for /sbin/camcontrol
>Description:
On SPARC64 machine, running the camcontrol devlist command fails because the xptioctl code thinks the physical flag (CAM_DATA_PHYS) is set.
In looking into /usr/src/sbin/camcontrol/camcontrol.c in the getdevtree routine, the CCB union is allocated off the stack, but the bzero command to clear out the structure skips the header section and just clears the ccb_dev_match part. Because of this, whatever is on the stack is sent as header flags to the ioctl routine.
I would suggest clearing out the entire strucure or explicitly setting all fields in the header structure.
>How-To-Repeat:
Difficult to do unless you can mess up the stack data to imitate the CAM_DATA_PHYS being set.
>Fix:
Change line 306 from
bzero(&(&ccb.ccb_h)[1], sizeof(struct ccb_dev_match) - sizeof(struct ccb_hdr));
to
bzero(&ccb, sizeof(ccb));
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list