Linux CXL
 help / color / mirror / Atom feed
* [PATCH 0/4] dax: Fix use after free and other cleanups
@ 2023-06-03  6:13 Dan Williams
  2023-06-03  6:13 ` [PATCH 1/4] dax: Fix dax_mapping_release() use after free Dan Williams
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Dan Williams @ 2023-06-03  6:13 UTC (permalink / raw)
  To: nvdimm; +Cc: Yongqiang Liu, Paul Cassella, Ira Weiny, linux-cxl

As mentioned in patch3, the reference counting of dax_region objects is
needlessly complicated, has lead to confusion [1], and has hidden a bug
[2]. While testing the cleanup for those issues, a
CONFIG_DEBUG_KOBJECT_RELEASE test run uncovered a use-after-free in
dax_mapping_release(). Clean all of that up.

Thanks to Yongqiang, Paul, and Ira for their analysis.

[1]: http://lore.kernel.org/r/20221203095858.612027-1-liuyongqiang13@huawei.com
[2]: http://lore.kernel.org/r/3cf0890b-4eb0-e70e-cd9c-2ecc3d496263@hpe.com

---

Dan Williams (4):
      dax: Fix dax_mapping_release() use after free
      dax: Use device_unregister() in unregister_dax_mapping()
      dax: Introduce alloc_dev_dax_id()
      dax: Cleanup extra dax_region references


 drivers/dax/bus.c         |   64 +++++++++++++++++++++++++++------------------
 drivers/dax/bus.h         |    1 -
 drivers/dax/cxl.c         |    8 +-----
 drivers/dax/dax-private.h |    4 ++-
 drivers/dax/hmem/hmem.c   |    8 +-----
 drivers/dax/pmem.c        |    7 +----
 6 files changed, 44 insertions(+), 48 deletions(-)

base-commit: ac2263b588dffd3a1efd7ed0b156ea6c5aea200d

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-06-16 22:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-03  6:13 [PATCH 0/4] dax: Fix use after free and other cleanups Dan Williams
2023-06-03  6:13 ` [PATCH 1/4] dax: Fix dax_mapping_release() use after free Dan Williams
2023-06-04  2:40   ` Ira Weiny
2023-06-05 20:45   ` Fan Ni
2023-06-15 17:33   ` Dave Jiang
2023-06-03  6:13 ` [PATCH 2/4] dax: Use device_unregister() in unregister_dax_mapping() Dan Williams
2023-06-04  2:41   ` Ira Weiny
2023-06-05 20:46   ` Fan Ni
2023-06-15 17:34   ` Dave Jiang
2023-06-03  6:14 ` [PATCH 3/4] dax: Introduce alloc_dev_dax_id() Dan Williams
2023-06-04  2:57   ` Ira Weiny
2023-06-16  1:22     ` Dan Williams
2023-06-16 22:11       ` Ira Weiny
2023-06-03  6:14 ` [PATCH 4/4] dax: Cleanup extra dax_region references Dan Williams
2023-06-04  2:58   ` Ira Weiny
2023-06-06 17:46   ` Fan Ni
2023-06-06 20:42     ` Ira Weiny
2023-06-15 17:45   ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox