]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
target: bounds check XCOPY segment descriptor list
authorDavid Disseldorp <ddiss@suse.de>
Fri, 23 Dec 2016 10:37:55 +0000 (11:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Jan 2021 12:55:12 +0000 (13:55 +0100)
commitc85fecceec8520d2b023c3334e9561e67a32e8ee
treef9769ea06936ed7164d36fd35192e9b1b7e05fca
parent7a92e45c2791af0338f54a62e5f901cd73aca2c1
target: bounds check XCOPY segment descriptor list

[ Upstream commit af9f62c1686268c0517b289274d38f3a03bebd2a ]

Check the length of the XCOPY request segment descriptor list against
the value advertised via the MAXIMUM SEGMENT DESCRIPTOR COUNT field in
the RECEIVE COPY OPERATING PARAMETERS response.

spc4r37 6.4.3.5 states:
  If the number of segment descriptors exceeds the allowed number, the
  copy manager shall terminate the command with CHECK CONDITION status,
  with the sense key set to ILLEGAL REQUEST, and the additional sense
  code set to TOO MANY SEGMENT DESCRIPTORS.

This functionality is testable using the libiscsi
ExtendedCopy.DescrLimits test.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/target/target_core_xcopy.c