Skip to contentSkip to conversation

Revert "drm/syncobj: Fix handle <-> fd ioctls with dirty stack"

PATCH In review Maarten Lankhorst 3 participants 5 messages Mar 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/syncobj: Fix handle <-> fd ioctls with dirty stack"

This reverts commit 2e3649e237237258a08d75afef96648dd2b379f7.

The problem occurs when userspace is compiled against new headers with new members, but don't correctly initialise those new members.

This is not a kernel problem, and should be fixed in userspace by correctly zero'ing all members.

Cc Rob Clark <[email protected]>
Cc Julian Orth <[email protected]>
Cc Christian König <[email protected]>
Cc Michel Dänzer <[email protected]>
---
 drivers/gpu/drm/drm_syncobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_syncobj.c +2 -2
index 49eccb43ce63d..250734dee928e 100644
@@ -875,7 +875,7 @@ drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
 		return drm_syncobj_export_sync_file(file_private, args->handle,
 						    point, &args->fd);
 
-	if (point)
+	if (args->point)
 		return -EINVAL;
 
 	return drm_syncobj_handle_to_fd(file_private, args->handle,
@@ -909,7 +909,7 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
 							  args->handle,
 							  point);
 
-	if (point)
+	if (args->point)
 		return -EINVAL;
 
 	return drm_syncobj_fd_to_handle(file_private, args->fd,
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Maarten Lankhorst

This reverts commit 2e3649e237237258a08d75afef96648dd2b379f7.

The problem occurs when userspace is compiled against new headers with new members, but don't correctly initialise those new members.

Quoted 8 lines

This is not a kernel problem, and should be fixed in userspace by correctly zero'ing all members.

Cc Rob Clark <[email protected]>
Cc Julian Orth <[email protected]>
Cc Christian König <[email protected]>
Cc Michel Dänzer <[email protected]>
Quoted 26 lines
---
 drivers/gpu/drm/drm_syncobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_syncobj.c +2 -2
index 49eccb43ce63d..250734dee928e 100644
@@ -875,7 +875,7 @@ drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
 		return drm_syncobj_export_sync_file(file_private, args->handle,
 						    point, &args->fd);
 
-	if (point)
+	if (args->point)
 		return -EINVAL;
 
 	return drm_syncobj_handle_to_fd(file_private, args->handle,
@@ -909,7 +909,7 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
 							  args->handle,
 							  point);
 
-	if (point)
+	if (args->point)
 		return -EINVAL;
 
 	return drm_syncobj_fd_to_handle(file_private, args->fd,
#2 lore raw
In reply to Maarten Lankhorst
Quoted 8 lines · Maarten Lankhorst

This reverts commit 2e3649e237237258a08d75afef96648dd2b379f7.

The problem occurs when userspace is compiled against new headers with new members, but don't correctly initialise those new members.

This is not a kernel problem, and should be fixed in userspace by correctly zero'ing all members.

I don't mind it being reverted since userspace rust code is not affected by this failure mode.

However, if you're committed to the idea that this is a userspace issue, then I think the correct solution would be to instead apply the patch you suggested. It clarifies the intention of the code in my opinion.

Quoted 35 lines
Cc Rob Clark <[email protected]>
Cc Julian Orth <[email protected]>
Cc Christian König <[email protected]>
Cc Michel Dänzer <[email protected]>
---
 drivers/gpu/drm/drm_syncobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_syncobj.c +2 -3
index 49eccb43ce63d..250734dee928e 100644
@@ -875,7 +875,7 @@ drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
                return drm_syncobj_export_sync_file(file_private, args->handle,
                                                    point, &args->fd);
 
-       if (point)
+       if (args->point)
                return -EINVAL;
 
        return drm_syncobj_handle_to_fd(file_private, args->handle,
@@ -909,7 +909,7 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
                                                          args->handle,
                                                          point);
 
-       if (point)
+       if (args->point)
                return -EINVAL;
 
        return drm_syncobj_fd_to_handle(file_private, args->fd,
--

2.51.0

#3 lore raw

Hey,

Den 2026-03-05 kl. 12:48, skrev Julian Orth:

Quoted 10 lines · Maarten Lankhorst
Quoted 8 lines

This reverts commit 2e3649e237237258a08d75afef96648dd2b379f7.

The problem occurs when userspace is compiled against new headers with new members, but don't correctly initialise those new members.

This is not a kernel problem, and should be fixed in userspace by correctly zero'ing all members.

Quoted 7 lines

I don't mind it being reverted since userspace rust code is not affected by this failure mode.

However, if you're committed to the idea that this is a userspace issue, then I think the correct solution would be to instead apply the patch you suggested. It clarifies the intention of the code in my opinion.

Thanks for having a better understanding of the issue now. :) I will resend the original patch I mentioned later. I just wanted to get this revert in drm/drm-fixes before it reaches a rc kernel.

Can I read your reply as an acked-by?

Kind regards,
~Maarten Lankhorst

Quoted 35 lines
Quoted 35 lines
Cc Rob Clark <[email protected]>
Cc Julian Orth <[email protected]>
Cc Christian König <[email protected]>
Cc Michel Dänzer <[email protected]>
---
 drivers/gpu/drm/drm_syncobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_syncobj.c +2 -3
index 49eccb43ce63d..250734dee928e 100644
@@ -875,7 +875,7 @@ drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
                return drm_syncobj_export_sync_file(file_private, args->handle,
                                                    point, &args->fd);
 
-       if (point)
+       if (args->point)
                return -EINVAL;
 
        return drm_syncobj_handle_to_fd(file_private, args->handle,
@@ -909,7 +909,7 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
                                                          args->handle,
                                                          point);
 
-       if (point)
+       if (args->point)
                return -EINVAL;
 
        return drm_syncobj_fd_to_handle(file_private, args->fd,
--

2.51.0

#4 lore raw
Quoted 22 lines · Maarten Lankhorst

Hey,

Den 2026-03-05 kl. 12:48, skrev Julian Orth:

Quoted 10 lines · Maarten Lankhorst
Quoted 8 lines

This reverts commit 2e3649e237237258a08d75afef96648dd2b379f7.

The problem occurs when userspace is compiled against new headers with new members, but don't correctly initialise those new members.

This is not a kernel problem, and should be fixed in userspace by correctly zero'ing all members.

Quoted 7 lines

I don't mind it being reverted since userspace rust code is not affected by this failure mode.

However, if you're committed to the idea that this is a userspace issue, then I think the correct solution would be to instead apply the patch you suggested. It clarifies the intention of the code in my opinion.

Quoted 5 lines

Thanks for having a better understanding of the issue now. :) I will resend the original patch I mentioned later. I just wanted to get this revert in drm/drm-fixes before it reaches a rc kernel.

Can I read your reply as an acked-by?

Yes.

Quoted 40 lines

Kind regards,
~Maarten Lankhorst

Quoted 35 lines
Quoted 35 lines
Cc Rob Clark <[email protected]>
Cc Julian Orth <[email protected]>
Cc Christian König <[email protected]>
Cc Michel Dänzer <[email protected]>
---
 drivers/gpu/drm/drm_syncobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_syncobj.c +2 -3
index 49eccb43ce63d..250734dee928e 100644
@@ -875,7 +875,7 @@ drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
                return drm_syncobj_export_sync_file(file_private, args->handle,
                                                    point, &args->fd);
 
-       if (point)
+       if (args->point)
                return -EINVAL;
 
        return drm_syncobj_handle_to_fd(file_private, args->handle,
@@ -909,7 +909,7 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
                                                          args->handle,
                                                          point);
 
-       if (point)
+       if (args->point)
                return -EINVAL;
 
        return drm_syncobj_fd_to_handle(file_private, args->fd,
--

2.51.0