Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4308701ybl; Tue, 20 Aug 2019 09:57:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4euWKFM88QSNuAB5iCjE8zdQ5B535isGJdUwyzbuPnVJagptUJwNP7DukIvggOiw3nryG X-Received: by 2002:aa7:9a86:: with SMTP id w6mr30710341pfi.60.1566320273804; Tue, 20 Aug 2019 09:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566320273; cv=none; d=google.com; s=arc-20160816; b=Cvsyn1U342+NS3DKTCycIBMD5FmIVsUW2TbJGNI0IavhqVrv79i1fhRC4g6WZL5UDi FnJn2eY4pBAooJ0IqeeTB74knakLD3E7rSvJRlImRGE3MUavGbzwbRIBdXLOnmiMUxwf piK3iUVLdw+TJGIDBS+UMdslwDjqJLYEmIQHnZ+l3NrKlM5SYeM9vF1AMbVaX6ibHSoR RZiWV+eBdZUpAiUwXV+mDdmtuEq0w2wJzHmoXPAiWhaT4lYBHb2Jzl6wgQf/ZgKyBB09 uCHtzGxwHQPoHsMP64XVrNSMG67W1bBzqBKySqbqnEaGGWNU1PBS8SCN+tzbsmF4O4Z7 apBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=mz4Ol/OHSP8vQw3OEffF4pt7mINI3dFV7qUPFMdWwmg=; b=WC3waehbl1UjUxLaPn83/cbuaOH+wbQ8YxStLkeOKsrnCzzPqtqquhEdEWfQCPDMXL rSLNWpCIkGFA8aEA4Iu9yWlar2oXJ2YaaT3eTJmW8wXrJkSTiuxwAYc3XgQ81O+w//9K YsVqopyXRA8WxgMIko6zoqFhFDQeK9lWhWaJcKeMGTGG6x4QOZvBwWgRBmtEFAbQTvHg 8EnEe6BfoV0frUERZbpFEredi/mL7R4ZgcVVUqoP38sJ9Se07CGcL47UZxPs2O2FzaeP QYo4wVzqQpmcQQ435x48a5enXJlsRGlTQtJLFp3yFfQbcBrxm9p5VnH2kfbwFgVsWbTW 9ufA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z35si12722272pga.42.2019.08.20.09.57.37; Tue, 20 Aug 2019 09:57:53 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729251AbfHTQ4a (ORCPT + 99 others); Tue, 20 Aug 2019 12:56:30 -0400 Received: from shelob.surriel.com ([96.67.55.147]:58172 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbfHTQ4a (ORCPT ); Tue, 20 Aug 2019 12:56:30 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1i07Qi-0004hb-Uw; Tue, 20 Aug 2019 12:56:21 -0400 Message-ID: <5a765e1bda8ec399a29dbdb195d15faa79c44273.camel@surriel.com> Subject: Re: [PATCH v2] x86/mm/pti: in pti_clone_pgtable() don't increase addr by PUD_SIZE From: Rik van Riel To: Song Liu Cc: Thomas Gleixner , Peter Zijlstra , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Kernel Team , "stable@vger.kernel.org" , Joerg Roedel , Dave Hansen , Andy Lutomirski Date: Tue, 20 Aug 2019 12:56:20 -0400 In-Reply-To: <9A7CA4D3-76FB-479B-AC7A-FC3FD03B24DF@fb.com> References: <20190820075128.2912224-1-songliubraving@fb.com> <20190820100055.GI2332@hirez.programming.kicks-ass.net> <44EA504D-2388-49EF-A807-B9712903B146@fb.com> <9A7CA4D3-76FB-479B-AC7A-FC3FD03B24DF@fb.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-pEXkl0lR3wnHbNuZx5FO" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-pEXkl0lR3wnHbNuZx5FO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2019-08-20 at 10:00 -0400, Song Liu wrote: >=20 > From 9ae74cff4faf4710a11cb8da4c4a3f3404bd9fdd Mon Sep 17 00:00:00 > 2001 > From: Song Liu > Date: Mon, 19 Aug 2019 23:59:47 -0700 > Subject: [PATCH] x86/mm/pti: in pti_clone_pgtable(), increase addr > properly >=20 > Before 32-bit support, pti_clone_pmds() always adds PMD_SIZE to addr. > This behavior changes after the 32-bit support: pti_clone_pgtable() > increases addr by PUD_SIZE for pud_none(*pud) case, and increases > addr by > PMD_SIZE for pmd_none(*pmd) case. However, this is not accurate > because > addr may not be PUD_SIZE/PMD_SIZE aligned. >=20 > Fix this issue by properly rounding up addr to next PUD_SIZE/PMD_SIZE > in these two cases. >=20 > Cc: stable@vger.kernel.org # v4.19+ > Fixes: 16a3fe634f6a ("x86/mm/pti: Clone kernel-image on PTE level for > 32 bit") > Signed-off-by: Song Liu > Cc: Joerg Roedel > Cc: Thomas Gleixner > Cc: Dave Hansen > Cc: Andy Lutomirski > Cc: Peter Zijlstra This looks like it should do the trick! Reviewed-by: Rik van Riel --=20 All Rights Reversed. --=-pEXkl0lR3wnHbNuZx5FO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl1cJjQACgkQznnekoTE 3oP2CQf5AbKPnlETNpt54qUIOxEF1nXrAYDVtGeSK8Kss4VQHeyuezQYzNd2Yb64 ESHIJFxoeBzfElljfEsvT3BvYYcFtlyS87iND3pr9WWnQ5nFM/kASzp0fGmBzoTB diU5pD5yg8fBWbXMAwSzDA57CCogWInsgI6UVjli37Y20F+LDS/duzlslae/sxWB +hvpy43ewEgbQj/3hRrO7S56ssea8wMkwQrVVRpXzT6bbVGMmt8vRfluDn/hG8Cu Prrk9i+Y2OuCpBiZ//0WAHLhyG74wh6i4iLzt3bqO9vWlB3LkD+C8MCnZBC22Ovw 9umcCc9SszqbVBoDM4zCCAmQ9Ru0ig== =Wneu -----END PGP SIGNATURE----- --=-pEXkl0lR3wnHbNuZx5FO--