Skip to contentSkip to conversation

Intel xorg driver 2.20.2 overlay off-by-one bug

BUG Russell King - ARM Linux 2 participants 2 messages Aug 12, 2012 – Aug 13, 2012

lore
Share & tools
lore
#0 lore raw

While reading through the Intel driver code, I spotted this in I830SetPortAttributeOverlay:

        } else if (attribute == xvPipe) {
                xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
                if ((value < -1) || (value > xf86_config->num_crtc))
                        return BadValue;
                if (value < 0)
                        adaptor_priv->desired_crtc = NULL;
                else
                        adaptor_priv->desired_crtc = xf86_config->crtc[value];

This allows value == xf86_config->num_crtc to be valid, which would be the CRTC number _after_ the last one in the array. Presumably this is not desired, and the test should be ">=".

#1 lore raw
Quoted 12 lines · Russell King - ARM Linux

While reading through the Intel driver code, I spotted this in I830SetPortAttributeOverlay:

        } else if (attribute == xvPipe) {
                xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
                if ((value < -1) || (value > xf86_config->num_crtc))
                        return BadValue;
                if (value < 0)
                        adaptor_priv->desired_crtc = NULL;
                else
                        adaptor_priv->desired_crtc = xf86_config->crtc[value];
Quoted 3 lines

This allows value == xf86_config->num_crtc to be valid, which would be the CRTC number _after_ the last one in the array. Presumably this is not desired, and the test should be ">=".

Thanks for bringing this to our attention and poking Dave, who promptly pushed a patch to fix the bug.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre