Skip to content
Snippets Groups Projects
Select Git revision
  • 6eb864c1d9dd1ef32b88e03c3f49d8be0dab7dcf
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

security.c

Blame
  • security.c 45.07 KiB
    /*
     * Security plug functions
     *
     * Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com>
     * Copyright (C) 2001-2002 Greg Kroah-Hartman <greg@kroah.com>
     * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
     * Copyright (C) 2016 Mellanox Technologies
     *
     *	This program is free software; you can redistribute it and/or modify
     *	it under the terms of the GNU General Public License as published by
     *	the Free Software Foundation; either version 2 of the License, or
     *	(at your option) any later version.
     */
    
    #include <linux/bpf.h>
    #include <linux/capability.h>
    #include <linux/dcache.h>
    #include <linux/module.h>
    #include <linux/init.h>
    #include <linux/kernel.h>
    #include <linux/lsm_hooks.h>
    #include <linux/integrity.h>
    #include <linux/ima.h>
    #include <linux/evm.h>
    #include <linux/fsnotify.h>
    #include <linux/mman.h>
    #include <linux/mount.h>
    #include <linux/personality.h>
    #include <linux/backing-dev.h>
    #include <linux/string.h>
    #include <net/flow.h>
    
    #include <trace/events/initcall.h>
    
    #define MAX_LSM_EVM_XATTR	2
    
    /* Maximum number of letters for an LSM name string */
    #define SECURITY_NAME_MAX	10
    
    struct security_hook_heads security_hook_heads __lsm_ro_after_init;
    static ATOMIC_NOTIFIER_HEAD(lsm_notifier_chain);
    
    char *lsm_names;
    /* Boot-time LSM user choice */
    static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
    	CONFIG_DEFAULT_SECURITY;
    
    static void __init do_security_initcalls(void)
    {
    	int ret;
    	initcall_t *call;
    	call = __security_initcall_start;
    	trace_initcall_level("security");
    	while (call < __security_initcall_end) {
    		trace_initcall_start((*call));
    		ret = (*call) ();
    		trace_initcall_finish((*call), ret);
    		call++;
    	}
    }
    
    /**
     * security_init - initializes the security framework
     *
     * This should be called early in the kernel initialization sequence.
     */
    int __init security_init(void)
    {
    	int i;
    	struct hlist_head *list = (struct hlist_head *) &security_hook_heads;