1. 24 Sep, 2019 1 commit
  2. 20 Aug, 2019 1 commit
  3. 15 Aug, 2019 1 commit
  4. 02 Jul, 2019 3 commits
  5. 14 Jun, 2019 1 commit
  6. 05 Jun, 2019 1 commit
  7. 22 Apr, 2019 1 commit
    • Vishal Verma's avatar
      tools/testing/nvdimm: add watermarks for dax_pmem* modules · 92f6f2d7
      Vishal Verma authored
      
      
      Add nfit_test 'watermarks' for the dax_pmem, dax_pmem_core, and
      dax_pmem_compat modules. This causes the nfit_test module to fail
      loading in case any of these modules are also not overridden with the
      ldconfig wrapped modules. Without this, nfit_test would sometimes fail
      creation of device-dax namespaces on the nfit_test_bus with an unhelpful
      error log such as:
      
          dax_pmem dax5.0: could not reserve metadata
          dax_pmem: probe of dax5.0 failed with error -16
      
      Which was caused due to the unwrapped version of
      devm_request_mem_region() being called.
      
      Cc: Dan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      92f6f2d7
  8. 08 Apr, 2019 1 commit
  9. 30 Mar, 2019 1 commit
    • Dave Jiang's avatar
      libnvdimm/security: provide fix for secure-erase to use zero-key · 037c8489
      Dave Jiang authored
      
      
      Add a zero key in order to standardize hardware that want a key of 0's to
      be passed. Some platforms defaults to a zero-key with security enabled
      rather than allow the OS to enable the security. The zero key would allow
      us to manage those platform as well. This also adds a fix to secure erase
      so it can use the zero key to do crypto erase. Some other security commands
      already use zero keys. This introduces a standard zero-key to allow
      unification of semantics cross nvdimm security commands.
      
      Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      037c8489
  10. 28 Dec, 2018 2 commits
  11. 21 Dec, 2018 3 commits
  12. 05 Dec, 2018 1 commit
  13. 05 Nov, 2018 1 commit
    • Masayoshi Mizuma's avatar
      tools/testing/nvdimm: Fix the array size for dimm devices. · af31b04b
      Masayoshi Mizuma authored
      KASAN reports following global out of bounds access while
      nfit_test is being loaded. The out of bound access happens
      the following reference to dimm_fail_cmd_flags[dimm]. 'dimm' is
      over than the index value, NUM_DCR (==5).
      
        static int override_return_code(int dimm, unsigned int func, int rc)
        {
                if ((1 << func) & dimm_fail_cmd_flags[dimm]) {
      
      dimm_fail_cmd_flags[] definition:
        static unsigned long dimm_fail_cmd_flags[NUM_DCR];
      
      'dimm' is the return value of get_dimm(), and get_dimm() returns
      the index of handle[] array. The handle[] has 7 index. Let's use
      ARRAY_SIZE(handle) as the array size.
      
      KASAN report:
      
      ==================================================================
      BUG: KASAN: global-out-of-bounds in nfit_test_ctl+0x47bb/0x55b0 [nfit_test]
      Read of size 8 at addr ffffffffc10cbbe8 by task kworker/u41:0/8
      ...
      Call Trace:
       dump_stack+0xea/0x1b0
       ? dump_stack_print_info.cold.0+0x1b/0x1b
       ? kmsg_dump_rewind_nolock+0xd9/0xd9
       print_address_description+0x65/0x22e
       ? nfit_test_ctl+0x47bb/0x55b0 [nfit_test]
       kasan_report.cold.6+0x92/0x1a6
       nfit_test_ctl+0x47bb/0x55b0 [nfit_test]
      ...
      The buggy address belongs to the variable:
       dimm_fail_cmd_flags+0x28/0xffffffffffffa440 [nfit_test]
      ==================================================================
      
      Fixes: 39611e83
      
       ("tools/testing/nvdimm: Make DSM failure code injection...")
      Signed-off-by: default avatarMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      af31b04b
  14. 17 Oct, 2018 2 commits
  15. 01 Aug, 2018 1 commit
    • Vishal Verma's avatar
      tools/testing/nvdimm: improve emulation of smart injection · b4d4702f
      Vishal Verma authored
      
      
      The emulation for smart injection commands for nfit neglected to check
      the smart field validity flags before injecting to that field. This is
      required as a way to distinguish un-injection vs. leave-alone.
      
      The emulation was also missing support for un-injection entirely. To add
      this support, first, fix the above flags check. Second, use the
      'enable' field in the injection command to determine injection vs
      un-injection. Third, move the smart initialization struct to be a global
      static structure for the nfit_test module. Reference this to get the
      smart 'defaults' when un-injecting a smart field.
      
      Signed-off-by: default avatarVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
      b4d4702f
  16. 14 Jul, 2018 2 commits
  17. 30 Jun, 2018 1 commit
  18. 23 May, 2018 1 commit
    • Dan Williams's avatar
      x86, nfit_test: Add unit test for memcpy_mcsafe() · 5d8beee2
      Dan Williams authored
      
      
      Given the fact that the ACPI "EINJ" (error injection) facility is not
      universally available, implement software infrastructure to validate the
      memcpy_mcsafe() exception handling implementation.
      
      For each potential read exception point in memcpy_mcsafe(), inject a
      emulated exception point at the address identified by 'mcsafe_inject'
      variable. With this infrastructure implement a test to validate that the
      'bytes remaining' calculation is correct for a range of various source
      buffer alignments.
      
      This code is compiled out by default. The CONFIG_MCSAFE_DEBUG
      configuration symbol needs to be manually enabled by editing
      Kconfig.debug. I.e. this functionality can not be accidentally enabled
      by a user / distro, it's only for development.
      
      Cc: <x86@kernel.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Reported-by: default avatarTony Luck <tony.luck@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      5d8beee2
  19. 16 Apr, 2018 4 commits
  20. 06 Apr, 2018 2 commits
  21. 06 Mar, 2018 3 commits
    • Ross Zwisler's avatar
      nfit_test: prevent parsing error of nfit_test.0 · 1526f9e2
      Ross Zwisler authored
      
      
      When you load nfit_test you currently see the following error in dmesg:
      
       nfit_test nfit_test.0: found a zero length table '0' parsing nfit
      
      This happens because when we parse the nfit_test.0 table via
      acpi_nfit_init(), we specify a size of nfit_test->nfit_size.  For the first
      pass through nfit_test.0 where (t->setup_hotplug == 0) this is the size of
      the entire buffer we allocated, including space for the hot plug
      structures, not the size that we've actually filled in.
      
      Fix this by only trying to parse the size of the structures that we've
      filled in.
      
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      1526f9e2
    • Ross Zwisler's avatar
      nfit_test: fix buffer overrun, add sanity check · 9741a559
      Ross Zwisler authored
      
      
      It turns out that we were overrunning the 'nfit_buf' buffer in
      nfit_test0_setup() in the (t->setup_hotplug == 1) case because we failed to
      correctly account for all of the acpi_nfit_memory_map structures.
      
      Fix the structure count which will increase the allocation size of
      'nfit_buf' in nfit_test0_alloc().  Also add some WARN_ON()s to
      nfit_test0_setup() and nfit_test1_setup() to catch future issues where the
      size of the buffer doesn't match the amount of data we're writing.
      
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      9741a559
    • Ross Zwisler's avatar
      nfit_test: improve structure offset handling · d7d8464d
      Ross Zwisler authored
      
      
      In nfit_test0_setup() and nfit_test1_setup() we keep an 'offset' value
      which we use to calculate where in our 'nfit_buf' we will place our next
      structure.  The handling of 'offset' and the calculation of the placement
      of the next structure is a bit inconsistent, though.  We don't update
      'offset' after we insert each structure, sometimes causing us to update it
      for multiple structures' sizes at once.  When calculating the position of
      the next structure we aren't always able to just use 'offset', but
      sometimes have to add in other structure sizes as well.
      
      Fix this by updating 'offset' after each structure insertion in a
      consistent way, allowing us to always calculate the position of the next
      structure to be inserted by just using 'nfit_buf + offset'.
      
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      d7d8464d
  22. 02 Feb, 2018 3 commits
  23. 01 Feb, 2018 1 commit
  24. 08 Jan, 2018 1 commit
  25. 04 Dec, 2017 1 commit