drm/msm: protect against faults from copy_from_user() in submit ioctl

commit d78d383ab3 upstream.

An evil userspace could try to cause deadlock by passing an unfaulted-in
GEM bo as submit->bos (or submit->cmds) table.  Which will trigger
msm_gem_fault() while we already hold struct_mutex.  See:

https://github.com/freedreno/msmtest/blob/master/evilsubmittest.c

Signed-off-by: Rob Clark <robdclark@gmail.com>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Rob Clark 2016-08-22 15:28:38 -04:00 • committed by Ben Hutchings
commit 1cc8a445b0
3 changed files with 18 additions and 0 deletions