~ubuntu-branches/ubuntu/lucid/linux-ec2/lucid-updates

« back to all changes in this revision

Viewing changes to arch/x86/oprofile/backtrace.c

  • Committer: Package Import Robot
  • Author(s): Stefan Bader, Stefan Bader, Ubuntu: 2.6.32-38.83, Ubuntu: 2.6.32-38.82
  • Date: 2012-01-04 17:57:42 UTC
  • Revision ID: package-import@ubuntu.com-20120104175742-d8r2jwn08jq6sv5e
Tags: 2.6.32-342.43
[ Stefan Bader ]

* Rebased to Ubuntu-2.6.32-38.83
* XEN: x86/mpparse: Account for bus types other than ISA and PCI
  - LP: #902317
* Release Tracking Bug
  - LP: #911230

[ Ubuntu: 2.6.32-38.83 ]

* Revert "clockevents: Set noop handler in clockevents_exchange_device()"
  - LP: #911392
* Linux 2.6.32.52
  - LP: #911392

[ Ubuntu: 2.6.32-38.82 ]

* SAUCE: netns: Add quota for number of NET_NS instances.
* [Config] CONFIG_NET_NS=y
  - LP: #790863
* Revert "core: Fix memory leak/corruption on VLAN GRO_DROP,
  CVE-2011-1576"
* hfs: fix hfs_find_init() sb->ext_tree NULL ptr oops, CVE-2011-2203
  - LP: #899466
  - CVE-2011-2203
* net: ipv4: relax AF_INET check in bind()
  - LP: #900396
* KEYS: Fix a NULL pointer deref in the user-defined key type,
  CVE-2011-4110
  - LP: #894369
  - CVE-2011-4110
* i2c-algo-bit: Generate correct i2c address sequence for 10-bit target
  - LP: #902317
* eCryptfs: Extend array bounds for all filename chars
  - LP: #902317
* PCI hotplug: shpchp: don't blindly claim non-AMD 0x7450 device IDs
  - LP: #902317
* ARM: 7161/1: errata: no automatic store buffer drain
  - LP: #902317
* ALSA: lx6464es - fix device communication via command bus
  - LP: #902317
* SUNRPC: Ensure we return EAGAIN in xs_nospace if congestion is cleared
  - LP: #902317
* timekeeping: add arch_offset hook to ktime_get functions
  - LP: #902317
* p54spi: Add missing spin_lock_init
  - LP: #902317
* p54spi: Fix workqueue deadlock
  - LP: #902317
* nl80211: fix MAC address validation
  - LP: #902317
* gro: reset vlan_tci on reuse
  - LP: #902317
* staging: usbip: bugfix for deadlock
  - LP: #902317
* staging: comedi: fix oops for USB DAQ devices.
  - LP: #902317
* Staging: comedi: fix signal handling in read and write
  - LP: #902317
* USB: whci-hcd: fix endian conversion in qset_clear()
  - LP: #902317
* usb: ftdi_sio: add PID for Propox ISPcable III
  - LP: #902317
* usb: option: add SIMCom SIM5218
  - LP: #902317
* USB: usb-storage: unusual_devs entry for Kingston DT 101 G2
  - LP: #902317
* SCSI: scsi_lib: fix potential NULL dereference
  - LP: #902317
* SCSI: Silencing 'killing requests for dead queue'
  - LP: #902317
* cifs: fix cifs stable patch cifs-fix-oplock-break-handling-try-2.patch
  - LP: #902317
* sched, x86: Avoid unnecessary overflow in sched_clock
  - LP: #902317
* x86/mpparse: Account for bus types other than ISA and PCI
  - LP: #902317
* oprofile, x86: Fix crash when unloading module (nmi timer mode)
  - LP: #902317
* genirq: Fix race condition when stopping the irq thread
  - LP: #902317
* tick-broadcast: Stop active broadcast device when replacing it
  - LP: #902317
* clockevents: Set noop handler in clockevents_exchange_device()
  - LP: #902317
* Linux 2.6.32.50
  - LP: #902317
