UP | HOME
2015-08-15 TOP | Slides

Linux Security Modules (LSM)

Table of Contents

1 LKM (Linux Kernel Modules)

  1. "Modules" of code that are needed in some installations and not in others. If needed always, compile/build as built-ins.
  2. Object code file, .ko extension; see /lib/modules/
  3. insmod loads a module; kernel address space expands, now includes the methods of the module; some of them are syscalls.
  4. rmmod unload the module; kernel no longer has the module and its methods.
  5. lsmod list the kernel module currently in the kernel
  6. Path name of where the modules are:
root@Sutherland:~# ls /lib/modules/4.12.0-12-generic/ -R | wc -l

8164

2 LSM (Linux Security Modules)

  1. Goal: Modularize security as much as possible. An LSM is an LKM.
  2. http://elixir.free-electrons.com/linux/latest/source/include/linux/security.h
  3. hooks := upcalls to a module's methods at security-critical points within the kernel
  4. An LSM author can control functions called by these hooks to enforce policies
  5. Linux also adds an opaque security pointer that LSM can use to store security info they need in processes, inodes, sockets, etc.
  6. LSM hooks are placed so that the Linux DAC checks are performed first, and only if they succeed, is LSM code invoked.

2.1 Access Control with LSM Module

lsm-access.jpg

Figure 1: Access Control with LSM Module

2.2 LSM #2

  1. https://www.kernel.org/doc/htmldocs/lsm/ General Security Hooks for Linux
  2. Despite LSM being developed as a security API, LSM provides hooks that could be used by rootkits. http://grsecurity.net/lsm.php

2.3 LSM #3

  1. Opaque Security Fields were added to objects
  2. Security Function Hooks were added in important accesses
  3. A security System Call was added
  4. Registering security modules
  5. Modify capabilities to reduce the capable call

2.4 LSM #4

  1. Additional hooks were provided for working with tasks (nice, kill, setuid)
  2. for program loading and controlling inheritance of state across program executions (such as file descriptors)
  3. for IPC
  4. for file ops (read, write, sockets)
  5. for network ops (devices, syscalls, sk-buffs)
  6. for module operations (create, register, delete)
  7. for sytem operations (hostname, accessing I/O ports, process accounting)

3 References

4 End


Copyright © 2015 pmateti@wright.eduwww.wright.edu/~pmateti 2015-08-15