diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2022-03-22 14:44:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-03-22 15:57:07 -0700 |
commit | 5c2a956c3eea173b2bc89f632507c0eeaebf6c4a (patch) | |
tree | 8bf905d8e1f63679182309b8679b82bdeec54882 /drivers/hwmon/Makefile | |
parent | 1e7a8181640a620300e98e22223ca3445b349840 (diff) | |
download | linux-5c2a956c3eea173b2bc89f632507c0eeaebf6c4a.tar.gz linux-5c2a956c3eea173b2bc89f632507c0eeaebf6c4a.tar.bz2 linux-5c2a956c3eea173b2bc89f632507c0eeaebf6c4a.zip |
mm/mlock: fix potential imbalanced rlimit ucounts adjustment
user_shm_lock forgets to set allowed to 0 when get_ucounts fails. So
the later user_shm_unlock might do the extra dec_rlimit_ucounts. Fix
this by resetting allowed to 0.
Link: https://lkml.kernel.org/r/20220310132417.41189-1-linmiaohe@huawei.com
Fixes: d7c9e99aee48 ("Reimplement RLIMIT_MEMLOCK on top of ucounts")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Herbert van den Bergh <herbert.van.den.bergh@oracle.com>
Cc: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon/Makefile')
0 files changed, 0 insertions, 0 deletions