libnvdimm 4.20-rc3

- Address Range Scrub overflow continuation handling has been broken
   since it was initially merged. It was only recently that error injection
   and platform-BIOS support enabled this corner case to be exercised.
 
 - The recent attempt to provide more isolation for the kernel Address
   Range Scrub state machine from userapace initiated sessions triggers a
   lockdep report. Revert and try again at the next merge window.
 
 - Fix a kasan reported buffer overflow in libnvdimm unit test
   infrastrucutre (nfit_test)
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJb8MdUAAoJEB7SkWpmfYgCifYP/A+OQ19HybqcY2nfvqXUdQum
 Q5x3qcKmGmEbKbnCUMOHZJpEjW4c/Cpm6OKhuFDQJ4tijn1XG3/ATSi7PXrZxs/o
 CRK8MIg5Wz/mMvYRvypIkCHHHr9+Y1NjqmQynM4LLzNG24GMXaeHHuZUTnrZCDmu
 0+jBTylNgVYdykoIxgHDYDB+cd6w4NtAP5OD9D46pdsmzX9ac+OQyZMyNB3glUhd
 /ZFAoywVNfvfJVWEci9RoHiKttWxgVoCuNbSlCs2Y6ymepA44ApR9AgLHtaC9pFO
 DrPkfCzPSmf4PVSxLJd79+/sw9YOcBD7LZ5IxzozxRMuRn5pIofdZIsBg9PlwT5B
 NL9jQK87XPiG0vNxhJu3wzP+FlyCXxGxkWfApp7w4rlWBV7RgugOZHyH051rdKzQ
 44JAPzLLCfA5Mj4o2tIbSx42f2JNX93XDEX8fkUB+qs3GzyOcMtlcmz9UjmnrT0R
 o9KHKhDn81Vivxh33Ts2G0iHktO83XSUBDWApSd6erjEUXMsCLY0D8y+nDGTOMUh
 kVcY8q93sgZGLVbcxt0eGc8Q7osZYawQGRGucflTETFcxNwMyLL4F9lWgPirGeYF
 i1JDWeTrhcImYufNj8o78LsbT5xh6YjbZZ8Q1obIgPXpDtxHNIXO6COId49Zp2cK
 obftWyVp+7kYe79NWzmD
 =sfNx
 -----END PGP SIGNATURE-----

Merge tag 'libnvdimm-fixes-4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:
 "A small batch of fixes for v4.20-rc3.

  The overflow continuation fix addresses something that has been broken
  for several releases. Arguably it could wait even longer, but it's a
  one line fix and this finishes the last of the known address range
  scrub bug reports. The revert addresses a lockdep regression. The unit
  tests are not critical to fix, but no reason to hold this fix back.

  Summary:

   - Address Range Scrub overflow continuation handling has been broken
     since it was initially merged. It was only recently that error
     injection and platform-BIOS support enabled this corner case to be
     exercised.

   - The recent attempt to provide more isolation for the kernel Address
     Range Scrub state machine from userapace initiated sessions
     triggers a lockdep report. Revert and try again at the next merge
     window.

   - Fix a kasan reported buffer overflow in libnvdimm unit test
     infrastrucutre (nfit_test)"

* tag 'libnvdimm-fixes-4.20-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  Revert "acpi, nfit: Further restrict userspace ARS start requests"
  acpi, nfit: Fix ARS overflow continuation
  tools/testing/nvdimm: Fix the array size for dimm devices.
This commit is contained in:
Linus Torvalds 2018-11-18 12:21:09 -08:00
commit 25e19c1fe4
2 changed files with 9 additions and 18 deletions

View File

@ -2928,9 +2928,9 @@ static int acpi_nfit_query_poison(struct acpi_nfit_desc *acpi_desc)
return rc; return rc;
if (ars_status_process_records(acpi_desc)) if (ars_status_process_records(acpi_desc))
return -ENOMEM; dev_err(acpi_desc->dev, "Failed to process ARS records\n");
return 0; return rc;
} }
static int ars_register(struct acpi_nfit_desc *acpi_desc, static int ars_register(struct acpi_nfit_desc *acpi_desc,
@ -3341,8 +3341,6 @@ static int acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc,
struct nvdimm *nvdimm, unsigned int cmd) struct nvdimm *nvdimm, unsigned int cmd)
{ {
struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc);
struct nfit_spa *nfit_spa;
int rc = 0;
if (nvdimm) if (nvdimm)
return 0; return 0;
@ -3355,17 +3353,10 @@ static int acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc,
* just needs guarantees that any ARS it initiates are not * just needs guarantees that any ARS it initiates are not
* interrupted by any intervening start requests from userspace. * interrupted by any intervening start requests from userspace.
*/ */
mutex_lock(&acpi_desc->init_mutex); if (work_busy(&acpi_desc->dwork.work))
list_for_each_entry(nfit_spa, &acpi_desc->spas, list) return -EBUSY;
if (acpi_desc->scrub_spa
|| test_bit(ARS_REQ_SHORT, &nfit_spa->ars_state)
|| test_bit(ARS_REQ_LONG, &nfit_spa->ars_state)) {
rc = -EBUSY;
break;
}
mutex_unlock(&acpi_desc->init_mutex);
return rc; return 0;
} }
int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc, int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc,

View File

@ -140,8 +140,8 @@ static u32 handle[] = {
[6] = NFIT_DIMM_HANDLE(1, 0, 0, 0, 1), [6] = NFIT_DIMM_HANDLE(1, 0, 0, 0, 1),
}; };
static unsigned long dimm_fail_cmd_flags[NUM_DCR]; static unsigned long dimm_fail_cmd_flags[ARRAY_SIZE(handle)];
static int dimm_fail_cmd_code[NUM_DCR]; static int dimm_fail_cmd_code[ARRAY_SIZE(handle)];
static const struct nd_intel_smart smart_def = { static const struct nd_intel_smart smart_def = {
.flags = ND_INTEL_SMART_HEALTH_VALID .flags = ND_INTEL_SMART_HEALTH_VALID
@ -205,7 +205,7 @@ struct nfit_test {
unsigned long deadline; unsigned long deadline;
spinlock_t lock; spinlock_t lock;
} ars_state; } ars_state;
struct device *dimm_dev[NUM_DCR]; struct device *dimm_dev[ARRAY_SIZE(handle)];
struct nd_intel_smart *smart; struct nd_intel_smart *smart;
struct nd_intel_smart_threshold *smart_threshold; struct nd_intel_smart_threshold *smart_threshold;
struct badrange badrange; struct badrange badrange;
@ -2680,7 +2680,7 @@ static int nfit_test_probe(struct platform_device *pdev)
u32 nfit_handle = __to_nfit_memdev(nfit_mem)->device_handle; u32 nfit_handle = __to_nfit_memdev(nfit_mem)->device_handle;
int i; int i;
for (i = 0; i < NUM_DCR; i++) for (i = 0; i < ARRAY_SIZE(handle); i++)
if (nfit_handle == handle[i]) if (nfit_handle == handle[i])
dev_set_drvdata(nfit_test->dimm_dev[i], dev_set_drvdata(nfit_test->dimm_dev[i],
nfit_mem); nfit_mem);