1. 23 11月, 2022 2 次提交
  2. 07 1月, 2021 2 次提交
  3. 29 9月, 2020 2 次提交
  4. 21 7月, 2020 1 次提交
  5. 04 9月, 2019 6 次提交
  6. 04 7月, 2019 3 次提交
    • S
      coresight: tmc: Smatch: Fix potential NULL pointer dereference · 17c20f32
      Suzuki K Poulose 提交于
      Based on the following report from Smatch, fix the potential
      NULL pointer dereference check.
      
      The patch 743256e214e8: "coresight: tmc: Clean up device specific
      data" from May 22, 2019, leads to the following Smatch complaint:
      
          drivers/hwtracing/coresight/coresight-tmc-etr.c:625 tmc_etr_free_flat_buf()
          warn: variable dereferenced before check 'flat_buf' (see line 623)
      
      drivers/hwtracing/coresight/coresight-tmc-etr.c
         622		struct etr_flat_buf *flat_buf = etr_buf->private;
         623		struct device *real_dev = flat_buf->dev->parent;
                                                ^^^^^^^^^^
      The patch introduces a new NULL check
      
         624
         625		if (flat_buf && flat_buf->daddr)
                          ^^^^^^^^
      but the existing code assumed it can be NULL.
      
         626			dma_free_coherent(real_dev, flat_buf->size,
         627					  flat_buf->vaddr, flat_buf->daddr);
      
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20190621175205.24551-3-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17c20f32
    • S
      coresight: tmc-etr: alloc_perf_buf: Do not call smp_processor_id from preemptible · 3a871039
      Suzuki K Poulose 提交于
      During a perf session we try to allocate buffers on the "node" associated
      with the CPU the event is bound to. If it is not bound to a CPU, we
      use the current CPU node, using smp_processor_id(). However this is unsafe
      in a pre-emptible context and could generate the splats as below :
      
       BUG: using smp_processor_id() in preemptible [00000000] code: perf/1743
       caller is tmc_alloc_etr_buffer+0x1bc/0x1f0
       CPU: 1 PID: 1743 Comm: perf Not tainted 5.1.0-rc6-147786-g116841e #344
       Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Feb  1 2019
       Call trace:
        dump_backtrace+0x0/0x150
        show_stack+0x14/0x20
        dump_stack+0x9c/0xc4
        debug_smp_processor_id+0x10c/0x110
        tmc_alloc_etr_buffer+0x1bc/0x1f0
        etm_setup_aux+0x1c4/0x230
        rb_alloc_aux+0x1b8/0x2b8
        perf_mmap+0x35c/0x478
        mmap_region+0x34c/0x4f0
        do_mmap+0x2d8/0x418
        vm_mmap_pgoff+0xd0/0xf8
        ksys_mmap_pgoff+0x88/0xf8
        __arm64_sys_mmap+0x28/0x38
        el0_svc_handler+0xd8/0x138
        el0_svc+0x8/0xc
      
      Use NUMA_NO_NODE hint instead of using the current node for events
      not bound to CPUs.
      
      Fixes: 22f429f1 ("coresight: etm-perf: Add support for ETR backend")
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Cc: stable <stable@vger.kernel.org> # 4.20+
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20190620221237.3536-3-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3a871039
    • S
      coresight: tmc-etr: Do not call smp_processor_id() from preemptible · 3ff44563
      Suzuki K Poulose 提交于
      During a perf session we try to allocate buffers on the "node" associated
      with the CPU the event is bound to. If it's not bound to a CPU, we use
      the current CPU node, using smp_processor_id(). However this is unsafe
      in a pre-emptible context and could generate the splats as below :
      
       BUG: using smp_processor_id() in preemptible [00000000] code: perf/1743
       caller is alloc_etr_buf.isra.6+0x80/0xa0
       CPU: 1 PID: 1743 Comm: perf Not tainted 5.1.0-rc6-147786-g116841e #344
       Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Feb  1 2019
        Call trace:
         dump_backtrace+0x0/0x150
         show_stack+0x14/0x20
         dump_stack+0x9c/0xc4
         debug_smp_processor_id+0x10c/0x110
         alloc_etr_buf.isra.6+0x80/0xa0
         tmc_alloc_etr_buffer+0x12c/0x1f0
         etm_setup_aux+0x1c4/0x230
         rb_alloc_aux+0x1b8/0x2b8
         perf_mmap+0x35c/0x478
         mmap_region+0x34c/0x4f0
         do_mmap+0x2d8/0x418
         vm_mmap_pgoff+0xd0/0xf8
         ksys_mmap_pgoff+0x88/0xf8
         __arm64_sys_mmap+0x28/0x38
         el0_svc_handler+0xd8/0x138
         el0_svc+0x8/0xc
      
      Use NUMA_NO_NODE hint instead of using the current node for events
      not bound to CPUs.
      
      Fixes: 855ab61c ("coresight: tmc-etr: Refactor function tmc_etr_setup_perf_buf()")
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20190620221237.3536-2-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3ff44563
  7. 20 6月, 2019 4 次提交
  8. 26 4月, 2019 11 次提交
  9. 26 9月, 2018 9 次提交