diff options
-rw-r--r-- | security/selinux/include/security.h | 3 | ||||
-rw-r--r-- | security/selinux/ss/status.c | 15 |
2 files changed, 7 insertions, 11 deletions
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h index e390e31bb4bf..4b66f19bb1f3 100644 --- a/security/selinux/include/security.h +++ b/security/selinux/include/security.h | |||
@@ -197,8 +197,7 @@ const char *security_get_initial_sid_context(u32 sid); | |||
197 | extern struct page *selinux_kernel_status_page(void); | 197 | extern struct page *selinux_kernel_status_page(void); |
198 | 198 | ||
199 | #define SELINUX_KERNEL_STATUS_VERSION 1 | 199 | #define SELINUX_KERNEL_STATUS_VERSION 1 |
200 | struct selinux_kernel_status | 200 | struct selinux_kernel_status { |
201 | { | ||
202 | u32 version; /* version number of thie structure */ | 201 | u32 version; /* version number of thie structure */ |
203 | u32 sequence; /* sequence number of seqlock logic */ | 202 | u32 sequence; /* sequence number of seqlock logic */ |
204 | u32 enforcing; /* current setting of enforcing mode */ | 203 | u32 enforcing; /* current setting of enforcing mode */ |
diff --git a/security/selinux/ss/status.c b/security/selinux/ss/status.c index 5d9b225f8568..d982365f9d1a 100644 --- a/security/selinux/ss/status.c +++ b/security/selinux/ss/status.c | |||
@@ -35,7 +35,7 @@ | |||
35 | * In most cases, application shall confirm the kernel status is not | 35 | * In most cases, application shall confirm the kernel status is not |
36 | * changed without any system call invocations. | 36 | * changed without any system call invocations. |
37 | */ | 37 | */ |
38 | static struct page *selinux_status_page = NULL; | 38 | static struct page *selinux_status_page; |
39 | static DEFINE_MUTEX(selinux_status_lock); | 39 | static DEFINE_MUTEX(selinux_status_lock); |
40 | 40 | ||
41 | /* | 41 | /* |
@@ -50,11 +50,10 @@ struct page *selinux_kernel_status_page(void) | |||
50 | struct page *result = NULL; | 50 | struct page *result = NULL; |
51 | 51 | ||
52 | mutex_lock(&selinux_status_lock); | 52 | mutex_lock(&selinux_status_lock); |
53 | if (!selinux_status_page) | 53 | if (!selinux_status_page) { |
54 | { | ||
55 | selinux_status_page = alloc_page(GFP_KERNEL|__GFP_ZERO); | 54 | selinux_status_page = alloc_page(GFP_KERNEL|__GFP_ZERO); |
56 | if (selinux_status_page) | 55 | |
57 | { | 56 | if (selinux_status_page) { |
58 | status = page_address(selinux_status_page); | 57 | status = page_address(selinux_status_page); |
59 | 58 | ||
60 | status->version = SELINUX_KERNEL_STATUS_VERSION; | 59 | status->version = SELINUX_KERNEL_STATUS_VERSION; |
@@ -86,8 +85,7 @@ void selinux_status_update_setenforce(int enforcing) | |||
86 | struct selinux_kernel_status *status; | 85 | struct selinux_kernel_status *status; |
87 | 86 | ||
88 | mutex_lock(&selinux_status_lock); | 87 | mutex_lock(&selinux_status_lock); |
89 | if (selinux_status_page) | 88 | if (selinux_status_page) { |
90 | { | ||
91 | status = page_address(selinux_status_page); | 89 | status = page_address(selinux_status_page); |
92 | 90 | ||
93 | status->sequence++; | 91 | status->sequence++; |
@@ -112,8 +110,7 @@ void selinux_status_update_policyload(int seqno) | |||
112 | struct selinux_kernel_status *status; | 110 | struct selinux_kernel_status *status; |
113 | 111 | ||
114 | mutex_lock(&selinux_status_lock); | 112 | mutex_lock(&selinux_status_lock); |
115 | if (selinux_status_page) | 113 | if (selinux_status_page) { |
116 | { | ||
117 | status = page_address(selinux_status_page); | 114 | status = page_address(selinux_status_page); |
118 | 115 | ||
119 | status->sequence++; | 116 | status->sequence++; |