All of lore.kernel.org
 help / color / mirror / Atom feed
* [folded-merged] device-dax-add-dis-contiguous-resource-support-fix.patch removed from -mm tree
@ 2020-09-26  2:17 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2020-09-26  2:17 UTC (permalink / raw)
  To: mm-commits, vishal.l.verma, dan.j.williams, joao.m.martins


The patch titled
     Subject: device-dax-add-dis-contiguous-resource-support-fix
has been removed from the -mm tree.  Its filename was
     device-dax-add-dis-contiguous-resource-support-fix.patch

This patch was dropped because it was folded into device-dax-add-dis-contiguous-resource-support.patch

------------------------------------------------------
From: Joao Martins <joao.m.martins@oracle.com>
Subject: device-dax-add-dis-contiguous-resource-support-fix

kfree only with nr_range == 0, while also avoiding the leakage of @ranges
(from krealloc success case with nr_ranges > 0) without the null deref
that this introduces.

Link: https://lkml.kernel.org/r/6d57acf7-63cf-168d-f68e-67d88832f10f@oracle.com
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/dax/bus.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

--- a/drivers/dax/bus.c~device-dax-add-dis-contiguous-resource-support-fix
+++ a/drivers/dax/bus.c
@@ -607,13 +607,16 @@ static int alloc_dev_dax_range(struct de
 		return -ENOMEM;
 
 	alloc = __request_region(res, start, size, dev_name(dev), 0);
-	if (!alloc && !dev_dax->nr_range) {
+	if (!alloc) {
 		/*
-		 * If we adjusted an existing @ranges leave it alone,
-		 * but if this was an empty set of ranges nothing else
+		 * If this was an empty set of ranges nothing else
 		 * will release @ranges, so do it now.
 		 */
-		kfree(ranges);
+		if (!dev_dax->nr_range) {
+			kfree(ranges);
+			ranges = NULL;
+		}
+		dev_dax->ranges = ranges;
 		return -ENOMEM;
 	}
 
_

Patches currently in -mm which might be from joao.m.martins@oracle.com are

acpi-hmat-refactor-hmat_register_target_device-to-hmem_register_device-fix.patch
acpi-hmat-attach-a-device-for-each-soft-reserved-range-fix.patch
device-dax-make-align-a-per-device-property.patch
device-dax-add-an-align-attribute-fixpatch.patch
dax-hmem-introduce-dax_hmemregion_idle-parameter.patch
device-dax-add-a-range-mapping-allocation-attribute.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-26  2:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-26  2:17 [folded-merged] device-dax-add-dis-contiguous-resource-support-fix.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.