scsi: lpfc: Prevent buffer overflow crashes in debugfs with malformed user input
authorJames Smart <jsmart2021@gmail.com>
Fri, 1 Jul 2022 21:14:15 +0000 (14:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:40:34 +0000 (11:40 +0200)
commitb92506dc51f81741eb26609175ac206c20f06e0a
tree9a99dcda299c2232108dd21901faba0af143d17a
parent0af01d2c5edd889df3455efea6dbe08bda6150a8
scsi: lpfc: Prevent buffer overflow crashes in debugfs with malformed user input

[ Upstream commit f8191d40aa612981ce897e66cda6a88db8df17bb ]

Malformed user input to debugfs results in buffer overflow crashes.  Adapt
input string lengths to fit within internal buffers, leaving space for NULL
terminators.

Link: https://lore.kernel.org/r/20220701211425.2708-3-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/lpfc/lpfc_debugfs.c