diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cred.c | 19 | ||||
-rw-r--r-- | kernel/kmod.c | 13 | ||||
-rw-r--r-- | kernel/power/swap.c | 1 | ||||
-rw-r--r-- | kernel/sysctl.c | 1 | ||||
-rw-r--r-- | kernel/uid16.c | 1 |
5 files changed, 24 insertions, 11 deletions
diff --git a/kernel/cred.c b/kernel/cred.c index d7f7a01082eb..dd76cfe5f5b0 100644 --- a/kernel/cred.c +++ b/kernel/cred.c | |||
@@ -782,6 +782,25 @@ EXPORT_SYMBOL(set_create_files_as); | |||
782 | 782 | ||
783 | #ifdef CONFIG_DEBUG_CREDENTIALS | 783 | #ifdef CONFIG_DEBUG_CREDENTIALS |
784 | 784 | ||
785 | bool creds_are_invalid(const struct cred *cred) | ||
786 | { | ||
787 | if (cred->magic != CRED_MAGIC) | ||
788 | return true; | ||
789 | if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) | ||
790 | return true; | ||
791 | #ifdef CONFIG_SECURITY_SELINUX | ||
792 | if (selinux_is_enabled()) { | ||
793 | if ((unsigned long) cred->security < PAGE_SIZE) | ||
794 | return true; | ||
795 | if ((*(u32 *)cred->security & 0xffffff00) == | ||
796 | (POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8)) | ||
797 | return true; | ||
798 | } | ||
799 | #endif | ||
800 | return false; | ||
801 | } | ||
802 | EXPORT_SYMBOL(creds_are_invalid); | ||
803 | |||
785 | /* | 804 | /* |
786 | * dump invalid credentials | 805 | * dump invalid credentials |
787 | */ | 806 | */ |
diff --git a/kernel/kmod.c b/kernel/kmod.c index 689d20f39305..9fcb53a11f87 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
@@ -143,7 +143,6 @@ struct subprocess_info { | |||
143 | static int ____call_usermodehelper(void *data) | 143 | static int ____call_usermodehelper(void *data) |
144 | { | 144 | { |
145 | struct subprocess_info *sub_info = data; | 145 | struct subprocess_info *sub_info = data; |
146 | enum umh_wait wait = sub_info->wait; | ||
147 | int retval; | 146 | int retval; |
148 | 147 | ||
149 | BUG_ON(atomic_read(&sub_info->cred->usage) != 1); | 148 | BUG_ON(atomic_read(&sub_info->cred->usage) != 1); |
@@ -185,14 +184,10 @@ static int ____call_usermodehelper(void *data) | |||
185 | */ | 184 | */ |
186 | set_user_nice(current, 0); | 185 | set_user_nice(current, 0); |
187 | 186 | ||
188 | if (wait == UMH_WAIT_EXEC) | ||
189 | complete(sub_info->complete); | ||
190 | |||
191 | retval = kernel_execve(sub_info->path, sub_info->argv, sub_info->envp); | 187 | retval = kernel_execve(sub_info->path, sub_info->argv, sub_info->envp); |
192 | 188 | ||
193 | /* Exec failed? */ | 189 | /* Exec failed? */ |
194 | if (wait != UMH_WAIT_EXEC) | 190 | sub_info->retval = retval; |
195 | sub_info->retval = retval; | ||
196 | do_exit(0); | 191 | do_exit(0); |
197 | } | 192 | } |
198 | 193 | ||
@@ -271,14 +266,16 @@ static void __call_usermodehelper(struct work_struct *work) | |||
271 | 266 | ||
272 | switch (wait) { | 267 | switch (wait) { |
273 | case UMH_NO_WAIT: | 268 | case UMH_NO_WAIT: |
274 | case UMH_WAIT_EXEC: | ||
275 | break; | 269 | break; |
276 | 270 | ||
277 | case UMH_WAIT_PROC: | 271 | case UMH_WAIT_PROC: |
278 | if (pid > 0) | 272 | if (pid > 0) |
279 | break; | 273 | break; |
280 | sub_info->retval = pid; | 274 | sub_info->retval = pid; |
281 | break; | 275 | /* FALLTHROUGH */ |
276 | |||
277 | case UMH_WAIT_EXEC: | ||
278 | complete(sub_info->complete); | ||
282 | } | 279 | } |
283 | } | 280 | } |
284 | 281 | ||
diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 8ba052c86d48..b101cdc4df3f 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/file.h> | 15 | #include <linux/file.h> |
16 | #include <linux/utsname.h> | ||
17 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
18 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
19 | #include <linux/genhd.h> | 18 | #include <linux/genhd.h> |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 0dfaa47d7cb6..7f4f57bea4ce 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/proc_fs.h> | 26 | #include <linux/proc_fs.h> |
27 | #include <linux/security.h> | 27 | #include <linux/security.h> |
28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
29 | #include <linux/utsname.h> | ||
30 | #include <linux/kmemcheck.h> | 29 | #include <linux/kmemcheck.h> |
31 | #include <linux/smp_lock.h> | 30 | #include <linux/smp_lock.h> |
32 | #include <linux/fs.h> | 31 | #include <linux/fs.h> |
diff --git a/kernel/uid16.c b/kernel/uid16.c index 0314501688b9..419209893d87 100644 --- a/kernel/uid16.c +++ b/kernel/uid16.c | |||
@@ -4,7 +4,6 @@ | |||
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
7 | #include <linux/utsname.h> | ||
8 | #include <linux/mman.h> | 7 | #include <linux/mman.h> |
9 | #include <linux/notifier.h> | 8 | #include <linux/notifier.h> |
10 | #include <linux/reboot.h> | 9 | #include <linux/reboot.h> |