]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: stex: Properly zero out the passthrough command structure
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 9 Sep 2022 06:54:47 +0000 (08:54 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 25 Sep 2022 18:15:03 +0000 (14:15 -0400)
commitdd34162a122f517fa1b02d50562cfe46029dd78e
treed334e4da26edc6f9681f97957862fc814a813bdb
parent7d3555486644887303ff1d78dcfb6ecd8d1bcb8a
scsi: stex: Properly zero out the passthrough command structure

The passthrough structure is declared off of the stack, so it needs to be
set to zero before copied back to userspace to prevent any unintentional
data leakage.  Switch things to be statically allocated which will fill the
unused fields with 0 automatically.

Link: https://lore.kernel.org/r/YxrjN3OOw2HHl9tx@kroah.com
Cc: stable@kernel.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: hdthky <hdthky0@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/stex.c
include/scsi/scsi_cmnd.h