target/user: Return an error if cmd data size is too large
authorAndy Grover <agrover@redhat.com>
Thu, 25 Aug 2016 15:55:53 +0000 (08:55 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 20 Oct 2016 04:22:16 +0000 (21:22 -0700)
commit554617b2bbe25c3fb3c80c28fe7a465884bb40b1
tree0a4a342ff1d0ae52a6cad39352a714a914489bd1
parent02eb924fabc5b699c0d9d354491e6f0767e3c139
target/user: Return an error if cmd data size is too large

Userspace should be implementing VPD B0 (Block Limits) to inform the
initiator of max data size, but just in case we do get a too-large request,
do what the spec says and return INVALID_CDB_FIELD.

Make sure to unlock udev->cmdr_lock before returning.

Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_user.c