Skip to contentSkip to conversation

drm/i915: Reject undefined colorkey flags

PATCH In review Ville Syrjala 3 participants 4 messages Feb 6, 2018

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

PATCH 1/1 drm/i915: Reject undefined colorkey flags

From: Ville Syrjälä <[email protected]>

Check that userspace isn't passing in garbage in the colorkey ioctl flags.

---
 drivers/gpu/drm/i915/intel_sprite.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_sprite.c +3 -0
index 3be22c0fcfb5..12a9536d7b7a 100644
@@ -1077,6 +1077,9 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
 	/* ignore the pointless "none" flag */
 	set->flags &= ~I915_SET_COLORKEY_NONE;
 
+	if (set->flags & ~(I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE))
+		return -EINVAL;
+
 	/* Make sure we don't try to enable both src & dest simultaneously */
 	if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE))
 		return -EINVAL;
Signature · 6 lines
2.13.6

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

✓ Fi.CI.BAT: success for drm/i915: Reject undefined colorkey flags

== Series Details ==

== Series Details ==

Series: drm/i915: Reject undefined colorkey flags
URL : https://patchwork.freedesktop.org/series/37764/
State : success

== Summary ==

Series 37764v1 drm/i915: Reject undefined colorkey flags
https://patchwork.freedesktop.org/api/1.0/series/37764/revisions/1/mbox/

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:417s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:422s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:379s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:488s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:480s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:483s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:467s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:454s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:566s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:565s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:409s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:282s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:512s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:390s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:404s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:409s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:457s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:454s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:492s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:450s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:499s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:590s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:428s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:527s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:488s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:479s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:414s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:429s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:513s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:393s

Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:471s

078873da383505cf8d6940229007115b31f1d5e0 drm-tip: 2018y-02m-06d-11h-21m-36s UTC integration manifest 868a33e89cff drm/i915: Reject undefined colorkey flags

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7914/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Ville Syrjala

Quoting Ville Syrjala (2018-02-06 20:43:33)

Quoted 6 lines

From: Ville Syrjälä <[email protected]>

Check that userspace isn't passing in garbage in the colorkey ioctl flags.

I think we can retrospectively apply this filter. Afaict, only the ddx ever hooked up this interface.

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

#3 lore raw

✓ Fi.CI.IGT: success for drm/i915: Reject undefined colorkey flags

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm/i915: Reject undefined colorkey flags
URL : https://patchwork.freedesktop.org/series/37764/
State : success

== Summary ==

Test perf:

        Subgroup enable-disable:
                fail       -> PASS       (shard-apl) fdo#103715
        Subgroup buffer-fill:
                fail       -> PASS       (shard-apl) fdo#103755
Test kms_mmap_write_crc:
                skip       -> PASS       (shard-apl)
Test gem_eio:
        Subgroup in-flight-contexts:
                pass       -> DMESG-WARN (shard-snb) fdo#104058
Test gem_exec_schedule:
        Subgroup reorder-wide-vebox:
                incomplete -> PASS       (shard-apl) fdo#102848

fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#102848 https://bugs.freedesktop.org/show_bug.cgi?id=102848

shard-apl        total:3383 pass:1753 dwarn:1   dfail:0   fail:20  skip:1608 time:12195s
shard-hsw        total:3442 pass:1758 dwarn:1   dfail:0   fail:11  skip:1671 time:11787s
shard-snb        total:3442 pass:1350 dwarn:2   dfail:0   fail:10  skip:2080 time:6558s

Blacklisted hosts:
shard-kbl total:3442 pass:1898 dwarn:10 dfail:1 fail:23 skip:1510 time:9658s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7914/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx