History

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 ...

Linus Torvalds committed 12 years ago

Commit 3aacd622 parents 7e21774 2a1d689231 files · +3339 −2187Browse files

Showing the changes to kernel (8 of 231 files). Show all

Unified · Split

8 files
  1. kernel/fork.c +3 −7
  2. kernel/kexec.c +2 −1
  3. kernel/ksysfs.c +1 −1
  4. kernel/printk/printk.c +6 −3
  5. kernel/sched/core.c +23 −1
  6. kernel/signal.c +3 −4
  7. kernel/sys.c +3 −5
  8. kernel/sysctl.c +22 −0
kernel/fork.c+3−7
@@ -800,14 +800,11 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) · 799 unmodified lines
800 * Allocate a new mm structure and copy contents from the800 * 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, · 415 unmodified lines
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) · 418 unmodified lines
1654 return do_fork(SIGCHLD, 0, 0, NULL, NULL);1650 return do_fork(SIGCHLD, 0, 0, NULL, NULL);
1655#else1651#else
1656 /* can not support in nommu mode */1652 /* can not support in nommu mode */
1657 return(-EINVAL);1653 return -EINVAL;
1658#endif1654#endif
1659}1655}
1660#endif1656#endif
@@ -1662,7 +1658,7 @@ SYSCALL_DEFINE0(fork) · 1 unmodified line
1662#ifdef __ARCH_WANT_SYS_VFORK1658#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#endif1664#endif
kernel/kexec.c+2−1
@@ -932,6 +932,7 @@ static int kimage_load_segment(struct kimage *image, · 931 unmodified lines
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, · 4 unmodified lines
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 /*
kernel/ksysfs.c+1−1
@@ -126,7 +126,7 @@ static ssize_t vmcoreinfo_show(struct kobject *kobj, · 125 unmodified lines
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
kernel/printk/printk.c+6−3
@@ -1595,10 +1595,13 @@ asmlinkage int vprintk_emit(int facility, int level, · 1594 unmodified lines
1595 * either merge it with the current buffer and flush, or if1595 * either merge it with the current buffer and flush, or if
1596 * there was a race with interrupts (prefix == true) then just1596 * 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
kernel/sched/core.c+23−1
@@ -1770,7 +1770,29 @@ void set_numabalancing_state(bool enabled) · 1769 unmodified lines
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:
kernel/signal.c+3−4
@@ -2047,8 +2047,8 @@ static bool do_signal_stop(int signr) · 2046 unmodified lines
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 group2053 * 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) · 1070 unmodified lines
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
kernel/sys.c+3−5
@@ -895,8 +895,7 @@ SYSCALL_DEFINE1(times, struct tms __user *, tbuf) · 894 unmodified lines
895 * only important on a multi-user system anyway, to make sure one user895 * 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/91896 * 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) · 29 unmodified lines
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) · 633 unmodified lines
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:
kernel/sysctl.c+22−0
@@ -62,6 +62,7 @@ · 61 unmodified lines
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[] = { · 321 unmodified lines
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[] = { · 210 unmodified lines
605 .proc_handler = proc_dointvec,615 .proc_handler = proc_dointvec,
606 },616 },
607#endif617#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_MODULES630#ifdef CONFIG_MODULES
609 {631 {
610 .procname = "modprobe",632 .procname = "modprobe",