summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/python_version.py
diff options
context:
space:
mode:
authorKazuki Hanai <hnkz.64@gmail.com>2026-10-02 17:13:03 +0900
committerAndrew Morton <akpm@linux-foundation.org>2026-10-08 23:06:52 -0700
commit9463bc0691968a3c7e21f2a02f62e7868eb8f13e (patch)
tree3517b74d16fcaeec45548f750f627857f83d9d8c /tools/lib/python/kdoc/python_version.py
parentddf3b663ceea4a042686db8a6731120f116b28c2 (diff)
downloadlinux-next-9463bc0691968a3c7e21f2a02f62e7868eb8f13e.tar.gz
linux-next-9463bc0691968a3c7e21f2a02f62e7868eb8f13e.zip
tmpfs: fix unicode_map leaks in casefold option handling
shmem_parse_opt_casefold() stores the unicode_map returned by utf8_load() in ctx->encoding. A filesystem context can receive the casefold parameter more than once, and a second successful parse overwrites the stored map without releasing it. The map is also leaked when an unmounted filesystem context is freed. This includes the temporary context used for remount, because shmem_reconfigure() does not take ownership of ctx->encoding. Reject a second casefold setting, clear ctx->encoding after transferring ownership to the superblock, and release any remaining map from shmem_free_fc(). An unprivileged user can repeatedly create tmpfs filesystem contexts, set the casefold parameter, and close them from a user namespace. This causes unbounded kernel memory consumption and can result in a local denial of service. Link: https://lore.kernel.org/20261002081306.637148-1-hnkz.64@gmail.com Fixes: 58e55efd6c72 ("tmpfs: Add casefold lookup support") Signed-off-by: Kazuki Hanai <hnkz.64@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Suggested-by: Gabriel Krisman Bertazi <gabriel@krisman.be> Cc: Hugh Dickins <hughd@google.com> Cc: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: André Almeida <andrealmeid@igalia.com> Cc: Christian Brauner <brauner@kernel.org> Cc: <stable@vger.kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions