File tree Expand file tree Collapse file tree 4 files changed +36
-6
lines changed
Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ static const struct file_operations lsm_ops = {
368368};
369369#endif
370370
371- static int __init securityfs_init (void )
371+ int __init securityfs_init (void )
372372{
373373 int retval ;
374374
@@ -387,4 +387,3 @@ static int __init securityfs_init(void)
387387#endif
388388 return 0 ;
389389}
390- core_initcall (securityfs_init );
Original file line number Diff line number Diff line change @@ -35,4 +35,24 @@ extern struct kmem_cache *lsm_inode_cache;
3535int lsm_cred_alloc (struct cred * cred , gfp_t gfp );
3636int lsm_task_alloc (struct task_struct * task );
3737
38+ /* LSM framework initializers */
39+
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+
49+ #ifdef CONFIG_SECURITYFS
50+ int securityfs_init (void );
51+ #else
52+ static inline int securityfs_init (void )
53+ {
54+ return 0 ;
55+ }
56+ #endif /* CONFIG_SECURITYFS */
57+
3858#endif /* _LSM_H_ */
Original file line number Diff line number Diff line change @@ -488,7 +488,12 @@ int __init security_init(void)
488488 */
489489static int __init security_initcall_pure (void )
490490{
491- return lsm_initcall (pure );
491+ int rc_adr , rc_lsm ;
492+
493+ rc_adr = min_addr_init ();
494+ rc_lsm = lsm_initcall (pure );
495+
496+ return (rc_adr ? rc_adr : rc_lsm );
492497}
493498pure_initcall (security_initcall_pure );
494499
@@ -506,7 +511,12 @@ early_initcall(security_initcall_early);
506511 */
507512static int __init security_initcall_core (void )
508513{
509- return lsm_initcall (core );
514+ int rc_sfs , rc_lsm ;
515+
516+ rc_sfs = securityfs_init ();
517+ rc_lsm = lsm_initcall (core );
518+
519+ return (rc_sfs ? rc_sfs : rc_lsm );
510520}
511521core_initcall (security_initcall_core );
512522
Original file line number Diff line number Diff line change 55#include <linux/sysctl.h>
66#include <linux/minmax.h>
77
8+ #include "lsm.h"
9+
810/* amount of vm to protect from userspace access by both DAC and the LSM*/
911unsigned long mmap_min_addr ;
1012/* amount of vm to protect from userspace using CAP_SYS_RAWIO (DAC) */
@@ -52,11 +54,10 @@ static const struct ctl_table min_addr_sysctl_table[] = {
5254 },
5355};
5456
55- static int __init init_mmap_min_addr (void )
57+ int __init min_addr_init (void )
5658{
5759 register_sysctl_init ("vm" , min_addr_sysctl_table );
5860 update_mmap_min_addr ();
5961
6062 return 0 ;
6163}
62- pure_initcall (init_mmap_min_addr );
You can’t perform that action at this time.
0 commit comments