History

Merge branch 'akpm' (patches from Andrew)

Merge yet more updates from Andrew Morton: - a pile of minor fs fixes and cleanups - kexec updates - random misc fixes in various places: vmcore, rbtree, eventfd, ipc, seccomp. - a series of python-based kgdb helper scripts * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (58 commits) seccomp: cap SECCOMP_RET_ERRNO data to MAX_ERRNO samples/seccomp: improve label helper ipc,sem: use current->state helpers scripts/gdb: disable pagination while printing from breakpoint handler scripts/gdb: define maintainer scripts/gdb: convert CpuList to generator function scripts/gdb: convert ModuleList to generator function scripts/gdb: use a generator instead of iterator for task list scripts/gdb: ignore byte-compiled python files scripts/gdb: port to python3 / gdb7.7 scripts/gdb: add basic documentation scripts/gdb: add lx-lsmod command scripts/gdb: add class to iterate over CPU masks scripts/gdb: add lx_current convenience function scripts/gdb: add internal helper and convenience function for per-cpu lookup scripts/gdb: add get_gdbserver_type helper scripts/gdb: add internal helper and convenience function to retrieve thread_info scripts/gdb: add is_target_arch helper scripts/gdb: add helper and convenience function to look up tasks scripts/gdb: add task iteration class ...

Linus Torvalds committed 11 years ago

Commit e2b74f22 parents 9cd7737 580c57f43 files · +1185 −238Browse files

Showing the changes to kernel (5 of 43 files). Show all

Unified · Split

5 files
  1. kernel/kexec.c +11 −12
  2. kernel/module.c +7 −2
  3. kernel/ptrace.c +0 −1
  4. kernel/seccomp.c +3 −1
  5. kernel/signal.c +2 −2
kernel/kexec.c+11−12
@@ -444,7 +444,7 @@ arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, · 443 unmodified lines
444444 }
445445
446446 /*
447− * Free up memory used by kernel, initrd, and comand line. This is temporary
447+ * Free up memory used by kernel, initrd, and command line. This is temporary
448448 * memory allocation which is not needed any more after these buffers have
449449 * been loaded into separate segments and have been copied elsewhere.
450450 */
@@ -856,8 +856,6 @@ static int kimage_set_destination(struct kimage *image, · 405 unmodified lines
856856
857857 destination &= PAGE_MASK;
858858 result = kimage_add_entry(image, destination | IND_DESTINATION);
859− if (result == 0)
860− image->destination = destination;
861859
862860 return result;
863861 }
@@ -869,8 +867,6 @@ static int kimage_add_page(struct kimage *image, unsigned long page) · 5 unmodified lines
869867
870868 page &= PAGE_MASK;
871869 result = kimage_add_entry(image, page | IND_SOURCE);
872− if (result == 0)
873− image->destination += PAGE_SIZE;
874870
875871 return result;
876872 }
@@ -1288,19 +1284,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, · 411 unmodified lines
12881284 if (nr_segments > 0) {
12891285 unsigned long i;
12901286
1291− /* Loading another kernel to reboot into */
1292− if ((flags & KEXEC_ON_CRASH) == 0)
1293− result = kimage_alloc_init(&image, entry, nr_segments,
1294− segments, flags);
1295− /* Loading another kernel to switch to if this one crashes */
1296− else if (flags & KEXEC_ON_CRASH) {
1297− /* Free any current crash dump kernel before
1287+ if (flags & KEXEC_ON_CRASH) {
1288+ /*
1289+ * Loading another kernel to switch to if this one
1290+ * crashes. Free any current crash dump kernel before
12981291 * we corrupt it.
12991292 */
1293+
13001294 kimage_free(xchg(&kexec_crash_image, NULL));
13011295 result = kimage_alloc_init(&image, entry, nr_segments,
13021296 segments, flags);
13031297 crash_map_reserved_pages();
1298+ } else {
1299+ /* Loading another kernel to reboot into. */
1300+
1301+ result = kimage_alloc_init(&image, entry, nr_segments,
1302+ segments, flags);
13041303 }
13051304 if (result)
13061305 goto out;
kernel/module.c+7−2
@@ -3025,8 +3025,13 @@ static void do_free_init(struct rcu_head *head) · 3024 unmodified lines
30253025 kfree(m);
30263026 }
30273027
3028−/* This is where the real work happens */
3029−static int do_init_module(struct module *mod)
3028+/*
3029+ * This is where the real work happens.
3030+ *
3031+ * Keep it uninlined to provide a reliable breakpoint target, e.g. for the gdb
3032+ * helper command 'lx-symbols'.
3033+ */
3034+static noinline int do_init_module(struct module *mod)
30303035 {
30313036 int ret = 0;
30323037 struct mod_initfree *freeinit;
kernel/ptrace.c+0−1
@@ -1077,7 +1077,6 @@ int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, · 1076 unmodified lines
10771077 }
10781078
10791079 #if defined CONFIG_COMPAT
1080−#include <linux/compat.h>
10811080
10821081 int compat_ptrace_request(struct task_struct *child, compat_long_t request,
10831082 compat_ulong_t addr, compat_ulong_t data)
kernel/seccomp.c+3−1
@@ -629,7 +629,9 @@ static u32 __seccomp_phase1_filter(int this_syscall, struct seccomp_data *sd) · 628 unmodified lines
629629
630630 switch (action) {
631631 case SECCOMP_RET_ERRNO:
632− /* Set the low-order 16-bits as a errno. */
632+ /* Set low-order bits as an errno, capped at MAX_ERRNO. */
633+ if (data > MAX_ERRNO)
634+ data = MAX_ERRNO;
633635 syscall_set_return_value(current, task_pt_regs(current),
634636 -data, 0);
635637 goto skip;
kernel/signal.c+2−2
@@ -3550,7 +3550,7 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) · 3549 unmodified lines
35503550 SYSCALL_DEFINE0(pause)
35513551 {
35523552 while (!signal_pending(current)) {
3553− current->state = TASK_INTERRUPTIBLE;
3553+ __set_current_state(TASK_INTERRUPTIBLE);
35543554 schedule();
35553555 }
35563556 return -ERESTARTNOHAND;
@@ -3563,7 +3563,7 @@ int sigsuspend(sigset_t *set) · 6 unmodified lines
35633563 current->saved_sigmask = current->blocked;
35643564 set_current_blocked(set);
35653565
3566− current->state = TASK_INTERRUPTIBLE;
3566+ __set_current_state(TASK_INTERRUPTIBLE);
35673567 schedule();
35683568 set_restore_sigmask();
35693569 return -ERESTARTNOHAND;