Parcourir la source

Merge SCSI_IOCTL_SEND_COMMAND cleanup branch.

Nobody commented on this patch back in July. So now it gets merged.

* SCSI_IOCTL_SEND_COMMAND cleanup:
  scsi sg: remove incorrect scsi command checking logic
Linus Torvalds il y a 7 ans
Parent
commit
57ee3196ce
1 fichiers modifiés avec 0 ajouts et 9 suppressions
  1. 0 9
      drivers/scsi/sg.c

+ 0 - 9
drivers/scsi/sg.c

@@ -1103,15 +1103,6 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
 	case SCSI_IOCTL_SEND_COMMAND:
 		if (atomic_read(&sdp->detaching))
 			return -ENODEV;
-		if (read_only) {
-			unsigned char opcode = WRITE_6;
-			Scsi_Ioctl_Command __user *siocp = p;
-
-			if (copy_from_user(&opcode, siocp->data, 1))
-				return -EFAULT;
-			if (sg_allow_access(filp, &opcode))
-				return -EPERM;
-		}
 		return sg_scsi_ioctl(sdp->device->request_queue, NULL, filp->f_mode, p);
 	case SG_SET_DEBUG:
 		result = get_user(val, ip);