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 ...
This commit is contained in:
@@ -444,7 +444,7 @@ arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
|
||||
}
|
||||
|
||||
/*
|
||||
* Free up memory used by kernel, initrd, and comand line. This is temporary
|
||||
* Free up memory used by kernel, initrd, and command line. This is temporary
|
||||
* memory allocation which is not needed any more after these buffers have
|
||||
* been loaded into separate segments and have been copied elsewhere.
|
||||
*/
|
||||
@@ -856,8 +856,6 @@ static int kimage_set_destination(struct kimage *image,
|
||||
|
||||
destination &= PAGE_MASK;
|
||||
result = kimage_add_entry(image, destination | IND_DESTINATION);
|
||||
if (result == 0)
|
||||
image->destination = destination;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -869,8 +867,6 @@ static int kimage_add_page(struct kimage *image, unsigned long page)
|
||||
|
||||
page &= PAGE_MASK;
|
||||
result = kimage_add_entry(image, page | IND_SOURCE);
|
||||
if (result == 0)
|
||||
image->destination += PAGE_SIZE;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1288,19 +1284,22 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
|
||||
if (nr_segments > 0) {
|
||||
unsigned long i;
|
||||
|
||||
/* Loading another kernel to reboot into */
|
||||
if ((flags & KEXEC_ON_CRASH) == 0)
|
||||
result = kimage_alloc_init(&image, entry, nr_segments,
|
||||
segments, flags);
|
||||
/* Loading another kernel to switch to if this one crashes */
|
||||
else if (flags & KEXEC_ON_CRASH) {
|
||||
/* Free any current crash dump kernel before
|
||||
if (flags & KEXEC_ON_CRASH) {
|
||||
/*
|
||||
* Loading another kernel to switch to if this one
|
||||
* crashes. Free any current crash dump kernel before
|
||||
* we corrupt it.
|
||||
*/
|
||||
|
||||
kimage_free(xchg(&kexec_crash_image, NULL));
|
||||
result = kimage_alloc_init(&image, entry, nr_segments,
|
||||
segments, flags);
|
||||
crash_map_reserved_pages();
|
||||
} else {
|
||||
/* Loading another kernel to reboot into. */
|
||||
|
||||
result = kimage_alloc_init(&image, entry, nr_segments,
|
||||
segments, flags);
|
||||
}
|
||||
if (result)
|
||||
goto out;
|
||||
|
@@ -3025,8 +3025,13 @@ static void do_free_init(struct rcu_head *head)
|
||||
kfree(m);
|
||||
}
|
||||
|
||||
/* This is where the real work happens */
|
||||
static int do_init_module(struct module *mod)
|
||||
/*
|
||||
* This is where the real work happens.
|
||||
*
|
||||
* Keep it uninlined to provide a reliable breakpoint target, e.g. for the gdb
|
||||
* helper command 'lx-symbols'.
|
||||
*/
|
||||
static noinline int do_init_module(struct module *mod)
|
||||
{
|
||||
int ret = 0;
|
||||
struct mod_initfree *freeinit;
|
||||
|
@@ -1077,7 +1077,6 @@ int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
|
||||
}
|
||||
|
||||
#if defined CONFIG_COMPAT
|
||||
#include <linux/compat.h>
|
||||
|
||||
int compat_ptrace_request(struct task_struct *child, compat_long_t request,
|
||||
compat_ulong_t addr, compat_ulong_t data)
|
||||
|
@@ -629,7 +629,9 @@ static u32 __seccomp_phase1_filter(int this_syscall, struct seccomp_data *sd)
|
||||
|
||||
switch (action) {
|
||||
case SECCOMP_RET_ERRNO:
|
||||
/* Set the low-order 16-bits as a errno. */
|
||||
/* Set low-order bits as an errno, capped at MAX_ERRNO. */
|
||||
if (data > MAX_ERRNO)
|
||||
data = MAX_ERRNO;
|
||||
syscall_set_return_value(current, task_pt_regs(current),
|
||||
-data, 0);
|
||||
goto skip;
|
||||
|
@@ -3550,7 +3550,7 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
|
||||
SYSCALL_DEFINE0(pause)
|
||||
{
|
||||
while (!signal_pending(current)) {
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
__set_current_state(TASK_INTERRUPTIBLE);
|
||||
schedule();
|
||||
}
|
||||
return -ERESTARTNOHAND;
|
||||
@@ -3563,7 +3563,7 @@ int sigsuspend(sigset_t *set)
|
||||
current->saved_sigmask = current->blocked;
|
||||
set_current_blocked(set);
|
||||
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
__set_current_state(TASK_INTERRUPTIBLE);
|
||||
schedule();
|
||||
set_restore_sigmask();
|
||||
return -ERESTARTNOHAND;
|
||||
|
Reference in New Issue
Block a user