]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Add a length limitation for the ivrs_acpihid command-line parameter
authorGavrilov Ilia <Ilia.Gavrilov@infotecs.ru>
Thu, 2 Feb 2023 08:26:56 +0000 (08:26 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:32:49 +0000 (08:32 +0100)
commit9fca34bea5503ef755a3c1f60a4add0b0636b230
tree3e84c079ba1bfde94e4caacb91914442caecfc52
parent3efede190598ae564c05193a1cf0070b854774b6
iommu/amd: Add a length limitation for the ivrs_acpihid command-line parameter

[ Upstream commit b6b26d86c61c441144c72f842f7469bb686e1211 ]

The 'acpiid' buffer in the parse_ivrs_acpihid function may overflow,
because the string specifier in the format string sscanf()
has no width limitation.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Fixes: 7663e536597d ("iommu/amd: Introduces ivrs_acpihid kernel parameter")
Cc: stable@vger.kernel.org
Signed-off-by: Ilia.Gavrilov <Ilia.Gavrilov@infotecs.ru>
Reviewed-by: Kim Phillips <kim.phillips@amd.com>
Link: https://lore.kernel.org/r/20230202082719.1513849-1-Ilia.Gavrilov@infotecs.ru
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/amd_iommu_init.c