diff options
author | 2023-02-17 17:51:40 -0800 | |
---|---|---|
committer | 2023-02-17 17:51:40 -0800 | |
commit | 38f8ccde04a3fa317b51b05e63c3cb57e1641931 (patch) | |
tree | e7218f09e839531036a37a899d1f025fd944daec /fs/nilfs2/super.c | |
parent | Merge tag 'powerpc-6.2-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux (diff) | |
parent | nilfs2: fix underflow in second superblock position calculations (diff) | |
download | wireguard-linux-38f8ccde04a3fa317b51b05e63c3cb57e1641931.tar.xz wireguard-linux-38f8ccde04a3fa317b51b05e63c3cb57e1641931.zip |
Merge tag 'mm-hotfixes-stable-2023-02-17-15-16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton:
"Six hotfixes. Five are cc:stable: four for MM, one for nilfs2.
Also a MAINTAINERS update"
* tag 'mm-hotfixes-stable-2023-02-17-15-16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
nilfs2: fix underflow in second superblock position calculations
hugetlb: check for undefined shift on 32 bit architectures
mm/migrate: fix wrongly apply write bit after mkdirty on sparc64
MAINTAINERS: update FPU EMULATOR web page
mm/MADV_COLLAPSE: set EAGAIN on unexpected page refcount
mm/filemap: fix page end in filemap_get_read_batch
Diffstat (limited to '')
-rw-r--r-- | fs/nilfs2/super.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 6edb6e0dd61f..1422b8ba24ed 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -409,6 +409,15 @@ int nilfs_resize_fs(struct super_block *sb, __u64 newsize) goto out; /* + * Prevent underflow in second superblock position calculation. + * The exact minimum size check is done in nilfs_sufile_resize(). + */ + if (newsize < 4096) { + ret = -ENOSPC; + goto out; + } + + /* * Write lock is required to protect some functions depending * on the number of segments, the number of reserved segments, * and so forth. |