]> www.infradead.org Git - users/dwmw2/linux.git/commit
pstore: Change kmsg_bytes storage size to u32
authorKees Cook <kees@kernel.org>
Thu, 6 Feb 2025 19:16:59 +0000 (11:16 -0800)
committerKees Cook <kees@kernel.org>
Mon, 10 Feb 2025 17:02:14 +0000 (09:02 -0800)
commit5674609535bafa834ab014d90d9bbe8e89223a0b
treec5aac0060de6ed60d9217ec72bacd9990bdfe384
parenta64dcfb451e254085a7daee5fe51bf22959d52d3
pstore: Change kmsg_bytes storage size to u32

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>
fs/pstore/inode.c
fs/pstore/internal.h
fs/pstore/platform.c