Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5987232ybe; Tue, 10 Sep 2019 11:47:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwl3FKVzhgCVrVMdZ+Y8BzUPuiPGSDD6Nr6AqmRxxoXBwukL3RFfmCz7+8TCyhapkfzfa2K X-Received: by 2002:aa7:dc59:: with SMTP id g25mr32718253edu.183.1568141230568; Tue, 10 Sep 2019 11:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568141230; cv=none; d=google.com; s=arc-20160816; b=rqm+QE0ig/1U/4dClJzrWK7atDG7F1ifQT9DmNaCzYYzLjAynv/Vmo4Lvboc9r7840 eH0LQ7JTYK+bnLsHK86jQSnANNzxnRFB5U6lmbNG+pKho19BjitRVg135OL99rE3YX8B 7ZizyzwBWkdqR5D6qXHorArXzkoWrqKkBU4itukYL8NnZ9Ukl8zub7ssmSoKpIoEM3Fm 56cVC1+HNTkMhRnh5Uc85HgZXbW24h2smI6Ze4Ae6jqgGUnUyAhB2fRISBHHLlql3B/j QEq2ol0+F+g6QWF4oWi2hWIALX9ZvmLyaYtNKt1KtR1H9vPLmgMW0rKlVYuMkm6lmPsB L/mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:date:subject:cc:to:from; bh=DLHELeHd/uFsJlPtYgZSqM6AtqQQxPec1I2/p6f+E5M=; b=N4qP40M9e98pba5EbFAtuHkuErMFldE/tQmOlAnM+FOkeVYoLqw5VcPHSS4Yfm8YGR kdeg0xL+EF5Og0EMr+ouNmt1DR54/dPRF0rzW2ZmqquGic9cFWI7TLtpKsFhEB+FChK7 LVrvErN8Bjc0AXo+mp94WnuiCQELygtUaEawTsn3gPnWYw4smyLo7kN6tWgMNF0aW2nX DbKdFltacqw8lhmbl5avTQEx5tXIV6YtL1P7ArUpWwVM4KHcIJIn3VtUM83/6nGtRdnn utPLHLS6+BahIahW2NcR5KpbcDuyFDvIYSX4Px4S1qnqOarzbstah1pC79qzX1RBDXSk o+IQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id um16si1495889ejb.256.2019.09.10.11.46.46; Tue, 10 Sep 2019 11:47:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392784AbfIJCw4 (ORCPT + 99 others); Mon, 9 Sep 2019 22:52:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:28016 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727298AbfIJCw4 (ORCPT ); Mon, 9 Sep 2019 22:52:56 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8A2qAt7049926 for ; Mon, 9 Sep 2019 22:52:54 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ux2jah7gq-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 09 Sep 2019 22:52:54 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Sep 2019 03:52:52 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 10 Sep 2019 03:52:47 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8A2qkvu53608532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Sep 2019 02:52:46 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BD32E52052; Tue, 10 Sep 2019 02:52:46 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6B1D75204E; Tue, 10 Sep 2019 02:52:46 +0000 (GMT) Received: from adsilva.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 093D3A01D3; Tue, 10 Sep 2019 12:52:43 +1000 (AEST) From: "Alastair D'Silva" To: alastair@d-silva.org Cc: Andrew Morton , David Hildenbrand , Oscar Salvador , Michal Hocko , Pavel Tatashin , Dan Williams , Wei Yang , Qian Cai , Jason Gunthorpe , Logan Gunthorpe , Ira Weiny , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] Add bounds check for Hotplugged memory Date: Tue, 10 Sep 2019 12:52:19 +1000 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19091002-0028-0000-0000-0000039A4265 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091002-0029-0000-0000-0000245CA3B9 Message-Id: <20190910025225.25904-1-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-10_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=551 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909100026 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alastair D'Silva This series adds bounds checks for hotplugged memory, ensuring that it is within the physically addressable range (for platforms that define MAX_(POSSIBLE_)PHYSMEM_BITS. This allows for early failure, rather than attempting to access bogus section numbers. Alastair D'Silva (2): memory_hotplug: Add a bounds check to check_hotplug_memory_range() mm: Add a bounds check in devm_memremap_pages() include/linux/memory_hotplug.h | 1 + mm/memory_hotplug.c | 19 ++++++++++++++++++- mm/memremap.c | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) -- 2.21.0