Commit 8503d0f
iommu/amd: Avoid stack buffer overflow from kernel cmdline
While the kernel command line is considered trusted in most environments,
avoid writing 1 byte past the end of "acpiid" if the "str" argument is
maximum length.
Reported-by: Simcha Kosman <simcha.kosman@cyberark.com>
Closes: https://lore.kernel.org/all/AS8P193MB2271C4B24BCEDA31830F37AE84A52@AS8P193MB2271.EURP193.PROD.OUTLOOK.COM
Fixes: b6b26d8 ("iommu/amd: Add a length limitation for the ivrs_acpihid command-line parameter")
Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>
Link: https://lore.kernel.org/r/20250804154023.work.970-kees@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>1 parent 8f5ae30 commit 8503d0f
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3638 | 3638 | | |
3639 | 3639 | | |
3640 | 3640 | | |
3641 | | - | |
| 3641 | + | |
3642 | 3642 | | |
3643 | 3643 | | |
3644 | 3644 | | |
| |||
3664 | 3664 | | |
3665 | 3665 | | |
3666 | 3666 | | |
3667 | | - | |
| 3667 | + | |
3668 | 3668 | | |
3669 | 3669 | | |
3670 | 3670 | | |
| |||
0 commit comments