Skip to contentSkip to conversation

drm: Fix get_property logic fumble

PATCH In review Daniel Vetter 7 participants 7 messages Apr 10, 2017 – Apr 13, 2017

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

PATCH 1/1 drm: Fix get_property logic fumble

Yet again I've proven that I can't negate conditions :(

Fixes eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Sean Paul <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/drm_property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_property.c +1 -1
index 3feef0659940..3e88fa24eab3 100644
@@ -476,7 +476,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
 	    drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) {
 		list_for_each_entry(prop_enum, &property->enum_list, head) {
 			enum_count++;
-			if (out_resp->count_enum_blobs <= enum_count)
+			if (out_resp->count_enum_blobs < enum_count)
 				continue;
 
 			if (copy_to_user(&enum_ptr[copied].value,
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm: Fix get_property logic fumble

== Series Details ==

== Series Details ==

Series: drm: Fix get_property logic fumble
URL : https://patchwork.freedesktop.org/series/22772/
State : success

== Summary ==

Series 22772v1 drm: Fix get_property logic fumble
https://patchwork.freedesktop.org/api/1.0/series/22772/revisions/1/mbox/

Test gem_exec_flush:

        Subgroup basic-batch-kernel-default-uc:
                fail       -> PASS       (fi-snb-2600) fdo#100007
Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                pass       -> DMESG-WARN (fi-bxt-t5700) fdo#100125
                pass       -> DMESG-WARN (fi-kbl-7560u) fdo#100125

fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007
fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11  time:435s
fi-bdw-gvtdvm    total:278  pass:256  dwarn:8   dfail:0   fail:0   skip:14  time:428s
fi-bsw-n3050     total:278  pass:242  dwarn:0   dfail:0   fail:0   skip:36  time:577s
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19  time:508s
fi-bxt-t5700     total:278  pass:257  dwarn:1   dfail:0   fail:0   skip:20  time:551s
fi-byt-j1900     total:278  pass:254  dwarn:0   dfail:0   fail:0   skip:24  time:480s
fi-byt-n2820     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:475s
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:418s
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16  time:402s
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50  time:424s
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:491s
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:467s
fi-kbl-7500u     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18  time:452s
fi-kbl-7560u     total:278  pass:267  dwarn:1   dfail:0   fail:0   skip:10  time:570s
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:452s
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17  time:571s
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18  time:474s
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10  time:496s
fi-skl-gvtdvm    total:278  pass:265  dwarn:0   dfail:0   fail:0   skip:13  time:433s
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28  time:530s
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29  time:398s

02f6d3e01f3e1b6b91efeaceabd24e36e0540b49 drm-tip: 2017y-04m-10d-11h-06m-04s UTC integration manifest a7d1fee drm: Fix get_property logic fumble

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4458/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Daniel Vetter
Quoted 3 lines · Daniel Vetter

Yet again I've proven that I can't negate conditions :(

Fixes eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")

You also get to write the igt/kms_getproperty, starting with a

	memset(prop_values, 0xc5, foo);
	drmIoctl(GETPROPERTY);
	igt_assert(!memchr(prop_values, 0xc5, bar));

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 9 lines · Chris Wilson
Quoted 3 lines · Daniel Vetter

Yet again I've proven that I can't negate conditions :(

Fixes eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")

You also get to write the igt/kms_getproperty, starting with a

	memset(prop_values, 0xc5, foo);
	drmIoctl(GETPROPERTY);
	igt_assert(!memchr(prop_values, 0xc5, bar));

Testcase: igt/kms_properties/get_property-sanity

Thanks for reminding me to not be lazy with testing stuff we've broken!

Pushed the patch to -next-fixes.

Cheers, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v1 1/1
#4 lore raw
In reply to Daniel Vetter

Op 10-04-17 om 13:54 schreef Daniel Vetter:

Quoted 19 lines

Yet again I've proven that I can't negate conditions :(

Fixes eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Sean Paul <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/drm_property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_property.c +0 -0
index 3feef0659940..3e88fa24eab3 100644

drivers/gpu/drm/drm_property.c int drm_mode_getproperty_ioctl(struct drm_device *dev, · line 482

Quoted 8 lines
drivers/gpu/drm/drm_property.c +1 -1
@@ -476,7 +476,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
 	    drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) {
 		list_for_each_entry(prop_enum, &property->enum_list, head) {
 			enum_count++;
-			if (out_resp->count_enum_blobs <= enum_count)
+			if (out_resp->count_enum_blobs < enum_count)
 				continue;
 
 			if (copy_to_user(&enum_ptr[copied].value,

Neither can I, glanced over it while looking why the bisect pointed at this commit.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
Quoted 27 lines · Maarten Lankhorst

Op 10-04-17 om 13:54 schreef Daniel Vetter:

Quoted 26 lines

Yet again I've proven that I can't negate conditions :(

Fixes eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Sean Paul <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/drm_property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_property.c +1 -1
index 3feef0659940..3e88fa24eab3 100644
@@ -476,7 +476,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
 	    drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) {
 		list_for_each_entry(prop_enum, &property->enum_list, head) {
 			enum_count++;
-			if (out_resp->count_enum_blobs <= enum_count)
+			if (out_resp->count_enum_blobs < enum_count)
 				continue;
 
Quoted 3 lines

drivers/gpu/drm/drm_property.c int drm_mode_getproperty_ioctl(struct drm_device *dev, · line 482

Quoted 1 line
drivers/gpu/drm/drm_property.c +0 -0
 			if (copy_to_user(&enum_ptr[copied].value,

Neither can I, glanced over it while looking why the bisect pointed at this commit.

Same.

Fixes segfaults on xorg-video-amdgpu-1.1.2

Quoted 8 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/1
#6 lore raw
In reply to Daniel Vetter
Quoted 7 lines · Daniel Vetter

Yet again I've proven that I can't negate conditions :(

Fixes eb8eb02ed850 ("drm: Drop modeset_lock_all from the getproperty ioctl")
Cc Maarten Lankhorst <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 22 lines
---
 drivers/gpu/drm/drm_property.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_property.c +1 -1
index 3feef0659940..3e88fa24eab3 100644
@@ -476,7 +476,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
 	    drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) {
 		list_for_each_entry(prop_enum, &property->enum_list, head) {
 			enum_count++;
-			if (out_resp->count_enum_blobs <= enum_count)
+			if (out_resp->count_enum_blobs < enum_count)
 				continue;
 
 			if (copy_to_user(&enum_ptr[copied].value,
Signature · 1 line
2.11.0
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx