Skip to content

Commit dee65f7

Browse files
committed
Merge tag 'lsm-pr-20260202' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm
Pull lsm fix from Paul Moore: "A small patch to address a regression found in the v6.19-rcX releases where the /proc/sys/vm/mmap_min_addr tunable disappeared when CONFIG_SECURITY was not selected. Long term we plan to work with the MM folks to get the core parts of this moved over to the MM subsystem, but in the meantime we need to fix this regression prior to the v6.19 release" * tag 'lsm-pr-20260202' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: lsm: preserve /proc/sys/vm/mmap_min_addr when !CONFIG_SECURITY
2 parents 18f7fcd + bdde21d commit dee65f7

3 files changed

Lines changed: 3 additions & 18 deletions

File tree

security/lsm.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ int lsm_task_alloc(struct task_struct *task);
3737

3838
/* LSM framework initializers */
3939

40-
#ifdef CONFIG_MMU
41-
int min_addr_init(void);
42-
#else
43-
static inline int min_addr_init(void)
44-
{
45-
return 0;
46-
}
47-
#endif /* CONFIG_MMU */
48-
4940
#ifdef CONFIG_SECURITYFS
5041
int securityfs_init(void);
5142
#else

security/lsm_init.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,7 @@ int __init security_init(void)
489489
*/
490490
static int __init security_initcall_pure(void)
491491
{
492-
int rc_adr, rc_lsm;
493-
494-
rc_adr = min_addr_init();
495-
rc_lsm = lsm_initcall(pure);
496-
497-
return (rc_adr ? rc_adr : rc_lsm);
492+
return lsm_initcall(pure);
498493
}
499494
pure_initcall(security_initcall_pure);
500495

security/min_addr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include <linux/sysctl.h>
66
#include <linux/minmax.h>
77

8-
#include "lsm.h"
9-
108
/* amount of vm to protect from userspace access by both DAC and the LSM*/
119
unsigned long mmap_min_addr;
1210
/* amount of vm to protect from userspace using CAP_SYS_RAWIO (DAC) */
@@ -54,10 +52,11 @@ static const struct ctl_table min_addr_sysctl_table[] = {
5452
},
5553
};
5654

57-
int __init min_addr_init(void)
55+
static int __init mmap_min_addr_init(void)
5856
{
5957
register_sysctl_init("vm", min_addr_sysctl_table);
6058
update_mmap_min_addr();
6159

6260
return 0;
6361
}
62+
pure_initcall(mmap_min_addr_init);

0 commit comments

Comments
 (0)