On 12/04/2024 18:06, carsten.haitzler@foss.arm.com wrote:
[...] @@ -693,53 +710,91 @@ int drm_mode_getplane_res(struct drm_device *dev, void *data, int drm_mode_getplane(struct drm_device *dev, void *data, struct drm_file *file_priv) {
- struct drm_mode_get_plane32 {
__u32 plane_id;
__u32 crtc_id;
__u32 fb_id;
__u32 possible_crtcs;
__u32 gamma_size;
__u32 count_format_types;
__u64 format_type_ptr;
- };
- struct drm_mode_get_plane32 *plane_resp32 = data; struct drm_mode_get_plane *plane_resp = data; struct drm_plane *plane; uint32_t __user *format_ptr;
- __u32 plane_id, count_format_types, crtc_id, fb_id, possible_crtcs, gamma_size;
if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EOPNOTSUPP;
- plane = drm_plane_find(dev, file_priv, plane_resp->plane_id);
- if (in_compat64_syscall()) {
format_ptr = compat_ptr(plane_resp32->format_type_ptr);
plane_id = plane_resp32->plane_id;
count_format_types = plane_resp32->count_format_types;
- } else {
format_ptr = uaddr_to_user_ptr(plane_resp->format_type_ptr);
Should be a simple cast (this is interpreting format_type_ptr as a 64-bit value, throwing away the capability, then creating a new one).
Kevin