[alternative-merged] mm-add-a-bounds-check-in-devm_memremap_pages.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/memremap.c: add a bounds check in devm_memremap_pages()
has been removed from the -mm tree.  Its filename was
     mm-add-a-bounds-check-in-devm_memremap_pages.patch

This patch was dropped because an alternative patch was merged

------------------------------------------------------
From: Alastair D'Silva <alastair@xxxxxxxxxxx>
Subject: mm/memremap.c: add a bounds check in devm_memremap_pages()

The call to check_hotplug_memory_addressable() validates that the memory
is fully addressable.

Without this call, it is possible that we may remap pages that is not
physically addressable, resulting in bogus section numbers being returned
from __section_nr().

Link: http://lkml.kernel.org/r/20190917010752.28395-3-alastair@xxxxxxxxxxx
Signed-off-by: Alastair D'Silva <alastair@xxxxxxxxxxx>
Acked-by: David Hildenbrand <david@xxxxxxxxxx>
Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
Cc: Ira Weiny <ira.weiny@xxxxxxxxx>
Cc: Jason Gunthorpe <jgg@xxxxxxxx>
Cc: Logan Gunthorpe <logang@xxxxxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxx>
Cc: Oscar Salvador <osalvador@xxxxxxxx>
Cc: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx>
Cc: Qian Cai <cai@xxxxxx>
Cc: Wei Yang <richard.weiyang@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/memremap.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/mm/memremap.c~mm-add-a-bounds-check-in-devm_memremap_pages
+++ a/mm/memremap.c
@@ -185,6 +185,11 @@ void *memremap_pages(struct dev_pagemap
 	int error, is_ram;
 	bool need_devmap_managed = true;
 
+	error = check_hotplug_memory_addressable(res->start,
+						 resource_size(res));
+	if (error)
+		return ERR_PTR(error);
+
 	switch (pgmap->type) {
 	case MEMORY_DEVICE_PRIVATE:
 		if (!IS_ENABLED(CONFIG_DEVICE_PRIVATE)) {
_

Patches currently in -mm which might be from alastair@xxxxxxxxxxx are

memory_hotplug-add-a-bounds-check-to-__add_pages.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux