linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Joao Martins <joao.m.martins@oracle.com>
Cc: kernel test robot <lkp@intel.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Vishal L Verma <vishal.l.verma@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [linux-next:master] BUILD REGRESSION 3a00d3dfd4b68b208ecd5405e676d06c8ad6bb63
Date: Wed, 26 Aug 2020 11:32:45 -0700	[thread overview]
Message-ID: <20200826113245.8710d52e7539cb2b643f670c@linux-foundation.org> (raw)
In-Reply-To: <6d57acf7-63cf-168d-f68e-67d88832f10f@oracle.com>

On Wed, 26 Aug 2020 17:13:12 +0100 Joao Martins <joao.m.martins@oracle.com> wrote:

> This should have been:

Thanks.

> 
> And also the MEMORY_HOTPLUG=n and ACPI=n build issues that Randy/you fixed which are
> introduced by this series too. Just to confirm: I should add up all these fixes and respin
> the series right? Or should I follow-up the first one on top of what you've already staged
> in -mm tree?

That's OK, I've been scooping up the fixes.

https://ozlabs.org/~akpm/mmots/broken-out/mm-memory_hotplug-introduce-default-phys_to_target_node-implementation-fix.patch

https://ozlabs.org/~akpm/mmots/broken-out/device-dax-make-align-a-per-device-property-fix.patch

and this one,

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;
 	}
 
_



  reply	other threads:[~2020-08-26 18:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 21:06 kernel test robot
2020-08-25 21:32 ` Andrew Morton
2020-08-26 16:13   ` Joao Martins
2020-08-26 18:32     ` Andrew Morton [this message]
2020-08-26 19:45       ` Joao Martins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200826113245.8710d52e7539cb2b643f670c@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=joao.m.martins@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox