iscsi-target: fix heap buffer overflow on error
authorKees Cook <keescook@chromium.org>
Thu, 23 May 2013 17:32:17 +0000 (10:32 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Jun 2013 01:16:40 +0000 (02:16 +0100)
commitba73be1c56e3a459f5cd4580177e865b362d76a7
tree19a14fd9b15df71138cb24367140996f594d8937
parent81428790d5392ba103ff27a8e0ac0bc0a4959713
iscsi-target: fix heap buffer overflow on error

commit cea4dcfdad926a27a18e188720efe0f2c9403456 upstream.

If a key was larger than 64 bytes, as checked by iscsi_check_key(), the
error response packet, generated by iscsi_add_notunderstood_response(),
would still attempt to copy the entire key into the packet, overflowing
the structure on the heap.

Remote preauthentication kernel memory corruption was possible if a
target was configured and listening on the network.

CVE-2013-2850

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/target/iscsi/iscsi_target_parameters.c
drivers/target/iscsi/iscsi_target_parameters.h