Skip to content

Commit

Permalink
scsi: st: Fix array overflow in st_setup()
Browse files Browse the repository at this point in the history
[ Upstream commit a018d1c ]

Change the array size to follow parms size instead of a fixed value.

Reported-by: Chenyuan Yang <chenyuan0y@gmail.com>
Closes: https://lore.kernel.org/linux-scsi/CALGdzuoubbra4xKOJcsyThdk5Y1BrAmZs==wbqjbkAgmKS39Aw@mail.gmail.com/
Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
Link: https://lore.kernel.org/r/20250311112516.5548-2-Kai.Makisara@kolumbus.fi
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Kai Mäkisara authored and Greg Kroah-Hartman committed May 2, 2025
1 parent f737418 commit c6015d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -4109,7 +4109,7 @@ static void validate_options(void)
*/
static int __init st_setup(char *str)
{
int i, len, ints[5];
int i, len, ints[ARRAY_SIZE(parms) + 1];
char *stp;

stp = get_options(str, ARRAY_SIZE(ints), ints);
Expand Down

0 comments on commit c6015d0

Please sign in to comment.