FIBMAP on a block device is plainly wrong, it should only be applied to a file. The FIBMAP ioctl to a scsi block device is the same as the SCSI_IOCTL_SEND_COMMAND ioctl that requires a scsi_ioctl_command struct. As it stands, we are passing an int with stack garbage as this struct which is passing garbage to the ioctl. The deprecated SCSI ioctl creates a scsi_request from the garbage and this causes the kernel to correctly warn with a usercopy_abort that the structure is bogos. Fix this by not calling FIBMAP on a raw SCSI device.
Fix committed to stress-ng:
http:// kernel. ubuntu. com/git/ cking/stress- ng.git/ commit/ ?id=53e5a98cd58 d3b146cf8ffe525 40722ff410a5ad
FIBMAP on a block device is plainly wrong, it should only be applied to a file. The FIBMAP ioctl to a scsi block device is the same as the SCSI_IOCTL_ SEND_COMMAND ioctl that requires a scsi_ioctl_command struct. As it stands, we are passing an int with stack garbage as this struct which is passing garbage to the ioctl. The deprecated SCSI ioctl creates a scsi_request from the garbage and this causes the kernel to correctly warn with a usercopy_abort that the structure is bogos. Fix this by not calling FIBMAP on a raw SCSI device.