mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
fs/erofs/decompressor_lzma.c sizes the module-global MicroLZMA stream
pool from num_possible_cpus() when the lzma_streams module parameter is
unset, then z_erofs_load_lzma_config() preallocates one image-supplied
dictionary per stream, accepting dictionaries up to 8 MiB. On high-CPU
systems, a small EROFS image can pin hundreds of MiB of vmalloc-backed
decoder state until the erofs module is unloaded.
Impact: An EROFS image mounted by the system can pin up to 8 MiB of
vmalloc memory per LZMA stream, either as intended or unexpectedly.
Bound the default stream count by a new
CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS option, default 16, so the
worst-case default preallocation is 128 MiB if the number of CPUs is no
less than 16 while preserving the existing per-image dictionary limit.
An explicit lzma_streams module parameter is still honoured as-is, so
administrators who deliberately size the pool are not affected.
Fixes:
|
||
|---|---|---|
| .. | ||
| compress.h | ||
| data.c | ||
| decompressor_crypto.c | ||
| decompressor_deflate.c | ||
| decompressor_lzma.c | ||
| decompressor_zstd.c | ||
| decompressor.c | ||
| dir.c | ||
| erofs_fs.h | ||
| fileio.c | ||
| inode.c | ||
| internal.h | ||
| ishare.c | ||
| Kconfig | ||
| Makefile | ||
| namei.c | ||
| super.c | ||
| sysfs.c | ||
| xattr.c | ||
| xattr.h | ||
| zdata.c | ||
| zmap.c | ||
| zutil.c | ||