]> www.infradead.org Git - users/jedix/linux-maple.git/commit
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)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 23 Jun 2017 04:10:49 +0000 (21:10 -0700)
commita1d8634180715a5bcdb9adb13c2e71c47d22e654
tree0468ac2f57dfda42bb3e7ff83adb13d59862e9cc
parent2637f0610d5c76e1d6a9308fee0408c10a0b5a84
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>
Orabug: 25395066
(cherry picked from commit 554617b2bbe25c3fb3c80c28fe7a465884bb40b1)
Signed-off-by: Kyle Fortin <kyle.fortin@oracle.com>
Reviewed-by: Shan Hai <shan.hai@oracle.com>
drivers/target/target_core_user.c