diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-17 17:35:02 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-17 17:35:02 -0500 |
| commit | e2b74f232e84dfccd0047eb47545b1d028df8ff1 (patch) | |
| tree | 86dffe011c9b4049f2adfa7aa78ad92870c4dc9b /kernel | |
| parent | 9cd77374f0a9cbb7ec35a9aaeb6473755afe0e3e (diff) | |
| parent | 580c57f1076872ebc2427f898b927944ce170f2d (diff) | |
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
...
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/kexec.c | 23 | ||||
| -rw-r--r-- | kernel/module.c | 9 | ||||
| -rw-r--r-- | kernel/ptrace.c | 1 | ||||
| -rw-r--r-- | kernel/seccomp.c | 4 | ||||
| -rw-r--r-- | kernel/signal.c | 4 |
5 files changed, 23 insertions, 18 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index c85277639b34..38c25b1f2fd5 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
| @@ -444,7 +444,7 @@ arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, | |||
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | /* | 446 | /* |
| 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 |
| 448 | * memory allocation which is not needed any more after these buffers have | 448 | * 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, | |||
| 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) | |||
| 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, | |||
| 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; |
diff --git a/kernel/module.c b/kernel/module.c index 8426ad48362c..b34813f725e9 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -3025,8 +3025,13 @@ static void do_free_init(struct rcu_head *head) | |||
| 3025 | kfree(m); | 3025 | kfree(m); |
| 3026 | } | 3026 | } |
| 3027 | 3027 | ||
| 3028 | /* This is where the real work happens */ | 3028 | /* |
| 3029 | static 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 | */ | ||
| 3034 | static 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; |
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 1eb9d90c3af9..227fec36b12a 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
| @@ -1077,7 +1077,6 @@ int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr, | |||
| 1077 | } | 1077 | } |
| 1078 | 1078 | ||
| 1079 | #if defined CONFIG_COMPAT | 1079 | #if defined CONFIG_COMPAT |
| 1080 | #include <linux/compat.h> | ||
| 1081 | 1080 | ||
| 1082 | int compat_ptrace_request(struct task_struct *child, compat_long_t request, | 1081 | int 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) |
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index 4ef9687ac115..4f44028943e6 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c | |||
| @@ -629,7 +629,9 @@ static u32 __seccomp_phase1_filter(int this_syscall, struct seccomp_data *sd) | |||
| 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; |
diff --git a/kernel/signal.c b/kernel/signal.c index 33a52759cc0e..a390499943e4 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
| @@ -3550,7 +3550,7 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) | |||
| 3550 | SYSCALL_DEFINE0(pause) | 3550 | SYSCALL_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) | |||
| 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; |
