mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 16:16:15 -04:00
UPSTREAM: mm/gup: Mark lock taken only after a successful retake
It's definitely incorrect to mark the lock as taken even if
down_read_killable() failed.
This wass overlooked when we switched from down_read() to
down_read_killable() because down_read() won't fail while
down_read_killable() could.
Fixes: 71335f37c5e8 ("mm/gup: allow to react to fatal signals")
Reported-by: syzbot+a8c70b7f3579fc0587dc@syzkaller.appspotmail.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit c7b6a566b98524baea6a244186e665d22b633545)
Bug: 176847924
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Change-Id: Id0e1fe147e87ff6bba02d5e590f6346089c5e650
This commit is contained in:
parent
d67c1f7270
commit
79349abdcc
1 changed files with 1 additions and 1 deletions
2
mm/gup.c
2
mm/gup.c
|
|
@ -1099,7 +1099,6 @@ retry:
|
|||
if (fatal_signal_pending(current))
|
||||
break;
|
||||
|
||||
*locked = 1;
|
||||
ret = down_read_killable(&mm->mmap_sem);
|
||||
if (ret) {
|
||||
BUG_ON(ret > 0);
|
||||
|
|
@ -1108,6 +1107,7 @@ retry:
|
|||
break;
|
||||
}
|
||||
|
||||
*locked = 1;
|
||||
ret = __get_user_pages(tsk, mm, start, 1, flags | FOLL_TRIED,
|
||||
pages, NULL, locked);
|
||||
if (!*locked) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue