Skip to content

Commit d8ab355

Browse files
Dr. David Alan Gilbertairlied
authored andcommitted
drm/radeon/kms: add missing copy from user
This hasn't mattered up until the ioctl started using the value, and it fell apart. fixes fd.o 29340, Ubuntu LP 606081 [airlied: cleaned up whitespace and don't need an error before pushing] Signed-off-by: Dr. David Alan Gilbert <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
1 parent 96576a9 commit d8ab355

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/radeon/radeon_kms.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
112112

113113
info = data;
114114
value_ptr = (uint32_t *)((unsigned long)info->value);
115-
value = *value_ptr;
115+
if (DRM_COPY_FROM_USER(&value, value_ptr, sizeof(value)))
116+
return -EFAULT;
117+
116118
switch (info->request) {
117119
case RADEON_INFO_DEVICE_ID:
118120
value = dev->pci_device;

0 commit comments

Comments
 (0)