linux/fs/nilfs2
Ryusuke Konishi f9c96351aa nilfs2: fix potential oob read in nilfs_btree_check_delete()
The function nilfs_btree_check_delete(), which checks whether degeneration
to direct mapping occurs before deleting a b-tree entry, causes memory
access outside the block buffer when retrieving the maximum key if the
root node has no entries.

This does not usually happen because b-tree mappings with 0 child nodes
are never created by mkfs.nilfs2 or nilfs2 itself.  However, it can happen
if the b-tree root node read from a device is configured that way, so fix
this potential issue by adding a check for that case.

Link: https://lkml.kernel.org/r/20240904081401.16682-4-konishi.ryusuke@gmail.com
Fixes: 17c76b0104 ("nilfs2: B-tree based block mapping")
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: Lizhi Xu <lizhi.xu@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-09-09 16:47:42 -07:00
..
alloc.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 19:30:16 -07:00
alloc.h nilfs2: fix incorrect kernel-doc declaration of nilfs_palloc_req structure 2024-09-01 20:43:36 -07:00
bmap.c nilfs2: fix missing initial short descriptions of kernel-doc comments 2024-09-01 20:43:37 -07:00
bmap.h nilfs2: use the BITS_PER_LONG macro 2024-09-01 20:43:42 -07:00
btnode.c nilfs2: improve kernel-doc comments for b-tree node helpers 2024-09-01 20:43:36 -07:00
btnode.h fs/nilfs2: Use the enum req_op and blk_opf_t types 2022-07-14 12:14:33 -06:00
btree.c nilfs2: fix potential oob read in nilfs_btree_check_delete() 2024-09-09 16:47:42 -07:00
btree.h nilfs2: add missing description of nilfs_btree_path structure 2024-09-01 20:43:36 -07:00
cpfile.c nilfs2: treat missing cpfile header block as metadata corruption 2024-09-01 20:43:39 -07:00
cpfile.h nilfs2: remove nilfs_cpfile_{get,put}_checkpoint() 2024-02-22 15:38:53 -08:00
dat.c nilfs2: fix missing initial short descriptions of kernel-doc comments 2024-09-01 20:43:37 -07:00
dat.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
dir.c nilfs2: use common implementation of file type 2024-09-01 20:43:42 -07:00
direct.c nilfs2: fix failure to detect DAT corruption in btree and direct mappings 2024-03-14 09:17:29 -07:00
direct.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
export.h
file.c nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() 2024-02-07 21:20:36 -08:00
gcinode.c nilfs2: add kernel-doc comments to nilfs_remove_all_gcinodes() 2024-04-25 21:07:08 -07:00
ifile.c nilfs2: fix incorrect inode allocation from reserved inodes 2024-07-03 19:30:16 -07:00
ifile.h nilfs2: localize highmem mapping for checkpoint reading within cpfile 2024-02-22 15:38:53 -08:00
inode.c nilfs2: do not repair reserved inode bitmap in nilfs_new_inode() 2024-09-01 20:43:43 -07:00
ioctl.c nilfs2: add missing argument descriptions for ioctl-related helpers 2024-09-01 20:43:35 -07:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile
mdt.c nilfs2: do not output warnings when clearing dirty buffers 2024-09-01 20:43:35 -07:00
mdt.h nilfs2: fix lockdep warnings during disk space reclamation 2022-04-01 11:46:09 -07:00
namei.c misc cleanups (the part that hadn't been picked by individual fs trees) 2024-01-11 20:23:50 -08:00
nilfs.h nilfs2: separate inode type information from i_state field 2024-09-01 20:43:43 -07:00
page.c nilfs2: do not output warnings when clearing dirty buffers 2024-09-01 20:43:35 -07:00
page.h nilfs2: do not output warnings when clearing dirty buffers 2024-09-01 20:43:35 -07:00
recovery.c nilfs2: do not propagate ENOENT error from sufile during recovery 2024-09-01 20:43:39 -07:00
segbuf.c nilfs2: convert segment buffer to use kmap_local 2024-02-22 15:38:53 -08:00
segbuf.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
segment.c nilfs2: refactor nilfs_segctor_thread() 2024-09-01 20:43:44 -07:00
segment.h nilfs2: use kthread_create and kthread_stop for the log writer thread 2024-09-01 20:43:44 -07:00
sufile.c nilfs2: do not propagate ENOENT error from nilfs_sufile_mark_dirty() 2024-09-01 20:43:40 -07:00
sufile.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
super.c nilfs2: separate inode type information from i_state field 2024-09-01 20:43:43 -07:00
sysfs.c nilfs2: Constify struct kobj_type 2024-07-12 16:39:52 -07:00
sysfs.h nilfs2: remove filenames from file comments 2021-11-09 10:02:52 -08:00
the_nilfs.c nilfs2: eliminate the shared counter and spinlock for i_generation 2024-09-01 20:43:43 -07:00
the_nilfs.h nilfs2: eliminate the shared counter and spinlock for i_generation 2024-09-01 20:43:43 -07:00