deepin-kernel/fs/pstore
Kees Cook 48fd2e9749 pstore: Change kmsg_bytes storage size to u32
[ Upstream commit 5674609535 ]

The types around kmsg_bytes were inconsistent. The global was unsigned
long, the argument to pstore_set_kmsg_bytes() was int, and the filesystem
option was u32. Given other internal limits, there's not much sense
in making a single pstore record larger than INT_MAX and it can't be
negative, so use u32 everywhere. Additionally, use READ/WRITE_ONCE and a
local variable in pstore_dump() to avoid kmsg_bytes changing during a
dump.

Link: https://lore.kernel.org/r/20250206191655.work.798-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 7ef54a11c199d92e675b2895648b01c81c6339b0)
2025-06-10 16:17:57 +08:00
..
Kconfig pstore: Replace crypto API compression with zlib_deflate library calls 2023-07-17 16:08:58 -07:00
Makefile
blk.c pstore/blk: trivial typo fixes 2025-02-10 01:59:56 +08:00
ftrace.c pstore/ftrace: Allow immediate recording 2021-11-18 10:29:52 -08:00
inode.c pstore: Change kmsg_bytes storage size to u32 2025-06-10 16:17:57 +08:00
internal.h pstore: Change kmsg_bytes storage size to u32 2025-06-10 16:17:57 +08:00
platform.c pstore: Change kmsg_bytes storage size to u32 2025-06-10 16:17:57 +08: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 2024-02-05 20:14:16 +00:00
ram_core.c pstore: ram_core: fix possible overflow in persistent_ram_init_ecc() 2024-01-25 15:35:17 -08:00
ram_internal.h pstore/ram: Set freed addresses to NULL 2022-10-19 09:25:39 -07:00
zone.c pstore/zone: Add a null pointer check to the psz_kmsg_read 2024-04-13 13:07:31 +02:00