1. 31 8月, 2016 1 次提交
    • M
      lkdtm: Mark lkdtm_rodata_do_nothing() notrace · c012268b
      Michael Ellerman 提交于
      lkdtm_rodata_do_nothing() is an empty function which is generated in
      order to test the non-executability of rodata.
      
      Currently if function tracing is enabled then an mcount callsite will be
      generated for lkdtm_rodata_do_nothing(), and it will appear in the list
      of available functions for function tracing (available_filter_functions).
      
      Given it's purpose purely as a test function, it seems preferable for
      lkdtm_rodata_do_nothing() to be marked notrace, so it doesn't appear as
      traceable.
      
      This also avoids triggering a linker bug on powerpc:
      
        https://sourceware.org/bugzilla/show_bug.cgi?id=20428
      
      When the linker sees code that needs to generate a call stub, eg. a
      branch to mcount(), it assumes the section is executable and
      dereferences a NULL pointer leading to a linker segfault. Marking
      lkdtm_rodata_do_nothing() notrace avoids triggering the bug because the
      function contains no other function calls.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c012268b
  2. 30 8月, 2016 1 次提交
  3. 22 8月, 2016 1 次提交
  4. 15 8月, 2016 1 次提交
  5. 10 8月, 2016 1 次提交
  6. 09 8月, 2016 2 次提交
  7. 04 8月, 2016 1 次提交
    • K
      dma-mapping: use unsigned long for dma_attrs · 00085f1e
      Krzysztof Kozlowski 提交于
      The dma-mapping core and the implementations do not change the DMA
      attributes passed by pointer.  Thus the pointer can point to const data.
      However the attributes do not have to be a bitfield.  Instead unsigned
      long will do fine:
      
      1. This is just simpler.  Both in terms of reading the code and setting
         attributes.  Instead of initializing local attributes on the stack
         and passing pointer to it to dma_set_attr(), just set the bits.
      
      2. It brings safeness and checking for const correctness because the
         attributes are passed by value.
      
      Semantic patches for this change (at least most of them):
      
          virtual patch
          virtual context
      
          @r@
          identifier f, attrs;
      
          @@
          f(...,
          - struct dma_attrs *attrs
          + unsigned long attrs
          , ...)
          {
          ...
          }
      
          @@
          identifier r.f;
          @@
          f(...,
          - NULL
          + 0
           )
      
      and
      
          // Options: --all-includes
          virtual patch
          virtual context
      
          @r@
          identifier f, attrs;
          type t;
      
          @@
          t f(..., struct dma_attrs *attrs);
      
          @@
          identifier r.f;
          @@
          f(...,
          - NULL
          + 0
           )
      
      Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.comSigned-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Acked-by: NVineet Gupta <vgupta@synopsys.com>
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Acked-by: NHans-Christian Noren Egtvedt <egtvedt@samfundet.no>
      Acked-by: Mark Salter <msalter@redhat.com> [c6x]
      Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> [cris]
      Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> [drm]
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
      Acked-by: Fabien Dessenne <fabien.dessenne@st.com> [bdisp]
      Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> [vb2-core]
      Acked-by: David Vrabel <david.vrabel@citrix.com> [xen]
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [xen swiotlb]
      Acked-by: Joerg Roedel <jroedel@suse.de> [iommu]
      Acked-by: Richard Kuo <rkuo@codeaurora.org> [hexagon]
      Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
      Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> [s390]
      Acked-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> [avr32]
      Acked-by: Vineet Gupta <vgupta@synopsys.com> [arc]
      Acked-by: Robin Murphy <robin.murphy@arm.com> [arm64 and dma-iommu]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      00085f1e
  8. 02 8月, 2016 4 次提交
  9. 19 7月, 2016 3 次提交
  10. 18 7月, 2016 10 次提交
  11. 16 7月, 2016 2 次提交
    • K
      lkdtm: silence warnings about function declarations · 6d2e91a6
      Kees Cook 提交于
      When building under W=1, the lack of lkdtm.h in lkdtm_usercopy.c and
      lkdtm_rodata.c was discovered. This fixes the issue and consolidates
      the common header and the pr_fmt macro for simplicity and regularity
      across each test source file.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6d2e91a6
    • A
      lkdtm: hide unused functions · 2b271cb7
      Arnd Bergmann 提交于
      A conversion of the lkdtm core module added an "#ifdef CONFIG_KPROBES" check,
      but a number of functions then become unused:
      
      drivers/misc/lkdtm_core.c:340:16: error: 'lkdtm_debugfs_entry' defined but not used [-Werror=unused-function]
      drivers/misc/lkdtm_core.c:122:12: error: 'jp_generic_ide_ioctl' defined but not used [-Werror=unused-function]
      drivers/misc/lkdtm_core.c:114:12: error: 'jp_scsi_dispatch_cmd' defined but not used [-Werror=unused-function]
      drivers/misc/lkdtm_core.c:106:12: error: 'jp_hrtimer_start' defined but not used [-Werror=unused-function]
      drivers/misc/lkdtm_core.c:97:22: error: 'jp_shrink_inactive_list' defined but not used [-Werror=unused-function]
      drivers/misc/lkdtm_core.c:89:13: error: 'jp_ll_rw_block' defined but not used [-Werror=unused-function]
      drivers/misc/lkdtm_core.c:83:13: error: 'jp_tasklet_action' defined but not used [-Werror=unused-function]
      drivers/misc/lkdtm_core.c:75:20: error: 'jp_handle_irq_event' defined but not used [-Werror=unused-function]
      drivers/misc/lkdtm_core.c:68:21: error: 'jp_do_irq' defined but not used [-Werror=unused-function]
      
      This adds the same #ifdef everywhere. There is probably a better way to do the
      same thing, but for now this avoids the new warnings.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: c479e3fd ("lkdtm: use struct arrays instead of enums")
      [kees: moved some code around to better consolidate the #ifdefs]
      Signed-off-by: NKees Cook <keescook@chromium.org>
      2b271cb7
  12. 14 7月, 2016 12 次提交
  13. 08 7月, 2016 1 次提交