blob: 026fc267f7985ace23270628dae1e170c21c902e [file] [log] [blame]
Mauro Carvalho Chehab593733ab2019-06-12 14:52:52 -03001========================================
Paul Moore8802f612006-08-03 16:45:49 -07002NetLabel Linux Security Module Interface
Mauro Carvalho Chehab593733ab2019-06-12 14:52:52 -03003========================================
4
Paul Moore8802f612006-08-03 16:45:49 -07005Paul Moore, paul.moore@hp.com
6
7May 17, 2006
8
Mauro Carvalho Chehab593733ab2019-06-12 14:52:52 -03009Overview
10========
Paul Moore8802f612006-08-03 16:45:49 -070011
12NetLabel is a mechanism which can set and retrieve security attributes from
13network packets. It is intended to be used by LSM developers who want to make
14use of a common code base for several different packet labeling protocols.
15The NetLabel security module API is defined in 'include/net/netlabel.h' but a
16brief overview is given below.
17
Mauro Carvalho Chehab593733ab2019-06-12 14:52:52 -030018NetLabel Security Attributes
19============================
Paul Moore8802f612006-08-03 16:45:49 -070020
21Since NetLabel supports multiple different packet labeling protocols and LSMs
22it uses the concept of security attributes to refer to the packet's security
23labels. The NetLabel security attributes are defined by the
24'netlbl_lsm_secattr' structure in the NetLabel header file. Internally the
25NetLabel subsystem converts the security attributes to and from the correct
26low-level packet label depending on the NetLabel build time and run time
27configuration. It is up to the LSM developer to translate the NetLabel
28security attributes into whatever security identifiers are in use for their
29particular LSM.
30
Mauro Carvalho Chehab593733ab2019-06-12 14:52:52 -030031NetLabel LSM Protocol Operations
32================================
Paul Moore8802f612006-08-03 16:45:49 -070033
34These are the functions which allow the LSM developer to manipulate the labels
35on outgoing packets as well as read the labels on incoming packets. Functions
36exist to operate both on sockets as well as the sk_buffs directly. These high
37level functions are translated into low level protocol operations based on how
38the administrator has configured the NetLabel subsystem.
39
Mauro Carvalho Chehab593733ab2019-06-12 14:52:52 -030040NetLabel Label Mapping Cache Operations
41=======================================
Paul Moore8802f612006-08-03 16:45:49 -070042
43Depending on the exact configuration, translation between the network packet
44label and the internal LSM security identifier can be time consuming. The
45NetLabel label mapping cache is a caching mechanism which can be used to
46sidestep much of this overhead once a mapping has been established. Once the
Francis Galieguea33f3222010-04-23 00:08:02 +020047LSM has received a packet, used NetLabel to decode its security attributes,
Paul Moore8802f612006-08-03 16:45:49 -070048and translated the security attributes into a LSM internal identifier the LSM
49can use the NetLabel caching functions to associate the LSM internal
50identifier with the network packet's label. This means that in the future
51when a incoming packet matches a cached value not only are the internal
52NetLabel translation mechanisms bypassed but the LSM translation mechanisms are
53bypassed as well which should result in a significant reduction in overhead.