aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 22:11:50 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 22:11:50 -0500
commit3aacd625f20129f5a41ea3ff3b5353b0e4dabd01 (patch)
tree7cf4ea65397f80098b30494df31cfc8f5fa26d63 /kernel
parent7e21774db5cc9cf8fe93a64a2f0c6cf47db8ab24 (diff)
parent2a1d689c9ba42a6066540fb221b6ecbd6298b728 (diff)
Merge branch 'akpm' (incoming from Andrew)
Merge second patch-bomb from Andrew Morton: - various misc bits - the rest of MM - add generic fixmap.h, use it - backlight updates - dynamic_debug updates - printk() updates - checkpatch updates - binfmt_elf - ramfs - init/ - autofs4 - drivers/rtc - nilfs - hfsplus - Documentation/ - coredump - procfs - fork - exec - kexec - kdump - partitions - rapidio - rbtree - userns - memstick - w1 - decompressors * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (197 commits) lib/decompress_unlz4.c: always set an error return code on failures romfs: fix returm err while getting inode in fill_super drivers/w1/masters/w1-gpio.c: add strong pullup emulation drivers/memstick/host/rtsx_pci_ms.c: fix ms card data transfer bug userns: relax the posix_acl_valid() checks arch/sh/kernel/dwarf.c: use rbtree postorder iteration helper instead of solution using repeated rb_erase() fs-ext3-use-rbtree-postorder-iteration-helper-instead-of-opencoding-fix fs/ext3: use rbtree postorder iteration helper instead of opencoding fs/jffs2: use rbtree postorder iteration helper instead of opencoding fs/ext4: use rbtree postorder iteration helper instead of opencoding fs/ubifs: use rbtree postorder iteration helper instead of opencoding net/netfilter/ipset/ip_set_hash_netiface.c: use rbtree postorder iteration instead of opencoding rbtree/test: test rbtree_postorder_for_each_entry_safe() rbtree/test: move rb_node to the middle of the test struct rapidio: add modular rapidio core build into powerpc and mips branches partitions/efi: complete documentation of gpt kernel param purpose kdump: add /sys/kernel/vmcoreinfo ABI documentation kdump: fix exported size of vmcoreinfo note kexec: add sysctl to disable kexec_load fs/exec.c: call arch_pick_mmap_layout() only once ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c10
-rw-r--r--kernel/kexec.c3
-rw-r--r--kernel/ksysfs.c2
-rw-r--r--kernel/printk/printk.c9
-rw-r--r--kernel/sched/core.c24
-rw-r--r--kernel/signal.c7
-rw-r--r--kernel/sys.c8
-rw-r--r--kernel/sysctl.c22
8 files changed, 63 insertions, 22 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 2f11bbe376b0..a17621c6cd42 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -800,14 +800,11 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
800 * Allocate a new mm structure and copy contents from the 800 * Allocate a new mm structure and copy contents from the
801 * mm structure of the passed in task structure. 801 * mm structure of the passed in task structure.
802 */ 802 */
803struct mm_struct *dup_mm(struct task_struct *tsk) 803static struct mm_struct *dup_mm(struct task_struct *tsk)
804{ 804{
805 struct mm_struct *mm, *oldmm = current->mm; 805 struct mm_struct *mm, *oldmm = current->mm;
806 int err; 806 int err;
807 807
808 if (!oldmm)
809 return NULL;
810
811 mm = allocate_mm(); 808 mm = allocate_mm();
812 if (!mm) 809 if (!mm)
813 goto fail_nomem; 810 goto fail_nomem;
@@ -1229,7 +1226,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1229 if (!try_module_get(task_thread_info(p)->exec_domain->module)) 1226 if (!try_module_get(task_thread_info(p)->exec_domain->module))
1230 goto bad_fork_cleanup_count; 1227 goto bad_fork_cleanup_count;
1231 1228
1232 p->did_exec = 0;
1233 delayacct_tsk_init(p); /* Must remain after dup_task_struct() */ 1229 delayacct_tsk_init(p); /* Must remain after dup_task_struct() */
1234 copy_flags(clone_flags, p); 1230 copy_flags(clone_flags, p);
1235 INIT_LIST_HEAD(&p->children); 1231 INIT_LIST_HEAD(&p->children);
@@ -1654,7 +1650,7 @@ SYSCALL_DEFINE0(fork)
1654 return do_fork(SIGCHLD, 0, 0, NULL, NULL); 1650 return do_fork(SIGCHLD, 0, 0, NULL, NULL);
1655#else 1651#else
1656 /* can not support in nommu mode */ 1652 /* can not support in nommu mode */
1657 return(-EINVAL); 1653 return -EINVAL;
1658#endif 1654#endif
1659} 1655}
1660#endif 1656#endif
@@ -1662,7 +1658,7 @@ SYSCALL_DEFINE0(fork)
1662#ifdef __ARCH_WANT_SYS_VFORK 1658#ifdef __ARCH_WANT_SYS_VFORK
1663SYSCALL_DEFINE0(vfork) 1659SYSCALL_DEFINE0(vfork)
1664{ 1660{
1665 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, 1661 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0,
1666 0, NULL, NULL); 1662 0, NULL, NULL);
1667} 1663}
1668#endif 1664#endif
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 9c970167e402..ac738781d356 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -932,6 +932,7 @@ static int kimage_load_segment(struct kimage *image,
932 */ 932 */
933struct kimage *kexec_image; 933struct kimage *kexec_image;
934struct kimage *kexec_crash_image; 934struct kimage *kexec_crash_image;
935int kexec_load_disabled;
935 936
936static DEFINE_MUTEX(kexec_mutex); 937static DEFINE_MUTEX(kexec_mutex);
937 938
@@ -942,7 +943,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
942 int result; 943 int result;
943 944
944 /* We only trust the superuser with rebooting the system. */ 945 /* We only trust the superuser with rebooting the system. */
945 if (!capable(CAP_SYS_BOOT)) 946 if (!capable(CAP_SYS_BOOT) || kexec_load_disabled)
946 return -EPERM; 947 return -EPERM;
947 948
948 /* 949 /*
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 9659d38e008f..d945a949760f 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -126,7 +126,7 @@ static ssize_t vmcoreinfo_show(struct kobject *kobj,
126{ 126{
127 return sprintf(buf, "%lx %x\n", 127 return sprintf(buf, "%lx %x\n",
128 paddr_vmcoreinfo_note(), 128 paddr_vmcoreinfo_note(),
129 (unsigned int)vmcoreinfo_max_size); 129 (unsigned int)sizeof(vmcoreinfo_note));
130} 130}
131KERNEL_ATTR_RO(vmcoreinfo); 131KERNEL_ATTR_RO(vmcoreinfo);
132 132
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index f8b41bddc6dc..b1d255f04135 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1595,10 +1595,13 @@ asmlinkage int vprintk_emit(int facility, int level,
1595 * either merge it with the current buffer and flush, or if 1595 * either merge it with the current buffer and flush, or if
1596 * there was a race with interrupts (prefix == true) then just 1596 * there was a race with interrupts (prefix == true) then just
1597 * flush it out and store this line separately. 1597 * flush it out and store this line separately.
1598 * If the preceding printk was from a different task and missed
1599 * a newline, flush and append the newline.
1598 */ 1600 */
1599 if (cont.len && cont.owner == current) { 1601 if (cont.len) {
1600 if (!(lflags & LOG_PREFIX)) 1602 if (cont.owner == current && !(lflags & LOG_PREFIX))
1601 stored = cont_add(facility, level, text, text_len); 1603 stored = cont_add(facility, level, text,
1604 text_len);
1602 cont_flush(LOG_NEWLINE); 1605 cont_flush(LOG_NEWLINE);
1603 } 1606 }
1604 1607
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 4d6964e49711..7fea865a810d 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1770,7 +1770,29 @@ void set_numabalancing_state(bool enabled)
1770 numabalancing_enabled = enabled; 1770 numabalancing_enabled = enabled;
1771} 1771}
1772#endif /* CONFIG_SCHED_DEBUG */ 1772#endif /* CONFIG_SCHED_DEBUG */
1773#endif /* CONFIG_NUMA_BALANCING */ 1773
1774#ifdef CONFIG_PROC_SYSCTL
1775int sysctl_numa_balancing(struct ctl_table *table, int write,
1776 void __user *buffer, size_t *lenp, loff_t *ppos)
1777{
1778 struct ctl_table t;
1779 int err;
1780 int state = numabalancing_enabled;
1781
1782 if (write && !capable(CAP_SYS_ADMIN))
1783 return -EPERM;
1784
1785 t = *table;
1786 t.data = &state;
1787 err = proc_dointvec_minmax(&t, write, buffer, lenp, ppos);
1788 if (err < 0)
1789 return err;
1790 if (write)
1791 set_numabalancing_state(state);
1792 return err;
1793}
1794#endif
1795#endif
1774 1796
1775/* 1797/*
1776 * fork()/clone()-time setup: 1798 * fork()/clone()-time setup:
diff --git a/kernel/signal.c b/kernel/signal.c
index 940b30ee9a30..52f881db1ca0 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2047,8 +2047,8 @@ static bool do_signal_stop(int signr)
2047 if (task_set_jobctl_pending(current, signr | gstop)) 2047 if (task_set_jobctl_pending(current, signr | gstop))
2048 sig->group_stop_count++; 2048 sig->group_stop_count++;
2049 2049
2050 for (t = next_thread(current); t != current; 2050 t = current;
2051 t = next_thread(t)) { 2051 while_each_thread(current, t) {
2052 /* 2052 /*
2053 * Setting state to TASK_STOPPED for a group 2053 * Setting state to TASK_STOPPED for a group
2054 * stop is always done with the siglock held, 2054 * stop is always done with the siglock held,
@@ -3125,8 +3125,7 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
3125 rm_from_queue_full(&mask, &t->signal->shared_pending); 3125 rm_from_queue_full(&mask, &t->signal->shared_pending);
3126 do { 3126 do {
3127 rm_from_queue_full(&mask, &t->pending); 3127 rm_from_queue_full(&mask, &t->pending);
3128 t = next_thread(t); 3128 } while_each_thread(current, t);
3129 } while (t != current);
3130 } 3129 }
3131 } 3130 }
3132 3131
diff --git a/kernel/sys.c b/kernel/sys.c
index c72311324ea7..c0a58be780a4 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -895,8 +895,7 @@ SYSCALL_DEFINE1(times, struct tms __user *, tbuf)
895 * only important on a multi-user system anyway, to make sure one user 895 * only important on a multi-user system anyway, to make sure one user
896 * can't send a signal to a process owned by another. -TYT, 12/12/91 896 * can't send a signal to a process owned by another. -TYT, 12/12/91
897 * 897 *
898 * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. 898 * !PF_FORKNOEXEC check to conform completely to POSIX.
899 * LBT 04.03.94
900 */ 899 */
901SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid) 900SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
902{ 901{
@@ -932,7 +931,7 @@ SYSCALL_DEFINE2(setpgid, pid_t, pid, pid_t, pgid)
932 if (task_session(p) != task_session(group_leader)) 931 if (task_session(p) != task_session(group_leader))
933 goto out; 932 goto out;
934 err = -EACCES; 933 err = -EACCES;
935 if (p->did_exec) 934 if (!(p->flags & PF_FORKNOEXEC))
936 goto out; 935 goto out;
937 } else { 936 } else {
938 err = -ESRCH; 937 err = -ESRCH;
@@ -1572,8 +1571,7 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
1572 t = p; 1571 t = p;
1573 do { 1572 do {
1574 accumulate_thread_rusage(t, r); 1573 accumulate_thread_rusage(t, r);
1575 t = next_thread(t); 1574 } while_each_thread(p, t);
1576 } while (t != p);
1577 break; 1575 break;
1578 1576
1579 default: 1577 default:
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 332cefcdb04b..096db7452cbd 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -62,6 +62,7 @@
62#include <linux/capability.h> 62#include <linux/capability.h>
63#include <linux/binfmts.h> 63#include <linux/binfmts.h>
64#include <linux/sched/sysctl.h> 64#include <linux/sched/sysctl.h>
65#include <linux/kexec.h>
65 66
66#include <asm/uaccess.h> 67#include <asm/uaccess.h>
67#include <asm/processor.h> 68#include <asm/processor.h>
@@ -389,6 +390,15 @@ static struct ctl_table kern_table[] = {
389 .mode = 0644, 390 .mode = 0644,
390 .proc_handler = proc_dointvec, 391 .proc_handler = proc_dointvec,
391 }, 392 },
393 {
394 .procname = "numa_balancing",
395 .data = NULL, /* filled in by handler */
396 .maxlen = sizeof(unsigned int),
397 .mode = 0644,
398 .proc_handler = sysctl_numa_balancing,
399 .extra1 = &zero,
400 .extra2 = &one,
401 },
392#endif /* CONFIG_NUMA_BALANCING */ 402#endif /* CONFIG_NUMA_BALANCING */
393#endif /* CONFIG_SCHED_DEBUG */ 403#endif /* CONFIG_SCHED_DEBUG */
394 { 404 {
@@ -605,6 +615,18 @@ static struct ctl_table kern_table[] = {
605 .proc_handler = proc_dointvec, 615 .proc_handler = proc_dointvec,
606 }, 616 },
607#endif 617#endif
618#ifdef CONFIG_KEXEC
619 {
620 .procname = "kexec_load_disabled",
621 .data = &kexec_load_disabled,
622 .maxlen = sizeof(int),
623 .mode = 0644,
624 /* only handle a transition from default "0" to "1" */
625 .proc_handler = proc_dointvec_minmax,
626 .extra1 = &one,
627 .extra2 = &one,
628 },
629#endif
608#ifdef CONFIG_MODULES 630#ifdef CONFIG_MODULES
609 { 631 {
610 .procname = "modprobe", 632 .procname = "modprobe",