]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - security/lock_down.c
KVM: SVM: Move spec control call after restore of GS
[mirror_ubuntu-artful-kernel.git] / security / lock_down.c
1 /* Lock down the kernel
2 *
3 * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12 #include <linux/security.h>
13 #include <linux/export.h>
14
15 static __read_mostly bool kernel_locked_down;
16
17 /*
18 * Put the kernel into lock-down mode.
19 */
20 void lock_kernel_down(void)
21 {
22 kernel_locked_down = true;
23 }
24
25 /*
26 * Take the kernel out of lockdown mode.
27 */
28 void lift_kernel_lockdown(void)
29 {
30 kernel_locked_down = false;
31 }
32
33 /**
34 * kernel_is_locked_down - Find out if the kernel is locked down
35 */
36 bool kernel_is_locked_down(void)
37 {
38 return kernel_locked_down;
39 }
40 EXPORT_SYMBOL(kernel_is_locked_down);