I noticed that when I do two SG_IO ioctls to a target
device (say, tape drive, disk drive, whatever) in which
the first request is well formed (e.g. an inquiry) and the 
second one has a malformed CDB, such that it gets check condition 
with sense key == 5 (ILLEGAL REQUEST), the data buffer returned for 
the second malformed SG_IO request is filled out with the same 
data as was returned for the first successful command (e.g. the 
same inquiry data again.)  I'm using separate data buffers for
the two commands, and memsetting them to zero before calling
ioctl().  I don't think this data is coming from the device,
as it happens with every device I've tried.

Is that normal?  Seems like for a malformed request, the 
data buffer should not be transferred at all, much less
transferred with contents of a prior request's data buffer.

Kernel is 2.6.18 from kernel.org.

The two requests were done from the same process, I haven't
tried two separate processes to see if one process could
by this method access another process's data.  I did try
using two devices, so the first well formed command went 
to one device, and the 2nd, malformed command went to another
device.  In that case, I didn't get the same buffer back again,
but garbage. (some recognizeable strings, "en_US" was in there...)

Is this a problem, or is this a matter of "just don't do that."?

Thanks,

-- steve
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to