linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Log correct rpmb unit descriptor size
@ 2021-07-27 12:35 Avri Altman
  2021-07-27 12:35 ` [PATCH 1/3] scsi: ufs: Remove redundant define Avri Altman
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Avri Altman @ 2021-07-27 12:35 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: Bart Van Assche, Bean Huo, Alim Akhtar, Avri Altman

For the rpmb unit descriptor, if the field offset is larger than 0x23,
it may trigger a stack corruption because a) we do not log properly the
rpmb unit descriptor size,  and b) ufs_is_valid_unit_desc_lun() test for
specific wb offset case, and does not verify that the requested field
does not exceed the descriptor size.

Fix both issues.

Reported-by: Bart Van Assche <bvanassche@google.com>

Avri Altman (3):
  scsi: ufs: Remove redundant define
  scsi: ufs: Map the correct size to the rpmb unit descriptor
  scsi: ufs: Generalize ufs_is_valid_unit_desc_lun()

 drivers/scsi/ufs/ufs-sysfs.c |  2 +-
 drivers/scsi/ufs/ufs.h       | 21 +--------------------
 drivers/scsi/ufs/ufs_bsg.c   |  3 ++-
 drivers/scsi/ufs/ufshcd.c    | 19 ++++++++++++-------
 drivers/scsi/ufs/ufshcd.h    | 27 ++++++++++++++++++++++++++-
 5 files changed, 42 insertions(+), 30 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-06  3:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-27 12:35 [PATCH 0/3] Log correct rpmb unit descriptor size Avri Altman
2021-07-27 12:35 ` [PATCH 1/3] scsi: ufs: Remove redundant define Avri Altman
2021-07-29  6:26   ` Bean Huo
2021-07-27 12:35 ` [PATCH 2/3] scsi: ufs: Map the correct size to the rpmb unit descriptor Avri Altman
2021-07-27 12:35 ` [PATCH 3/3] scsi: ufs: Generalize ufs_is_valid_unit_desc_lun() Avri Altman
     [not found] ` <CGME20210727123637epcas2p23457bd807cee66ec4c4e487a3a15ef33@epcms2p7>
2021-07-28  5:06   ` [PATCH 2/3] scsi: ufs: Map the correct size to the rpmb unit descriptor Daejun Park
2021-07-28  7:28     ` Avri Altman
     [not found]     ` <CGME20210727123637epcas2p23457bd807cee66ec4c4e487a3a15ef33@epcms2p4>
2021-07-28  7:51       ` Daejun Park
2021-08-06  3:03 ` [PATCH 0/3] Log correct rpmb unit descriptor size Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).