Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iommu/mediatek-v1: add missing larb count sanity check

Add the missing larb count sanity check to avoid writing beyond a fixed
sized array in case of a malformed devicetree.

Acked-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

authored by

Johan Hovold and committed by
Joerg Roedel
ab31cf04 46207625

+3
+3
drivers/iommu/mtk_iommu_v1.c
··· 646 646 if (larb_nr < 0) 647 647 return larb_nr; 648 648 649 + if (larb_nr > MTK_LARB_NR_MAX) 650 + return -EINVAL; 651 + 649 652 for (i = 0; i < larb_nr; i++) { 650 653 struct device_node *larbnode; 651 654 struct platform_device *plarbdev;