• Dave Airlie's avatar
    drm: close race in connector registration (v2) · 2ee39452
    Dave Airlie authored
    Daniel pointed out with hotplug that userspace could be trying to oops us
    as root for lols, and that to be correct we shouldn't register the object
    with the idr before we have fully set the connector object up.
    
    His proposed solution was a lot more life changing, this seemed like a simpler
    proposition to me, get the connector object id from the idr, but don't
    register the object until the drm_connector_register callback.
    
    The open question is whether the drm_mode_object_register needs a bigger lock
    than just the idr one, but I can't see why it would, but I can be locking
    challenged.
    
    v2: fix bool noreg into sane - add comment.
    Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
    Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
    2ee39452
drm_crtc.c 133 KB