Skip to content

Commit 0b2c8f8

Browse files
committed
i915: fix missing user_access_end() in page fault exception case
When commit fddcd00 ("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 96d4f26 ("Remove 'type' argument from access_ok() function"). Fixes: fddcd00 ("drm/i915: Force the slow path after a user-write error") Cc: Chris Wilson <[email protected]> Cc: Joonas Lahtinen <[email protected]> Cc: [email protected] # v4.20 Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4caf4eb commit 0b2c8f8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/i915/i915_gem_execbuffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb)
16051605
(char __user *)urelocs + copied,
16061606
len)) {
16071607
end_user:
1608+
user_access_end();
16081609
kvfree(relocs);
16091610
err = -EFAULT;
16101611
goto err;

0 commit comments

Comments
 (0)