drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 31 Oct 2017 11:55:35 +0000 (11:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:07:47 +0000 (11:07 +0100)
commit8c666e6471acb1fe33b6b88d95486ed2d548d944
treed9d9c328c43fad95982a62684d5e8c6d1c8fea02
parent3587188ad596da05a8dd691fc28ee56d335f41b8
drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all

commit d18d1a5ac811d12f7ebc1129230312b5f2c50cb8 upstream.

To acquire all modeset locks requires a ww_ctx to be allocated. As this
is the legacy path and the allocation small, to reduce the changes
required (and complex untested error handling) to the legacy drivers, we
simply assume that the allocation succeeds. At present, it relies on the
too-small-to-fail rule, but syzbot found that by injecting a failure
here we would hit the WARN. Document that this allocation must succeed
with __GFP_NOFAIL.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171031115535.15166-1-chris@chris-wilson.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_modeset_lock.c