Skip to content

Commit 99c7b30

Browse files
lorenzalexdeucher
authored andcommitted
drm/amdkfd: Use correct major in devcgroup check
The existing code used the major version number of the DRM driver instead of the device major number of the DRM subsystem for validating access for a devices cgroup. This meant that accesses allowed by the devices cgroup weren't permitted and certain accesses denied by the devices cgroup were permitted (if they matched the wrong major device number). Signed-off-by: Lorenz Brun <[email protected]> Fixes: 6b855f7 ("drm/amdkfd: Check against device cgroup") Reviewed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 9ec051b commit 99c7b30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_priv.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <drm/drm_file.h>
4141
#include <drm/drm_drv.h>
4242
#include <drm/drm_device.h>
43+
#include <drm/drm_ioctl.h>
4344
#include <kgd_kfd_interface.h>
4445
#include <linux/swap.h>
4546

@@ -1076,7 +1077,7 @@ static inline int kfd_devcgroup_check_permission(struct kfd_dev *kfd)
10761077
#if defined(CONFIG_CGROUP_DEVICE)
10771078
struct drm_device *ddev = kfd->ddev;
10781079

1079-
return devcgroup_check_permission(DEVCG_DEV_CHAR, ddev->driver->major,
1080+
return devcgroup_check_permission(DEVCG_DEV_CHAR, DRM_MAJOR,
10801081
ddev->render->index,
10811082
DEVCG_ACC_WRITE | DEVCG_ACC_READ);
10821083
#else

0 commit comments

Comments
 (0)