* nfsd4: permit read opens of executable-only files
  - LP: #833300
* ipv6: Allow inet6_dump_addr() to handle more than 64 addresses
  - LP: #863394
* ALSA: sis7019 - give slow codecs more time to reset
  - LP: #907774
* ALSA: hda/realtek - Fix Oops in alc_mux_select()
  - LP: #907774
* ARM: davinci: dm646x evm: wrong register used in
  setup_vpif_input_channel_mode
  - LP: #907774
* oprofile: Free potentially owned tasks in case of errors
  - LP: #907774
* oprofile: Fix locking dependency in sync_start()
  - LP: #907774
* percpu: fix chunk range calculation
  - LP: #907774
* xfrm: Fix key lengths for rfc3686(ctr(aes))
  - LP: #907774
* linux/log2.h: Fix rounddown_pow_of_two(1)
  - LP: #907774
* jbd/jbd2: validate sb->s_first in journal_get_superblock()
  - LP: #907774
* hfs: fix hfs_find_init() sb->ext_tree NULL ptr oops
  - LP: #907774
* export __get_user_pages_fast() function
  - LP: #907774
* oprofile, x86: Fix nmi-unsafe callgraph support
  - LP: #907774
* oprofile, x86: Fix crash when unloading module (timer mode)
  - LP: #907774
* ext4: avoid hangs in ext4_da_should_update_i_disksize()
  - LP: #907774
* USB: cdc-acm: add IDs for Motorola H24 HSPA USB module.
  - LP: #907774
* Linux 2.6.32.51
  - LP: #907774

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#include <linux/oprofile.h>
12
12
#include <linux/sched.h>
13
13
#include <linux/mm.h>
 
14
#include <linux/highmem.h>
 
15
 
14
16
#include <asm/ptrace.h>
15
17
#include <asm/uaccess.h>
16
18
#include <asm/stacktrace.h>
47
49
        .address = backtrace_address,
48
50
};
49
51
 
 
52
/* from arch/x86/kernel/cpu/perf_event.c: */
 
53
 
 
54
/*
 
55
 * best effort, GUP based copy_from_user() that assumes IRQ or NMI context
 
56
 */
 
57
static unsigned long
 
58
copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
 
59
{
 
60
        unsigned long offset, addr = (unsigned long)from;
 
61
        unsigned long size, len = 0;
 
62
        struct page *page;
 
63
        void *map;
 
64
        int ret;
 
65
 
 
66
        do {
 
67
                ret = __get_user_pages_fast(addr, 1, 0, &page);
 
68
                if (!ret)
 
69
                        break;
 
70
 
 
71
                offset = addr & (PAGE_SIZE - 1);
 
72
                size = min(PAGE_SIZE - offset, n - len);
 
73
 
 
74
                map = kmap_atomic(page, KM_USER0);
 
75
                memcpy(to, map+offset, size);
 
76
                kunmap_atomic(map, KM_USER0);
 
77
                put_page(page);
 
78
 
 
79
                len  += size;
 
80
                to   += size;
 
81
                addr += size;
 
82
 
 
83
        } while (len < n);
 
84
 
 
85
        return len;
 
86
}
 
87
 
50
88
struct frame_head {
51
89
        struct frame_head *bp;
52
90
        unsigned long ret;
54
92
 
55
93
static struct frame_head *dump_user_backtrace(struct frame_head *head)
56
94
{
 
95
        /* Also check accessibility of one struct frame_head beyond: */
57
96
        struct frame_head bufhead[2];
 
97
        unsigned long bytes;
58
98
 
59
 
        /* Also check accessibility of one struct frame_head beyond */
60
 
        if (!access_ok(VERIFY_READ, head, sizeof(bufhead)))
61
 
                return NULL;
62
 
        if (__copy_from_user_inatomic(bufhead, head, sizeof(bufhead)))
 
99
        bytes = copy_from_user_nmi(bufhead, head, sizeof(bufhead));
 
100
        if (bytes != sizeof(bufhead))
63
101
                return NULL;
64
102
 
65
103
        oprofile_add_trace(bufhead[0].ret);