]> git.itanic.dy.fi Git - linux-stable/commit
libnvdimm: fix namespace object confusion in is_uuid_busy()
authorDan Williams <dan.j.williams@intel.com>
Wed, 6 Jan 2016 02:37:23 +0000 (18:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Feb 2016 20:01:21 +0000 (12:01 -0800)
commit6e8ea2f2258caf0d2a876b36c15a93788a7cde93
tree9f37e48c1fc8ef1bde49f86b40e24fea8dc75c4e
parentbd55913cf20804d2c3d4d83e79d9867963af2ff1
libnvdimm: fix namespace object confusion in is_uuid_busy()

commit e07ecd76d4db7bda1e9495395b2110a3fe28845a upstream.

When btt devices were re-worked to be child devices of regions this
routine was overlooked.  It mistakenly attempts to_nd_namespace_pmem()
or to_nd_namespace_blk() conversions on btt and pfn devices.  By luck to
date we have happened to be hitting valid memory leading to a uuid
miscompare, but a recent change to struct nd_namespace_common causes:

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000001
 IP: [<ffffffff814610dc>] memcmp+0xc/0x40
 [..]
 Call Trace:
  [<ffffffffa0028631>] is_uuid_busy+0xc1/0x2a0 [libnvdimm]
  [<ffffffffa0028570>] ? to_nd_blk_region+0x50/0x50 [libnvdimm]
  [<ffffffff8158c9c0>] device_for_each_child+0x50/0x90

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/namespace_devs.c
drivers/nvdimm/region_devs.c