android_kernel_motorola_sm6375/drivers/vfio
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jason Gunthorpe 3d81ce0cfb vfio/mdev: Do not allow a mdev_type to have a NULL parent pointer
[ Upstream commit b5a1f8921d5040bb788492bf33a66758021e4be5 ]

There is a small race where the parent is NULL even though the kobj has
already been made visible in sysfs.

For instance the attribute_group is made visible in sysfs_create_files()
and the mdev_type_attr_show() does:

    ret = attr->show(kobj, type->parent->dev, buf);

Which will crash on NULL parent. Move the parent setup to before the type
pointer leaves the stack frame.

Fixes: 7b96953bc6 ("vfio: Mediated device Core driver")
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Reviewed-by: Max Gurtovoy <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2021-05-14 09:44:24 +02:00
..
mdev vfio/mdev: Do not allow a mdev_type to have a NULL parent pointer 2021-05-14 09:44:24 +02:00
pci vfio/pci: Add missing range check in vfio_pci_mmap 2021-04-21 12:56:16 +02:00
platform vfio: platform: fix reference leak in vfio_platform_open 2020-11-18 19:20:24 +01:00
Kconfig vfio: Depend on MMU 2021-05-07 10:51:38 +02:00
Makefile
vfio.c
vfio_iommu_spapr_tce.c
vfio_iommu_type1.c vfio/type1: Use follow_pte() 2021-03-04 10:26:38 +01:00
vfio_spapr_eeh.c
virqfd.c