]> www.infradead.org Git - users/jedix/linux-maple.git/commit
shmem: restrict noswap option to initial user namespace
authorChristian Brauner <brauner@kernel.org>
Thu, 20 Apr 2023 08:57:43 +0000 (10:57 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 21 Apr 2023 23:07:58 +0000 (16:07 -0700)
commit718b590b8e844b6714168edca82c5300562f188e
treedfa7066068929fd52361b9d9bbab157851557de4
parent8941149d4363beeba9ebb8dd3031234a87057515
shmem: restrict noswap option to initial user namespace

Prevent tmpfs instances mounted in an unprivileged namespaces from evading
accounting of locked memory by using the "noswap" mount option.

Link: https://lkml.kernel.org/r/20230420-faxen-advokat-40abb4c1a152@brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
Reported-by: Hugh Dickins <hughd@google.com>
Link: https://lore.kernel.org/lkml/79eae9fe-7818-a65c-89c6-138b55d609a@google.com
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Cc: Adam Manzanares <a.manzanares@samsung.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Kees Cook <keescook@chromium.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Pankaj Raghav <p.raghav@samsung.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/shmem.c