From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, hughd@google.com,
herbert.van.den.bergh@oracle.com, chris.mason@oracle.com,
akpm@linux-foundation.org, linmiaohe@huawei.com,
akpm@linux-foundation.org
Subject: [merged] mm-mlock-fix-potential-imbalanced-rlimit-ucounts-adjustment.patch removed from -mm tree
Date: Thu, 24 Mar 2022 18:31:54 -0700 [thread overview]
Message-ID: <20220325013154.B3C9EC340EC@smtp.kernel.org> (raw)
The patch titled
Subject: mm/mlock: fix potential imbalanced rlimit ucounts adjustment
has been removed from the -mm tree. Its filename was
mm-mlock-fix-potential-imbalanced-rlimit-ucounts-adjustment.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Miaohe Lin <linmiaohe@huawei.com>
Subject: 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>
---
mm/mlock.c | 1 +
1 file changed, 1 insertion(+)
--- a/mm/mlock.c~mm-mlock-fix-potential-imbalanced-rlimit-ucounts-adjustment
+++ a/mm/mlock.c
@@ -839,6 +839,7 @@ int user_shm_lock(size_t size, struct uc
}
if (!get_ucounts(ucounts)) {
dec_rlimit_ucounts(ucounts, UCOUNT_RLIMIT_MEMLOCK, locked);
+ allowed = 0;
goto out;
}
allowed = 1;
_
Patches currently in -mm which might be from linmiaohe@huawei.com are
mm-huge_memory-make-is_transparent_hugepage-static.patch
reply other threads:[~2022-03-25 1:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220325013154.B3C9EC340EC@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=chris.mason@oracle.com \
--cc=herbert.van.den.bergh@oracle.com \
--cc=hughd@google.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.