Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 6b20fa9a authored by Nicholas Bellinger's avatar Nicholas Bellinger
Browse files

target: Fix REPORT TARGET PORT GROUPS handling with small allocation length



This patch fixes a bug with the handling of REPORT TARGET PORT GROUPS
containing a smaller allocation length than the payload requires causing
memory writes beyond the end of the buffer.  This patch checks for the
minimum 4 byte length for the response payload length, and also checks
upon each loop of T10_ALUA(su_dev)->tg_pt_gps_list to ensure the Target
port group and Target port descriptor list is able to fit into the
remaining allocation length.

If the response payload exceeds the allocation length length, then rd_len
is still increments to indicate to the initiator that the payload has
been truncated.

Reported-by: default avatarRoland Dreier <roland@purestorage.com>
Cc: stable@kernel.org
Signed-off-by: default avatarNicholas Bellinger <nab@risingtidesystems.com>
parent b937d270
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment