Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

coredump: mark struct mm_struct as const

We don't actually modify it.

Link: https://patch.msgid.link/20251103-work-creds-guards-prepare_creds-v1-7-b447b82f2c9b@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

+2 -2
+1 -1
fs/coredump.c
··· 1092 1092 size_t *argv __free(kfree) = NULL; 1093 1093 struct core_state core_state; 1094 1094 struct core_name cn; 1095 - struct mm_struct *mm = current->mm; 1095 + const struct mm_struct *mm = current->mm; 1096 1096 const struct linux_binfmt *binfmt = mm->binfmt; 1097 1097 const struct cred *old_cred; 1098 1098 int argc = 0;
+1 -1
include/linux/sched/coredump.h
··· 8 8 #define SUID_DUMP_USER 1 /* Dump as user of process */ 9 9 #define SUID_DUMP_ROOT 2 /* Dump as root */ 10 10 11 - static inline unsigned long __mm_flags_get_dumpable(struct mm_struct *mm) 11 + static inline unsigned long __mm_flags_get_dumpable(const struct mm_struct *mm) 12 12 { 13 13 /* 14 14 * By convention, dumpable bits are contained in first 32 bits of the