]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/stacktrace.c
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[linux.git] / kernel / stacktrace.c
index e6a02b274b737e9d46f6c6816488fef40c72fdb5..6d1f68b7e528a3f48c97f0a1e5c1a572d8ed8e11 100644 (file)
@@ -20,7 +20,7 @@
  * @nr_entries:        Number of entries in the storage array
  * @spaces:    Number of leading spaces to print
  */
-void stack_trace_print(unsigned long *entries, unsigned int nr_entries,
+void stack_trace_print(const unsigned long *entries, unsigned int nr_entries,
                       int spaces)
 {
        unsigned int i;
@@ -43,7 +43,7 @@ EXPORT_SYMBOL_GPL(stack_trace_print);
  *
  * Return: Number of bytes printed.
  */
-int stack_trace_snprint(char *buf, size_t size, unsigned long *entries,
+int stack_trace_snprint(char *buf, size_t size, const unsigned long *entries,
                        unsigned int nr_entries, int spaces)
 {
        unsigned int generated, i, total = 0;
@@ -226,12 +226,17 @@ unsigned int stack_trace_save_user(unsigned long *store, unsigned int size)
                .store  = store,
                .size   = size,
        };
+       mm_segment_t fs;
 
        /* Trace user stack if not a kernel thread */
        if (current->flags & PF_KTHREAD)
                return 0;
 
+       fs = get_fs();
+       set_fs(USER_DS);
        arch_stack_walk_user(consume_entry, &c, task_pt_regs(current));
+       set_fs(fs);
+
        return c.len;
 }
 #endif