Message ID | 20190923203427.294286-4-pasha.tatashin@soleen.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=YfP3=XS=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5359D17EE for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 23 Sep 2019 20:34:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 15D0021783 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 23 Sep 2019 20:34:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="oWTaiXQU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 15D0021783 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0119D6B0285; Mon, 23 Sep 2019 16:34:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F02CB6B0287; Mon, 23 Sep 2019 16:34:46 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D81A46B0285; Mon, 23 Sep 2019 16:34:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id AB54C6B0285 for <linux-mm@kvack.org>; Mon, 23 Sep 2019 16:34:46 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 5B067180AD808 for <linux-mm@kvack.org>; Mon, 23 Sep 2019 20:34:46 +0000 (UTC) X-FDA: 75967338972.05.guide72_80eb32a7c3519 X-Spam-Summary: 2,0,0,f945fe4e6ec46617,d41d8cd98f00b204,pasha.tatashin@soleen.com,:pasha.tatashin@soleen.com:jmorris@namei.org:sashal@kernel.org:ebiederm@xmission.com:kexec@lists.infradead.org:linux-kernel@vger.kernel.org:corbet@lwn.net:catalin.marinas@arm.com:will@kernel.org:linux-arm-kernel@lists.infradead.org:marc.zyngier@arm.com:james.morse@arm.com:vladimir.murzin@arm.com:matthias.bgg@gmail.com:bhsharma@redhat.com::mark.rutland@arm.com,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1381:1437:1515:1534:1541:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2896:3138:3139:3140:3141:3142:3352:3867:3870:3871:3872:3874:4321:5007:6117:6119:6120:6261:6653:6737:7901:7903:10004:11026:11658:11914:12043:12048:12297:12438:12517:12519:12555:12679:12895:13069:13161:13229:13311:13357:13870:13894:14096:14181:14384:14394:14721:21080:21444:21451:21627:30054:30070,0,RBL:209.85.214.194:@soleen.com:.lbl8.mailshell.net-62.2.0.100 66.100.201.201,CacheIP:none,Bayesian:0.5, 0.5,0.5, X-HE-Tag: guide72_80eb32a7c3519 X-Filterd-Recvd-Size: 4278 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf20.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Mon, 23 Sep 2019 20:34:45 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id u12so6996104pls.12 for <linux-mm@kvack.org>; Mon, 23 Sep 2019 13:34:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=4PNhEWMnxTPqUB+Gwx2nqJhU+kkzlGq5UWgg81CPAOk=; b=oWTaiXQUOW/n+bZ3aNPNA4OtwzBJkIcKJ7w8UHidzdwXhLyBh7H6XeCFOH4hrLa0TF 5tO48HD+yimpY3hC6jgRBluPwrr5tgxt77/q6RSoQIg8t/tRCWOU6l8oYNCNvsXRKB4D Z8cHhyCyQ6gPEYAU2u5cdpMqDzvOZEnFOvri1Ewy4jmdOYjAh+x8UWdyU39v2SL5rPSV K4dkoFFYKtiBQ1BjRZfz7omkXdFczekyPXcpEcNWyxECRtdRYNCDtUFUDOsq8wHx+W9f xkjwmwwuLO8WLQ/ZZtLJsCija11LteHo6qyLnvLelyuoP2vORsoEtQA4U9vpzDPIcO1V 1N7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4PNhEWMnxTPqUB+Gwx2nqJhU+kkzlGq5UWgg81CPAOk=; b=VRVdUcyJlZzSDs/6nDRRJeMc2unA/BJWbZeveMZ7X/BYJN7NDilIfbta6C7jLZAVAY 8gqRePnTTE2VNQxpv7sXpVyAHrIFZEEM9EpF8PfTJqmWOFvFv1Pd9jeMBay31X4wwXyN LY3hGtDBMAmrK9jak5PRZKl+TDqsR+EgFH++/ZLYTdjhgAuVjFiEi4GnxquiTVE6iMYi KaDJ4586RSXrGDnJaL2SBESYcBFrdaU6f+s30VQ3gJncMNnv1l+Arzx/yxQ5/O4nBTLV jtZgMMoyhpLTh7DChZAyZGBzGvanN14mTLgqTAdxRB3PzfMaV5AIybn+qCw2AwqlXY/h KBKA== X-Gm-Message-State: APjAAAWgMctI/FhTJajesIqpPXmSdPe0OwNP4bPvwDc4azb19fkpjG+q d74tVBZyKEDMJOF0uetYSZg3qA== X-Google-Smtp-Source: APXvYqzyh38AtgfcuB6R0U6M0N80Ipw7rS/QgbnW4pA75DgBWBEPXi74l8ts5ld5MRP7duUrSaZIBA== X-Received: by 2002:a17:902:8492:: with SMTP id c18mr1658221plo.279.1569270884919; Mon, 23 Sep 2019 13:34:44 -0700 (PDT) Received: from xakep.corp.microsoft.com (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id n29sm12798676pgm.4.2019.09.23.13.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:34:44 -0700 (PDT) From: Pavel Tatashin <pasha.tatashin@soleen.com> To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, ebiederm@xmission.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, james.morse@arm.com, vladimir.murzin@arm.com, matthias.bgg@gmail.com, bhsharma@redhat.com, linux-mm@kvack.org, mark.rutland@arm.com Subject: [PATCH v5 03/17] arm64: hibernate: check pgd table allocation Date: Mon, 23 Sep 2019 16:34:13 -0400 Message-Id: <20190923203427.294286-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190923203427.294286-1-pasha.tatashin@soleen.com> References: <20190923203427.294286-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
arm64: MMU enabled kexec relocation
|
expand
|
diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c index d52f69462c8f..ef46ce66d7e8 100644 --- a/arch/arm64/kernel/hibernate.c +++ b/arch/arm64/kernel/hibernate.c @@ -217,6 +217,11 @@ static int create_safe_exec_page(void *src_start, size_t length, __flush_icache_range(dst, dst + length); trans_pgd = allocator(mask); + if (!trans_pgd) { + rc = -ENOMEM; + goto out; + } + pgdp = pgd_offset_raw(trans_pgd, dst_addr); if (pgd_none(READ_ONCE(*pgdp))) { pudp = allocator(mask);
There is a bug in create_safe_exec_page(), when page table is allocated it is not checked that table is allocated successfully: But it is dereferenced in: pgd_none(READ_ONCE(*pgdp)). Check that allocation was successful. Fixes: 82869ac57b5d ("arm64: kernel: Add support for hibernate/suspend-to-disk") Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com> --- arch/arm64/kernel/hibernate.c | 5 +++++ 1 file changed, 5 insertions(+)