scsi: sg: fixup infoleak when using SG_GET_REQUEST_TABLE
authorHannes Reinecke <hare@suse.de>
Fri, 15 Sep 2017 12:05:16 +0000 (14:05 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 11 Jun 2020 18:05:46 +0000 (19:05 +0100)
commitf37de82d22dc41e9748b788655fab4bfea465a02
treecb486c8f2a4f8577e779e566b6a4b7133d2cb9f9
parent72e47c58b24aef8c687cbaaffa3aa5f9fe88612c
scsi: sg: fixup infoleak when using SG_GET_REQUEST_TABLE

commit 3e0097499839e0fe3af380410eababe5a47c4cf9 upstream.

When calling SG_GET_REQUEST_TABLE ioctl only a half-filled table is
returned; the remaining part will then contain stale kernel memory
information.  This patch zeroes out the entire table to avoid this
issue.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/scsi/sg.c