summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2021-04-06 16:40:25 -0300
committerAlex Williamson <alex.williamson@redhat.com>2021-04-07 15:39:16 -0600
commitb5a1f8921d5040bb788492bf33a66758021e4be5 (patch)
tree409c68be592aa60d6e9f90328dbc0117ca442805 /include/linux
parent6cbf507fd08b52901d62bf11f3507e80f84c0db4 (diff)
vfio/mdev: Do not allow a mdev_type to have a NULL parent pointer
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: 7b96953bc640 ("vfio: Mediated device Core driver") Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Message-Id: <2-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions