Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1831952imm; Thu, 23 Aug 2018 09:27:14 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy8BkKrUnRJdrekHm/1b0H/YK0C2NAKs1qFKavcZc1FFARLsTQa/fqVzTYCwm/0dWupY0og X-Received: by 2002:a65:560a:: with SMTP id l10-v6mr57008418pgs.130.1535041634874; Thu, 23 Aug 2018 09:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535041634; cv=none; d=google.com; s=arc-20160816; b=s1++qhSKCixHYwml2a6T2hOl80JL4v2yoTjabsHvypppQPHvSxXoldpxqkA25/BoGR +qVrZTKx0owfRenRSP7jpcoANT2JfDFz1G1a371B7+89xRp34mw0zBTj6xcYecuVDo4U 5xqol9sBbSFn9iRoJm+DCSzoAySx8CJIffE3ChYceaWRBobE5l+A7KssgcAKkRiEoJd/ 4y+6MbZW53yzQ1UX9e7u/yI2AOWXSupuOwyJLj0BRpia9i8XBoZHiSA1rsOsfExp98/t kM3puBcFe8YkdQ5BVQKoIabeD39U1c1LO8DS1kwr1yzOb0qnHA0KkTGM9curCM/i8CPE xECg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to:arc-authentication-results; bh=MnJ+OdPyoOloc/ViH5eYonJtlQfMFz5g8L5dXik1afw=; b=KDkMZe+9mfvukcAo5cOX80SCFWIuJLRUc9AartalPtcTOfydizg8/bJD0k/bsDVBiD 0G0VcT6Y+20f2SxXXmCZMJBqgHQr5UfZbvh4iWN8Q6oI+R/kzOs4TrwMMj4/Z5Vww5jN EnFw9pIU6muAmq0xjK68eON63r4SGEsFNLfjguO/oORqhcRRuPgm5Wt1zRrSfEhmtyHW VMYtUTByduwHA+88QA94kX9i84ZI22aE/4ynVG7Sk6C3N/NQtag2HBlsCiqV0uwYos// 80JRLMHOfoJ+58CK8lXFgAWo8d2A3yqLyAEvGCC3BXPS7Z1KqXuqteE5HM2TdiQbqTw0 NO1g== 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 m7-v6si4410327plt.7.2018.08.23.09.26.59; Thu, 23 Aug 2018 09:27:14 -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 S1732009AbeHWRsg (ORCPT + 99 others); Thu, 23 Aug 2018 13:48:36 -0400 Received: from ozlabs.org ([203.11.71.1]:44025 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731404AbeHWRsg (ORCPT ); Thu, 23 Aug 2018 13:48:36 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 41x63533G3z9s5b; Fri, 24 Aug 2018 00:18:40 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 810e9f86f36f59f1d6f6710220c49afe0c705f38 In-Reply-To: <8097a1d32403ea47d076803e9070869badfe24bc.1534856426.git.christophe.leroy@c-s.fr> To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , aneesh.kumar@linux.vnet.ibm.com From: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: powerpc/nohash: fix pte_access_permitted() Message-Id: <41x63533G3z9s5b@ozlabs.org> Date: Fri, 24 Aug 2018 00:18:40 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-08-21 at 13:03:23 UTC, Christophe Leroy wrote: > Commit 5769beaf180a8 ("powerpc/mm: Add proper pte access check helper > for other platforms") replaced generic pte_access_permitted() by an > arch specific one. > > The generic one is defined as > (pte_present(pte) && (!(write) || pte_write(pte))) > > The arch specific one is open coded checking that _PAGE_USER and > _PAGE_WRITE (_PAGE_RW) flags are set, but lacking to check that > _PAGE_RO and _PAGE_PRIVILEGED are unset, leading to a useless test > on targets like the 8xx which defines _PAGE_RW and _PAGE_USER as 0. > > Commit 5fa5b16be5b31 ("powerpc/mm/hugetlb: Use pte_access_permitted > for hugetlb access check") replaced some tests performed with > pte helpers by a call to pte_access_permitted(), leading to the same > issue. > > This patch rewrites powerpc/nohash pte_access_permitted() > using pte helpers. > > Fixes: 5769beaf180a8 ("powerpc/mm: Add proper pte access check helper for other platforms") > Fixes: 5fa5b16be5b31 ("powerpc/mm/hugetlb: Use pte_access_permitted for hugetlb access check") > Cc: stable@vger.kernel.org # v4.15+ > Signed-off-by: Christophe Leroy > Reviewed-by: Aneesh Kumar K.V Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/810e9f86f36f59f1d6f6710220c49a cheers