proc.5: Remove duplicated /proc/[pid]/gid_map entry
[man-pages.git] / man7 / kernel_lockdown.7
blob07ab829219178acf2d185dd1275feb64a071fde5
1 .\"
2 .\" Copyright (C) 2017 Red Hat, Inc. All Rights Reserved.
3 .\" Written by David Howells (dhowells@redhat.com)
4 .\"
5 .\" %%%LICENSE_START(GPLv2+_SW_ONEPARA)
6 .\" This program is free software; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License
8 .\" as published by the Free Software Foundation; either version
9 .\" 2 of the License, or (at your option) any later version.
10 .\" %%%LICENSE_END
11 .\"
12 .TH KERNEL_LOCKDOWN 7 2021-06-20 Linux "Linux Programmer's Manual"
13 .SH NAME
14 kernel_lockdown \- kernel image access prevention feature
15 .SH DESCRIPTION
16 The Kernel Lockdown feature is designed to prevent both direct and indirect
17 access to a running kernel image, attempting to protect against unauthorized
18 modification of the kernel image and to prevent access to security and
19 cryptographic data located in kernel memory, whilst still permitting driver
20 modules to be loaded.
21 .PP
22 If a prohibited or restricted feature is accessed or used, the kernel will emit
23 a message that looks like:
24 .PP
25 .RS
26  Lockdown: X: Y is restricted, see man kernel_lockdown.7
27 .RE
28 .PP
29 where X indicates the process name and Y indicates what is restricted.
30 .PP
31 On an EFI-enabled x86 or arm64 machine, lockdown will be automatically enabled
32 if the system boots in EFI Secure Boot mode.
33 .\"
34 .SS Coverage
35 When lockdown is in effect, a number of features are disabled or have their
36 use restricted.
37 This includes special device files and kernel services that allow
38 direct access of the kernel image:
39 .PP
40 .RS
41 /dev/mem
42 .br
43 /dev/kmem
44 .br
45 /dev/kcore
46 .br
47 /dev/ioports
48 .br
49 BPF
50 .br
51 kprobes
52 .RE
53 .PP
54 and the ability to directly configure and control devices, so as to prevent
55 the use of a device to access or modify a kernel image:
56 .IP \(bu 2
57 The use of module parameters that directly specify hardware parameters to
58 drivers through the kernel command line or when loading a module.
59 .IP \(bu
60 The use of direct PCI BAR access.
61 .IP \(bu
62 The use of the ioperm and iopl instructions on x86.
63 .IP \(bu
64 The use of the KD*IO console ioctls.
65 .IP \(bu
66 The use of the TIOCSSERIAL serial ioctl.
67 .IP \(bu
68 The alteration of MSR registers on x86.
69 .IP \(bu
70 The replacement of the PCMCIA CIS.
71 .IP \(bu
72 The overriding of ACPI tables.
73 .IP \(bu
74 The use of ACPI error injection.
75 .IP \(bu
76 The specification of the ACPI RDSP address.
77 .IP \(bu
78 The use of ACPI custom methods.
79 .PP
80 Certain facilities are restricted:
81 .IP \(bu 2
82 Only validly signed modules may be loaded (waived if the module file being
83 loaded is vouched for by IMA appraisal).
84 .IP \(bu
85 Only validly signed binaries may be kexec'd (waived if the binary image file
86 to be executed is vouched for by IMA appraisal).
87 .IP \(bu
88 Unencrypted hibernation/suspend to swap are disallowed as the kernel image is
89 saved to a medium that can then be accessed.
90 .IP \(bu
91 Use of debugfs is not permitted as this allows a whole range of actions
92 including direct configuration of, access to and driving of hardware.
93 .IP \(bu
94 IMA requires the addition of the "secure_boot" rules to the policy,
95 whether or not they are specified on the command line,
96 for both the built-in and custom policies in secure boot lockdown mode.
97 .SH VERSIONS
98 The Kernel Lockdown feature was added in Linux 5.4.
99 .SH NOTES
100 The Kernel Lockdown feature is enabled by CONFIG_SECURITY_LOCKDOWN_LSM.
102 .I lsm=lsm1,...,lsmN
103 command line parameter controls the sequence of the initialization of
104 Linux Security Modules.
105 It must contain the string
106 .I lockdown
107 to enable the Kernel Lockdown feature.
108 If the command line parameter is not specified,
109 the initialization falls back to the value of the deprecated
110 .I security=
111 command line parameter and further to the value of CONFIG_LSM.
112 .\" commit 000d388ed3bbed745f366ce71b2bb7c2ee70f449