KASAN reports a global-out-of-bounds access when running these nfit
tests: clear.sh, pmem-errors.sh, pfn-meta-errors.sh, btt-errors.sh,
daxdev-errors.sh, and inject-error.sh.
[] BUG: KASAN: global-out-of-bounds in nfit_test_ctl+0x769f/0x7840 [nfit_test]
[] Read of size 4 at addr ffffffffc03ea01c by task ndctl/1215
[] The buggy address belongs to the variable:
[] handle+0x1c/0x1df4 [nfit_test]
nfit_test_search_spa() uses handle[nvdimm->id] to retrieve a device
handle and triggers a KASAN error when it reads past the end of the
handle array. It should not be indexing the handle array at all.
The correct device handle is stored in per-DIMM test data. Each DIMM
has a struct nfit_mem that embeds a struct acpi_nfit_memdev that
describes the NFIT device handle. Use that device handle here.
Fixes:
|
||
|---|---|---|
| .. | ||
| test | ||
| Kbuild | ||
| Makefile | ||
| acpi_nfit_test.c | ||
| config_check.c | ||
| dax-dev.c | ||
| dax_pmem_test.c | ||
| device_dax_test.c | ||
| libnvdimm_test.c | ||
| pmem-dax.c | ||
| pmem_test.c | ||
| watermark.h | ||