No description
Find a file
Chao Yu 250e5a6be5 f2fs: fix to do sanity check on inline_dots inode
[ Upstream commit 12662d1946 ]

As Wenqing reported in bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=215765

It will cause a kernel panic with steps:
- mkdir mnt
- mount tmp40.img mnt
- ls mnt

folio_mark_dirty+0x33/0x50
f2fs_add_regular_entry+0x541/0xad0 [f2fs]
f2fs_add_dentry+0x6c/0xb0 [f2fs]
f2fs_do_add_link+0x182/0x230 [f2fs]
__recover_dot_dentries+0x2d6/0x470 [f2fs]
f2fs_lookup+0x5af/0x6a0 [f2fs]
__lookup_slow+0xac/0x200
lookup_slow+0x45/0x70
walk_component+0x16c/0x250
path_lookupat+0x8b/0x1f0
filename_lookup+0xef/0x250
user_path_at_empty+0x46/0x70
vfs_statx+0x98/0x190
__do_sys_newlstat+0x41/0x90
__x64_sys_newlstat+0x1a/0x30
do_syscall_64+0x37/0xb0
entry_SYSCALL_64_after_hwframe+0x44/0xae

The root cause is for special file: e.g. character, block, fifo or
socket file, f2fs doesn't assign address space operations pointer array
for mapping->a_ops field, so, in a fuzzed image, if inline_dots flag was
tagged in special file, during lookup(), when f2fs runs into
__recover_dot_dentries(), it will cause NULL pointer access once
f2fs_add_regular_entry() calls a_ops->set_dirty_page().

Fixes: 510022a858 ("f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries")
Reported-by: Wenqing Liu <wenqingliu0120@gmail.com>
Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:23:13 +02:00
arch KVM: LAPIC: Drop pending LAPIC timer injection when canceling the timer 2022-06-09 10:23:13 +02:00
block bfq: Allow current waker to defend against a tentative one 2022-06-09 10:23:01 +02:00
certs certs: Add support for using elliptic curve keys for signing modules 2021-08-23 19:55:42 +03:00
crypto crypto: cryptd - Protect per-CPU resource by disabling BH. 2022-06-09 10:23:11 +02:00
Documentation f2fs: support fault injection for dquot_initialize() 2022-06-09 10:23:13 +02:00
drivers OPP: call of_node_put() on error path in _bandwidth_supported() 2022-06-09 10:23:13 +02:00
fs f2fs: fix to do sanity check on inline_dots inode 2022-06-09 10:23:13 +02:00
include mailbox: forward the hrtimer if not queued and under a lock 2022-06-09 10:23:12 +02:00
init random: handle latent entropy and command line from random_init() 2022-05-30 09:29:16 +02:00
ipc ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() 2022-06-09 10:23:10 +02:00
kernel dma-direct: don't over-decrypt memory 2022-06-09 10:23:03 +02:00
lib kunit: fix debugfs code to use enum kunit_status, not bool 2022-06-09 10:22:53 +02:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm zsmalloc: fix races between asynchronous zspage free and page migration 2022-06-06 08:43:39 +02:00
net net/smc: postpone sk_refcnt increment in connect() 2022-06-09 10:23:03 +02:00
samples samples: bpf: Don't fail for a missing VMLINUX_BTF when VMLINUX_H is provided 2022-06-09 10:22:55 +02:00
scripts scripts/faddr2line: Fix overlapping text section failures 2022-06-09 10:22:57 +02:00
security lockdown: also lock down previous kgdb use 2022-05-25 09:57:37 +02:00
sound ASoC: atmel-classd: Remove endianness flag on class d component 2022-06-09 10:23:10 +02:00
tools selftests/bpf: Add missed ima_setup.sh in Makefile 2022-06-09 10:23:00 +02:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2022-02-01 17:27:15 +01:00
virt KVM: avoid NULL pointer dereference in kvm_dirty_ring_push 2022-04-13 20:59:26 +02:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS MAINTAINERS: add git tree for random.c 2022-05-30 09:28:59 +02:00
Makefile Linux 5.15.45 2022-06-06 08:43:42 +02:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.