]> git.baikalelectronics.ru Git - kernel.git/commit
drm: close race in connector registration (v2)
authorDave Airlie <airlied@redhat.com>
Thu, 24 Jul 2014 01:53:45 +0000 (11:53 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 4 Aug 2014 06:54:02 +0000 (16:54 +1000)
commit8b001d8d8b45faf7f68ef6ad192d81c75cde2fe5
tree94e29c96825e2a90dd6a103caf07585eed8e49c6
parentfdb2f7de479479182ea1ffc2183c15c318b6b104
drm: close race in connector registration (v2)

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: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_crtc.c