lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 11 Apr 2019 13:09:55 +0200
From:   David Hildenbrand <>
Cc:, David Hildenbrand <>,
        Andrew Morton <>,
        Oscar Salvador <>,
        Michal Hocko <>,
        Pavel Tatashin <>,
        Wei Yang <>, Qian Cai <>,
        Arun KS <>,
        Mathieu Malaterre <>
Subject: [PATCH v2] mm/memory_hotplug: Drop memory device reference after find_memory_block()

Right now we are using find_memory_block() to get the node id for the
pfn range to online. We are missing to drop a reference to the memory
block device. While the device still gets unregistered via
device_unregister(), resulting in no user visible problem, the device is
never released via device_release(), resulting in a memory leak. Fix
that by properly using a put_device().

Fixes: d0dc12e86b31 ("mm/memory_hotplug: optimize memory hotplug")
Cc: Andrew Morton <>
Cc: Oscar Salvador <>
Cc: Michal Hocko <>
Cc: David Hildenbrand <>
Cc: Pavel Tatashin <>
Cc: Wei Yang <>
Cc: Qian Cai <>
Cc: Arun KS <>
Cc: Mathieu Malaterre <>
Reviewed-by: Oscar Salvador <>
Reviewed-by: Wei Yang <>
Acked-by: Michal Hocko <>
Signed-off-by: David Hildenbrand <>
 mm/memory_hotplug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 5eb4a4c7c21b..328878b6799d 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -854,6 +854,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 	mem = find_memory_block(__pfn_to_section(pfn));
 	nid = mem->nid;
+	put_device(&mem->dev);
 	/* associate pfn range with the zone */
 	zone = move_pfn_range(online_type, nid, pfn, nr_pages);

Powered by blists - more mailing lists