linux-stable/fs/pstore
Kees Cook 340682ed19 pstore: inode: Only d_invalidate() is needed
[ Upstream commit a43e0fc5e9 ]

Unloading a modular pstore backend with records in pstorefs would
trigger the dput() double-drop warning:

  WARNING: CPU: 0 PID: 2569 at fs/dcache.c:762 dput.part.0+0x3f3/0x410

Using the combo of d_drop()/dput() (as mentioned in
Documentation/filesystems/vfs.rst) isn't the right approach here, and
leads to the reference counting problem seen above. Use d_invalidate()
and update the code to not bother checking for error codes that can
never happen.

Suggested-by: Alexander Viro <viro@zeniv.linux.org.uk>
Fixes: 609e28bb13 ("pstore: Remove filesystem records when backend is unregistered")
Signed-off-by: Kees Cook <keescook@chromium.org>
2024-03-26 18:16:49 -04:00
..
Kconfig pstore: Replace crypto API compression with zlib_deflate library calls 2023-07-17 16:08:58 -07:00
Makefile pstore/blk: Introduce backend for block devices 2020-05-30 10:34:03 -07:00
blk.c init: improve the name_to_dev_t interface 2023-06-05 10:56:46 -06:00
ftrace.c pstore/ftrace: Allow immediate recording 2021-11-18 10:29:52 -08:00
inode.c pstore: inode: Only d_invalidate() is needed 2024-03-26 18:16:49 -04:00
internal.h pstore: Move kmsg_bytes default into Kconfig 2020-12-01 12:09:17 -08:00
platform.c pstore/platform: Add check for kstrdup 2023-10-12 09:47:01 -07:00
pmsg.c pstore update for v6.4-rc1 2023-04-27 17:03:40 -07:00
ram.c pstore/ram: Fix crash when setting number of cpus to an odd number 2023-12-08 14:15:00 -08:00
ram_core.c pstore: ram_core: fix possible overflow in persistent_ram_init_ecc() 2023-12-08 14:15:00 -08:00
ram_internal.h pstore/ram: Set freed addresses to NULL 2022-10-19 09:25:39 -07:00
zone.c pstore/zone: Use GFP_ATOMIC to allocate zone buffer 2022-10-17 13:14:10 -07:00