libnvdimm fixes for v5.9-rc3

Fix an out-of-bounds access introduced in libnvdimm v5.9-rc1
 dax: do not print error message for non-persistent memory block device
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQT9vPEBxh63bwxRYEEPzq5USduLdgUCX0Q6ugAKCRAPzq5USduL
 drnTAQDZ7JuOqRzfCggt3ehlvhZvoubzJEzQDcha8OAAgaSJbQD/aF0KnuxJuRJx
 y9S8MBHnDVawxDcr4GCs6oY4DoYdbQY=
 =Np+5
 -----END PGP SIGNATURE-----

Merge tag 'libnvdimm-fix-v5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Vishal Verma:
 "A couple of minor fixes for things merged in 5.9-rc1.

  One is an out-of-bounds access caught by KASAN, and the second is a
  tweak to some overzealous logging about dax support even for
  traditional block devices which was unnecessary"

* tag 'libnvdimm-fix-v5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
  dax: do not print error message for non-persistent memory block device
  libnvdimm: KASAN: global-out-of-bounds Read in internal_create_group
This commit is contained in:
Linus Torvalds 2020-08-25 11:42:43 -07:00
commit d7d1f235aa
2 changed files with 7 additions and 0 deletions

View file

@ -100,6 +100,12 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev,
return false;
}
if (!dax_dev && !bdev_dax_supported(bdev, blocksize)) {
pr_debug("%s: error: dax unsupported by block device\n",
bdevname(bdev, buf));
return false;
}
id = dax_read_lock();
len = dax_direct_access(dax_dev, pgoff, 1, &kaddr, &pfn);
len2 = dax_direct_access(dax_dev, pgoff_end, 1, &end_kaddr, &end_pfn);

View file

@ -529,6 +529,7 @@ static DEVICE_ATTR_ADMIN_RW(activate);
static struct attribute *nvdimm_firmware_attributes[] = {
&dev_attr_activate.attr,
&dev_attr_result.attr,
NULL,
};
static umode_t nvdimm_firmware_visible(struct kobject *kobj, struct attribute *a, int n)