Skip to content

Commit 313a335

Browse files
committed
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>
1 parent 1ec760f commit 313a335

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/coredump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ void vfs_coredump(const kernel_siginfo_t *siginfo)
10921092
size_t *argv __free(kfree) = NULL;
10931093
struct core_state core_state;
10941094
struct core_name cn;
1095-
struct mm_struct *mm = current->mm;
1095+
const struct mm_struct *mm = current->mm;
10961096
const struct linux_binfmt *binfmt = mm->binfmt;
10971097
const struct cred *old_cred;
10981098
int argc = 0;

include/linux/sched/coredump.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define SUID_DUMP_USER 1 /* Dump as user of process */
99
#define SUID_DUMP_ROOT 2 /* Dump as root */
1010

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)
1212
{
1313
/*
1414
* By convention, dumpable bits are contained in first 32 bits of the

0 commit comments

Comments
 (0)