1. 04 Feb, 2016 2 commits
  2. 03 Feb, 2016 25 commits
  3. 02 Feb, 2016 2 commits
    • Hemant Kumar's avatar
      perf probe: Search both .eh_frame and .debug_frame sections for probe location · 270bde1e
      Hemant Kumar authored
      'perf probe' through debuginfo__find_probes() in util/probe-finder.c
      checks for the functions' frame descriptions in either .eh_frame section
      of an ELF or the .debug_frame.
      
      The check is based on whether either one of these sections is present.
      Depending on distro, toolchain defaults, architetcutre, build flags,
      etc., CFI might be found in either .eh_frame and/or .debug_frame.
      Sometimes, it may happen that, .eh_frame, even if present, may not be
      complete and may miss some descriptions.
      
      Therefore, to be sure, to find the CFI covering an address we will
      always have to investigate both if available.
      
      For e.g., in powerpc, this may happen:
        $ gcc -g bin.c -o bin
      
        $ objdump --dwarf ./bin
        <1><145>: Abbrev Number: 7 (DW_TAG_subprogram)
           <146> DW_AT_external   : 1
           <146> DW_AT_name       : (indirect string, offset: 0x9e): main
           <14a> DW_AT_decl_file  : 1
           <14b> DW_AT_decl_line  : 39
           <14c> DW_AT_prototyped : 1
           <14c> DW_AT_type       : <0x57>
           <150> DW_AT_low_pc     : 0x100007b8
      
      If the .eh_frame and .debug_frame are checked for the same binary, we
      will find that, .eh_frame (although present) doesn't contain a
      description for "main" function.
      
      But, .debug_frame has a description:
      
        000000d8 00000024 00000000 FDE cie=00000000 pc=100007b8..10000838
          DW_CFA_advance_loc: 16 to 100007c8
          DW_CFA_def_cfa_offset: 144
          DW_CFA_offset_extended_sf: r65 at cfa+16
        ...
      
      Due to this (since, perf checks whether .eh_frame is present and goes on
      searching for that address inside that frame), perf is unable to process
      the probes:
      
        # perf probe -x ./bin main
          Failed to get call frame on 0x100007b8
          Error: Failed to add events.
      
      To avoid this issue, we need to check both the sections (.eh_frame and
      .debug_frame), which is done in this patch.
      
      Note that, we can always force everything into both .eh_frame and
      .debug_frame by:
      
        $ gcc bin.c -fasynchronous-unwind-tables  -fno-dwarf2-cfi-asm -g -o bin
      Signed-off-by: default avatarHemant Kumar <hemant@linux.vnet.ibm.com>
      Acked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Mark Wielaard <mjw@redhat.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/1454426806-13974-1-git-send-email-hemant@linux.vnet.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      270bde1e
    • Adrian Hunter's avatar
      perf tools: Fix thread lifetime related segfaut in intel_pt · 3a4acda1
      Adrian Hunter authored
      intel_pt_process_auxtrace_info() creates a pt->unknown_thread thread
      that eventually needs to be freed by the last thread__put() on it, when
      its refcount hits zero, which may happen in
      intel_pt_process_auxtrace_info() error handling path and triggers the
      following segfault, which would happen as well at intel_pt_free, when
      tools using this intel_pt codebase frees up resources:
      
        # perf record -I -e intel_pt/tsc=1,noretcomp=1/u /bin/ls
        0  a  anaconda-ks.cfg  bin   perf.data	perf.data.old  perf-f23-bringup.todo
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.217 MB perf.data ]
        #
        # perf script -F event,comm,pid,tid,time,addr,ip,sym,dso,iregs
        Samples for 'instructions:u' event do not have IREGS attribute set. Cannot print 'iregs' field.
        intel_pt_synth_events: failed to synthesize 'instructions' event type
        Segmentation fault (core dumped)
        #
      
      The problem is: there's a union in 'struct thread' combines a list_head
      and a rb_node. The standard life cycle of a thread is: init rb_node in
      the constructor, insert it into machine->threads rbtree using rb_node,
      move it to machine->dead_threads using list_head, clean in the last
      thread__put: list_del_init(&thread->node).
      
      In the above command, it clean a thread before adding it into list,
      causes the above segfault.
      
      Since pt->unknown_thread will never live in an rbtree, initialize its
      list node so that when list_del_init() is done on it we don't segfault.
      
      After this patch:
      
        # perf script -F event,comm,pid,tid,time,addr,ip,sym,dso,iregs
        Samples for 'instructions:u' event do not have IREGS attribute set. Cannot print 'iregs' field.
        intel_pt_synth_events: failed to synthesize 'instructions' event type
        0x248 [0x88]: failed to process type: 70
        #
      Reported-by: default avatarTong Zhang <ztong@vt.edu>
      Reported-by: default avatarWang Nan <wangnan0@huawei.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Link: http://lkml.kernel.org/r/1454296865-19749-1-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3a4acda1
  4. 01 Feb, 2016 11 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 34229b27
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "This looks like a lot but it's a mixture of regression fixes as well
        as fixes for longer standing issues.
      
         1) Fix on-channel cancellation in mac80211, from Johannes Berg.
      
         2) Handle CHECKSUM_COMPLETE properly in xt_TCPMSS netfilter xtables
            module, from Eric Dumazet.
      
         3) Avoid infinite loop in UDP SO_REUSEPORT logic, also from Eric
            Dumazet.
      
         4) Avoid a NULL deref if we try to set SO_REUSEPORT after a socket is
            bound, from Craig Gallek.
      
         5) GRO key comparisons don't take lightweight tunnels into account,
            from Jesse Gross.
      
         6) Fix struct pid leak via SCM credentials in AF_UNIX, from Eric
            Dumazet.
      
         7) We need to set the rtnl_link_ops of ipv6 SIT tunnels before we
            register them, otherwise the NEWLINK netlink message is missing
            the proper attributes.  From Thadeu Lima de Souza Cascardo.
      
         8) Several Spectrum chip bug fixes for mlxsw switch driver, from Ido
            Schimmel
      
         9) Handle fragments properly in ipv4 easly socket demux, from Eric
            Dumazet.
      
        10) Don't ignore the ifindex key specifier on ipv6 output route
            lookups, from Paolo Abeni"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (128 commits)
        tcp: avoid cwnd undo after receiving ECN
        irda: fix a potential use-after-free in ircomm_param_request
        net: tg3: avoid uninitialized variable warning
        net: nb8800: avoid uninitialized variable warning
        net: vxge: avoid unused function warnings
        net: bgmac: clarify CONFIG_BCMA dependency
        net: hp100: remove unnecessary #ifdefs
        net: davinci_cpdma: use dma_addr_t for DMA address
        ipv6/udp: use sticky pktinfo egress ifindex on connect()
        ipv6: enforce flowi6_oif usage in ip6_dst_lookup_tail()
        netlink: not trim skb for mmaped socket when dump
        vxlan: fix a out of bounds access in __vxlan_find_mac
        net: dsa: mv88e6xxx: fix port VLAN maps
        fib_trie: Fix shift by 32 in fib_table_lookup
        net: moxart: use correct accessors for DMA memory
        ipv4: ipconfig: avoid unused ic_proto_used symbol
        bnxt_en: Fix crash in bnxt_free_tx_skbs() during tx timeout.
        bnxt_en: Exclude rx_drop_pkts hw counter from the stack's rx_dropped counter.
        bnxt_en: Ring free response from close path should use completion ring
        net_sched: drr: check for NULL pointer in drr_dequeue
        ...
      34229b27
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 2c923414
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       "This fixes the following issues:
      
        API:
         - algif_hash needs to wait for init operations to complete.
         - The has_key setting for shash was always true.
      
        Algorithms:
         - Add missing selections of CRYPTO_HASH.
         - Fix pkcs7 authentication.
      
        Drivers:
         - Fix stack alignment bug in chacha20-ssse3.
         - Fix performance regression in caam due to incorrect setting.
         - Fix potential compile-only build failure of stm32"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: atmel-aes - remove calls of clk_prepare() from atomic contexts
        crypto: algif_hash - wait for crypto_ahash_init() to complete
        crypto: shash - Fix has_key setting
        hwrng: stm32 - Fix dependencies for !HAS_IOMEM archs
        crypto: ghash,poly1305 - select CRYPTO_HASH where needed
        crypto: chacha20-ssse3 - Align stack pointer to 64 bytes
        PKCS#7: Don't require SpcSpOpusInfo in Authenticode pkcs7 signatures
        crypto: caam - make write transactions bufferable on PPC platforms
      2c923414
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 29a8ea4f
      Linus Torvalds authored
      Pull libnvdimm fixes from Dan Williams:
       "1/ Fixes to the libnvdimm 'pfn' device that establishes a reserved
           area for storing a struct page array.
      
        2/ Fixes for dax operations on a raw block device to prevent pagecache
           collisions with dax mappings.
      
        3/ A fix for pfn_t usage in vm_insert_mixed that lead to a null
           pointer de-reference.
      
        These have received build success notification from the kbuild robot
        across 153 configs and pass the latest ndctl tests"
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        phys_to_pfn_t: use phys_addr_t
        mm: fix pfn_t to page conversion in vm_insert_mixed
        block: use DAX for partition table reads
        block: revert runtime dax control of the raw block device
        fs, block: force direct-I/O for dax-enabled block devices
        devm_memremap_pages: fix vmem_altmap lifetime + alignment handling
        libnvdimm, pfn: fix restoring memmap location
        libnvdimm: fix mode determination for e820 devices
      29a8ea4f
    • Adrian Hunter's avatar
      perf tools: tracepoint_error() can receive e=NULL, robustify it · ec183d22
      Adrian Hunter authored
      Fixes segmentation fault using, for instance:
      
        (gdb) run record -I -e intel_pt/tsc=1,noretcomp=1/u /bin/ls
        Starting program: /home/acme/bin/perf record -I -e intel_pt/tsc=1,noretcomp=1/u /bin/ls
        Missing separate debuginfos, use: dnf debuginfo-install glibc-2.22-7.fc23.x86_64
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/lib64/libthread_db.so.1".
      
       Program received signal SIGSEGV, Segmentation fault.
        0 x00000000004b9ea5 in tracepoint_error (e=0x0, err=13, sys=0x19b1370 "sched", name=0x19a5d00 "sched_switch") at util/parse-events.c:410
        (gdb) bt
        #0  0x00000000004b9ea5 in tracepoint_error (e=0x0, err=13, sys=0x19b1370 "sched", name=0x19a5d00 "sched_switch") at util/parse-events.c:410
        #1  0x00000000004b9fc5 in add_tracepoint (list=0x19a5d20, idx=0x7fffffffb8c0, sys_name=0x19b1370 "sched", evt_name=0x19a5d00 "sched_switch", err=0x0, head_config=0x0)
            at util/parse-events.c:433
        #2  0x00000000004ba334 in add_tracepoint_event (list=0x19a5d20, idx=0x7fffffffb8c0, sys_name=0x19b1370 "sched", evt_name=0x19a5d00 "sched_switch", err=0x0, head_config=0x0)
            at util/parse-events.c:498
        #3  0x00000000004bb699 in parse_events_add_tracepoint (list=0x19a5d20, idx=0x7fffffffb8c0, sys=0x19b1370 "sched", event=0x19a5d00 "sched_switch", err=0x0, head_config=0x0)
            at util/parse-events.c:936
        #4  0x00000000004f6eda in parse_events_parse (_data=0x7fffffffb8b0, scanner=0x19a49d0) at util/parse-events.y:391
        #5  0x00000000004bc8e5 in parse_events__scanner (str=0x663ff2 "sched:sched_switch", data=0x7fffffffb8b0, start_token=258) at util/parse-events.c:1361
        #6  0x00000000004bca57 in parse_events (evlist=0x19a5220, str=0x663ff2 "sched:sched_switch", err=0x0) at util/parse-events.c:1401
        #7  0x0000000000518d5f in perf_evlist__can_select_event (evlist=0x19a3b90, str=0x663ff2 "sched:sched_switch") at util/record.c:253
        #8  0x0000000000553c42 in intel_pt_track_switches (evlist=0x19a3b90) at arch/x86/util/intel-pt.c:364
        #9  0x00000000005549d1 in intel_pt_recording_options (itr=0x19a2c40, evlist=0x19a3b90, opts=0x8edf68 <record+232>) at arch/x86/util/intel-pt.c:664
        #10 0x000000000051e076 in auxtrace_record__options (itr=0x19a2c40, evlist=0x19a3b90, opts=0x8edf68 <record+232>) at util/auxtrace.c:539
        #11 0x0000000000433368 in cmd_record (argc=1, argv=0x7fffffffde60, prefix=0x0) at builtin-record.c:1264
        #12 0x000000000049bec2 in run_builtin (p=0x8fa2a8 <commands+168>, argc=5, argv=0x7fffffffde60) at perf.c:390
        #13 0x000000000049c12a in handle_internal_command (argc=5, argv=0x7fffffffde60) at perf.c:451
        #14 0x000000000049c278 in run_argv (argcp=0x7fffffffdcbc, argv=0x7fffffffdcb0) at perf.c:495
        #15 0x000000000049c60a in main (argc=5, argv=0x7fffffffde60) at perf.c:618
      (gdb)
      
      Intel PT attempts to find the sched:sched_switch tracepoint but that seg
      faults if tracefs is not readable, because the error reporting structure
      is null, as errors are not reported when automatically adding
      tracepoints.  Fix by checking before using.
      
      Committer note:
      
      This doesn't take place in a kernel that supports
      perf_event_attr.context_switch, that is the default way that will be
      used for tracking context switches, only in older kernels, like 4.2, in
      a machine with Intel PT (e.g. Broadwell) for non-priviledged users.
      
      Further info from a similar patch by Wang:
      
      The error is in tracepoint_error: it assumes the 'e' parameter is valid.
      
      However, there are many situation a parse_event() can be called without
      parse_events_error. See result of
      
        $ grep 'parse_events(.*NULL)' ./tools/perf/ -r'
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Tong Zhang <ztong@vt.edu>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: stable@vger.kernel.org # v4.4+
      Fixes: 19658171 ("perf tools: Enhance parsing events tracepoint error output")
      Link: http://lkml.kernel.org/r/1453809921-24596-2-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ec183d22
    • Linus Torvalds's avatar
      Linux 4.5-rc2 · 36f90b0a
      Linus Torvalds authored
      36f90b0a
    • Linus Torvalds's avatar
      Merge tag 'usb-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · d784ef58
      Linus Torvalds authored
      Pull USB driver fixes from Greg KH:
       "Here are some small USB fixes and new device ids for 4.5-rc2.  Nothing
        major here, full details are in the shortlog, and all of these have
        been in linux-next successfully"
      
      * tag 'usb-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: option: fix Cinterion AHxx enumeration
        USB: mxu11x0: fix memory leak on usb_serial private data
        USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable
        USB: serial: option: Adding support for Telit LE922
        USB: serial: visor: fix crash on detecting device without write_urbs
        USB: visor: fix null-deref at probe
        USB: cp210x: add ID for IAI USB to RS485 adaptor
        usb: hub: do not clear BOS field during reset device
        cdc-acm:exclude Samsung phone 04e8:685d
        usb: cdc-acm: send zero packet for intel 7260 modem
        usb: cdc-acm: handle unlinked urb in acm read callback
      d784ef58
    • Linus Torvalds's avatar
      Merge tag 'tty-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 54e3f3e3
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are some small tty/serial driver fixes for 4.5-rc2.
      
        They resolve a number of reported problems (the ioctl one specifically
        has been pointed out by numerous people) and one patch adds some new
        device ids for the 8250_pci driver.  All have been in linux-next
        successfully"
      
      * tag 'tty-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: 8250_pci: Add Intel Broadwell ports
        staging/speakup: Use tty_ldisc_ref() for paste kworker
        n_tty: Fix unsafe reference to "other" ldisc
        tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
        tty: Retry failed reopen if tty teardown in-progress
        tty: Wait interruptibly for tty lock on reopen
      54e3f3e3
    • Linus Torvalds's avatar
      Merge tag 'staging-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 8c4e378e
      Linus Torvalds authored
      Pull staging fixes from Greg KH:
       "Here are some small staging driver fixes for 4.5-rc2.
      
        One of them predated 4.4-final, but I missed that merge window due to
        the holliday.  The others fix reported issues that have come up
        recently.  The tty change is needed for the speakup driver fix and has
        the ack of the tty driver maintainer as well, i.e.  myself :)
      
        All have been in linux-next with no reported issues"
      
      * tag 'staging-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        Staging: speakup: fix read scrolled-back VT
        Staging: speakup: Fix getting port information
        Revert "Staging: panel: usleep_range is preferred over udelay"
        iio: adis_buffer: Fix out-of-bounds memory access
      8c4e378e
    • Linus Torvalds's avatar
      Merge tag 'driver-core-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · f3ca903f
      Linus Torvalds authored
      Pull driver core fix from Greg KH:
       "Here's a single driver core fix that resolves an issue a lot of users
        have been hitting for a while now.  It's been tested a lot and has
        been in linux-next successfully for a while"
      
      * tag 'driver-core-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        base/platform: Fix platform drivers with no probe callback
      f3ca903f
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 510ae0c9
      Linus Torvalds authored
      Pull MIPS fix from Ralf Baechle:
       "Just a single revert for a patch which I had upstreamed out of
        sequence"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        Revert "MIPS: bcm63xx: nvram: Remove unused bcm63xx_nvram_get_psi_size() function"
      510ae0c9
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d517be5f
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A bit on the largish side due to a series of fixes for a regression in
        the x86 vector management which was introduced in 4.3.  This work was
        started in December already, but it took some time to fix all corner
        cases and a couple of older bugs in that area which were detected
        while at it
      
        Aside of that a few platform updates for intel-mid, quark and UV and
        two fixes for in the mm code:
         - Use proper types for pgprot values to avoid truncation
         - Prevent a size truncation in the pageattr code when setting page
           attributes for large mappings"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
        x86/mm/pat: Avoid truncation when converting cpa->numpages to address
        x86/mm: Fix types used in pgprot cacheability flags translations
        x86/platform/quark: Print boundaries correctly
        x86/platform/UV: Remove EFI memmap quirk for UV2+
        x86/platform/intel-mid: Join string and fix SoC name
        x86/platform/intel-mid: Enable 64-bit build
        x86/irq: Plug vector cleanup race
        x86/irq: Call irq_force_move_complete with irq descriptor
        x86/irq: Remove outgoing CPU from vector cleanup mask
        x86/irq: Remove the cpumask allocation from send_cleanup_vector()
        x86/irq: Clear move_in_progress before sending cleanup IPI
        x86/irq: Remove offline cpus from vector cleanup
        x86/irq: Get rid of code duplication
        x86/irq: Copy vectormask instead of an AND operation
        x86/irq: Check vector allocation early
        x86/irq: Reorganize the search in assign_irq_vector
        x86/irq: Reorganize the return path in assign_irq_vector
        x86/irq: Do not use apic_chip_data.old_domain as temporary buffer
        x86/irq: Validate that irq descriptor is still active
        x86/irq: Fix a race in x86_vector_free_irqs()
        ...
      d517be5f