Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3848769ybe; Mon, 16 Sep 2019 02:19:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxE1nHGM/Biy1L8IrA/9ZJrLA3lUxB1QcIZul9TCVmL1aNETonQhcx2M+XHBBipM3V6ww7n X-Received: by 2002:a17:906:5fc4:: with SMTP id k4mr5564898ejv.300.1568625589219; Mon, 16 Sep 2019 02:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568625589; cv=none; d=google.com; s=arc-20160816; b=G01mRktTgvT0xt5zwVkNlkA8Iqeu3e7UhsQeBdJzaTTPnthSmWsrdnesA9PpFn5UEP YitC96VKFKn1eHXFGXEsJ7h183upVqY72J10JPBxWpVAMpxuSIYmg8V42wW94dkGV5SS U8SYcgw8LVj1voZ4VCcQBR+5Fim3MYcRMx6LuFTT9zY2Z0zAL8AW/JcjMGi91NffOCne ETQj/nmlVz1p+XLNoGdJgrfazwrpTrDxwXELLFISKKJdcCdbT9l9c9AZv5kgNfteK8b2 CbsRWYKfNl1JXeTRvle0Hh9tKQofNYNiZxKD2pQvFn9vfU779EKMPuIdwfFZ1smZtOjK LzgQ== 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=+0TPiBUhPpdBmSCniM9qiswQcLJ6b5qth4Hv5UtKgs0=; b=FfVueyHnn93xEYmqBryydD/eK9+tcq9vkytRvskg94dNJXeeif9sL+x+3bG2nY+Yix CFYJOlqz/PfZv3TjQ4sWWCbWOVLB3mnASYdW0Jeh+8I/nnX94p2oC7ym01ixXur2mBwN My1XGrLN03xnHqwqiYryRNHhdmHw91V7mK/SxUPLq2bVpklFwGW6pY8wPYmDxis57W90 Awyt+GpcEkmbjevWYXH74c7G6F0OFatuytf4uWoR+z1572298I5Y5YyonCG7O7YlUiSD aNaBxveNBghEhyHwAW6P0/MbWOZ4g2OaP2S9xjSfHkegbYHOnt2J5Yi3VnuDrN0RLO1v KQuw== 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 m14si2579991ejq.70.2019.09.16.02.19.24; Mon, 16 Sep 2019 02:19:49 -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 S1729427AbfIPGGt (ORCPT + 99 others); Mon, 16 Sep 2019 02:06:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57030 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725270AbfIPGGt (ORCPT ); Mon, 16 Sep 2019 02:06:49 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8G61rLR008774 for ; Mon, 16 Sep 2019 02:06:46 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2v24jh8ebw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 16 Sep 2019 02:06:45 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 16 Sep 2019 07:06:44 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 16 Sep 2019 07:06:39 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8G66c9755574628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Sep 2019 06:06:38 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8A4911C050; Mon, 16 Sep 2019 06:06:38 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53A8811C04C; Mon, 16 Sep 2019 06:06:38 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 16 Sep 2019 06:06:38 +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 CDA59A01B5; Mon, 16 Sep 2019 16:06:36 +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 v2 0/2] Add bounds check for Hotplugged memory Date: Mon, 16 Sep 2019 16:05:38 +1000 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19091606-0012-0000-0000-0000034C692D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091606-0013-0000-0000-00002186DDB4 Message-Id: <20190916060544.21824-1-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-16_03:,, 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=572 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909160066 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. Changelog: V2: - Don't use MAX_POSSIBLE_PHYSMEM_BITS as it's wider that what may be available 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 | 13 ++++++++++++- mm/memremap.c | 8 ++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) -- 2.21.0