]> git.baikalelectronics.ru Git - kernel.git/commit
i915: fix missing user_access_end() in page fault exception case
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Jan 2019 18:23:10 +0000 (10:23 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Jan 2019 18:23:10 +0000 (10:23 -0800)
commitaff65e2cb3375dcadd6fb43b52a091be14b22a7e
tree95a14a18c3c478838aa72a07f55f1db829d813ba
parent54ff3e00d32189ad5636fd837dae46646c0c374d
i915: fix missing user_access_end() in page fault exception case

When commit ae5ce2045639 ("drm/i915: Force the slow path after a
user-write error") unified the error handling for various user access
problems, it didn't do the user_access_end() that is needed for the
unsafe_put_user() case.

It's not a huge deal: a missed user_access_end() will only mean that
SMAP protection isn't active afterwards, and for the error case we'll be
returning to user mode soon enough anyway.  But it's wrong, and adding
the proper user_access_end() is trivial enough (and doing it for the
other error cases where it isn't needed doesn't hurt).

I noticed it while doing the same prep-work for changing
user_access_begin() that precipitated the access_ok() changes in commit
2fb4498d8456 ("Remove 'type' argument from access_ok() function").

Fixes: ae5ce2045639 ("drm/i915: Force the slow path after a user-write error")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@kernel.org # v4.20
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpu/drm/i915/i915_gem_execbuffer.c