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
444}444}
445 445
446/*446/*
447 * Free up memory used by kernel, initrd, and comand line. This is temporary447 * Free up memory used by kernel, initrd, and command line. This is temporary
448 * memory allocation which is not needed any more after these buffers have448 * memory allocation which is not needed any more after these buffers have
449 * been loaded into separate segments and have been copied elsewhere.449 * been loaded into separate segments and have been copied elsewhere.
450 */450 */
@@ -856,8 +856,6 @@ static int kimage_set_destination(struct kimage *image, · 405 unmodified lines
856 856
857 destination &= PAGE_MASK;857 destination &= PAGE_MASK;
858 result = kimage_add_entry(image, destination | IND_DESTINATION);858 result = kimage_add_entry(image, destination | IND_DESTINATION);
859 if (result == 0)
860 image->destination = destination;
861 859
862 return result;860 return result;
863}861}
@@ -869,8 +867,6 @@ static int kimage_add_page(struct kimage *image, unsigned long page) · 5 unmodified lines
869 867
870 page &= PAGE_MASK;868 page &= PAGE_MASK;
871 result = kimage_add_entry(image, page | IND_SOURCE);869 result = kimage_add_entry(image, page | IND_SOURCE);
872 if (result == 0)
873 image->destination += PAGE_SIZE;
874 870
875 return result;871 return result;
876}872}
@@ -1288,19 +1284,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, · 411 unmodified lines
1288 if (nr_segments > 0) {1284 if (nr_segments > 0) {
1289 unsigned long i;1285 unsigned long i;
1290 1286
1291 /* Loading another kernel to reboot into */1287 if (flags & KEXEC_ON_CRASH) {
1292 if ((flags & KEXEC_ON_CRASH) == 0)1288 /*
1293 result = kimage_alloc_init(&image, entry, nr_segments,1289 * Loading another kernel to switch to if this one
1294 segments, flags);1290 * crashes. Free any current crash dump kernel before
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
1298 * we corrupt it.1291 * we corrupt it.
1299 */1292 */
1293
1300 kimage_free(xchg(&kexec_crash_image, NULL));1294 kimage_free(xchg(&kexec_crash_image, NULL));
1301 result = kimage_alloc_init(&image, entry, nr_segments,1295 result = kimage_alloc_init(&image, entry, nr_segments,
1302 segments, flags);1296 segments, flags);
1303 crash_map_reserved_pages();1297 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);
1304 }1303 }
1305 if (result)1304 if (result)
1306 goto out;1305 goto out;
kernel/module.c+7−2
@@ -3025,8 +3025,13 @@ static void do_free_init(struct rcu_head *head) · 3024 unmodified lines
3025 kfree(m);3025 kfree(m);
3026}3026}
3027 3027
3028/* This is where the real work happens */3028/*
3029static int do_init_module(struct module *mod)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 */
3034static noinline int do_init_module(struct module *mod)
3030{3035{
3031 int ret = 0;3036 int ret = 0;
3032 struct mod_initfree *freeinit;3037 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
1077}1077}
1078 1078
1079#if defined CONFIG_COMPAT1079#if defined CONFIG_COMPAT
1080#include <linux/compat.h>
1081 1080
1082int compat_ptrace_request(struct task_struct *child, compat_long_t request,1081int compat_ptrace_request(struct task_struct *child, compat_long_t request,
1083 compat_ulong_t addr, compat_ulong_t data)1082 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
629 629
630 switch (action) {630 switch (action) {
631 case SECCOMP_RET_ERRNO:631 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;
633 syscall_set_return_value(current, task_pt_regs(current),635 syscall_set_return_value(current, task_pt_regs(current),
634 -data, 0);636 -data, 0);
635 goto skip;637 goto skip;
kernel/signal.c+2−2
@@ -3550,7 +3550,7 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) · 3549 unmodified lines
3550SYSCALL_DEFINE0(pause)3550SYSCALL_DEFINE0(pause)
3551{3551{
3552 while (!signal_pending(current)) {3552 while (!signal_pending(current)) {
3553 current->state = TASK_INTERRUPTIBLE;3553 __set_current_state(TASK_INTERRUPTIBLE);
3554 schedule();3554 schedule();
3555 }3555 }
3556 return -ERESTARTNOHAND;3556 return -ERESTARTNOHAND;
@@ -3563,7 +3563,7 @@ int sigsuspend(sigset_t *set) · 6 unmodified lines
3563 current->saved_sigmask = current->blocked;3563 current->saved_sigmask = current->blocked;
3564 set_current_blocked(set);3564 set_current_blocked(set);
3565 3565
3566 current->state = TASK_INTERRUPTIBLE;3566 __set_current_state(TASK_INTERRUPTIBLE);
3567 schedule();3567 schedule();
3568 set_restore_sigmask();3568 set_restore_sigmask();
3569 return -ERESTARTNOHAND;3569 return -ERESTARTNOHAND;