Skip to content

drm: A couple of fixes for drm_copy_field() helper function

Javier Martinez Canillas dri-devel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Add Peter Robinson Tested-by and Thomas Zimmermann Reviewed-by tags.
- Just warn if a value isn't set and report it as a string of length 0. (Thomas Zimmermann).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm: Use size_t type for len variable in drm_copy_field()drivers/gpu/drm/drm_ioctl.c+1 -10 replies
2/2drm: Prevent drm_copy_field() to attempt copying a NULL pointerdrivers/gpu/drm/drm_ioctl.c+6 -00 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchPeter RobinsonThomas Zimmermann
1/2T-b R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] drm: A couple of fixes for drm_copy_field() helper function

Hello,

Peter Robinson reported me a kernel bug in one of his aarch64 test boards and even though I was not able to reproduce it, I think that figured out what the problem was. It seems the cause is that a DRM driver doesn't set some of the struct drm fields copied to userspace via DRM_IOCTL_VERSION.

Even though this is a driver bug, we can make drm_copy_field() more robust and warn about it instead of leading to an attempt to copy a NULL pointer.

While looking at this, I also found that a variable in drm_copy_field() is not using the correct type. So I included that change in the patch-set too.

Best regards,
Javier

Changes in v2:
- Add Peter Robinson Tested-by and Thomas Zimmermann Reviewed-by tags.
- Just warn if a value isn't set and report it as a string of length 0. (Thomas Zimmermann).

Javier Martinez Canillas (2):
drm: Use size_t type for len variable in drm_copy_field()
drm: Prevent drm_copy_field() to attempt copying a NULL pointer

 drivers/gpu/drm/drm_ioctl.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Signature · 1 line
2.36.1