Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp424955ybv; Fri, 7 Feb 2020 01:54:53 -0800 (PST) X-Google-Smtp-Source: APXvYqy2Lo31BlWa1eZmRTu7k3TnqgCdrvyfQcBPgadynsijQsKQFSi+b3HXEYaoC9Lk+xFoeme/ X-Received: by 2002:a9d:5e82:: with SMTP id f2mr1957124otl.240.1581069293341; Fri, 07 Feb 2020 01:54:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581069293; cv=none; d=google.com; s=arc-20160816; b=vFyrGYOJYbTYSIRDRngy3BhPsZ+uaud5d/QvPVJNzD3LGNvox7l0hCrXwSG1kUMXTA 2+e+hOK9WrG25ZYukhhMOWqv/5q3K3kSCYeeZKpoxYJHlraOJ4Ao47l2I/Nu6i5nIjdB ouwthbPVE44oTrtj9uOQkQIQcBrz4sehltZB3ZtBqP7VFqP0knCL8AX4GsvQrKR+TKa9 ez0LSzWgz8jrWn6DogmQmnCNIUFq+p501xt93DxoPCr/0qkoUlWCHZdfdaasShGv4nbq fl3D1E0GTst40isXZoQOB+03JPluz51VkEeuj17XG/GMBVmCBY0t6B2QuQvPFJpSXKBH vhsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zMYeHp7izR4Rb+xnGWV9UyZpsqdqC4NZ7xAtUKg6nOo=; b=P0UK8JaDCyLYtw7iq/30PWtFwZ65dpL9ULB5GQTMQowTDklkOvjfwCyR1NSvOoHhLh aGP0mhXBVOpaa2WWlG/5aaMh48hn66li93abu72QKI5PpVoWeBWLRAr+BKDNcb5j7k52 rOBPFrTBY0k9E/s2Es9Bo0d3vDzD8PHyRO++5JAYlrtofQPqob4CmHKQclmUoESwNg87 5Rhg12aURY0wBOck4Htu9mBDjxHxieO+Go855UTzxD/I1NH7dkW9hWzw1Gn1tYom5rGz 93EGbW2fqMuAYsNyctyrGaIPw7eRkBsEvA0c0OEJtOa9RwSOiZtokkF8Nr/MPF/n+EOl UkPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=dZsSCFPZ; 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 h125si3616580oia.253.2020.02.07.01.54.41; Fri, 07 Feb 2020 01:54:53 -0800 (PST) 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; dkim=pass header.i=@sifive.com header.s=google header.b=dZsSCFPZ; 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 S1726988AbgBGJwv (ORCPT + 99 others); Fri, 7 Feb 2020 04:52:51 -0500 Received: from mail-pf1-f173.google.com ([209.85.210.173]:33172 "EHLO mail-pf1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726728AbgBGJwv (ORCPT ); Fri, 7 Feb 2020 04:52:51 -0500 Received: by mail-pf1-f173.google.com with SMTP id n7so1027704pfn.0 for ; Fri, 07 Feb 2020 01:52:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zMYeHp7izR4Rb+xnGWV9UyZpsqdqC4NZ7xAtUKg6nOo=; b=dZsSCFPZ6VJiIDvAbOx4Ve2EgnwGRXr46b6Y1/xwbiLJvTF5vygoQCqnkbsBrcvGov Bcwx38z3A+tY5HBT2Q9jU7pbvCmkXxe7FXJsOTwgQP872c46YUBTPbDRfTmZMSJRwSLO oloeKyRxz4FyfqxIdncKLha8rEWZ/7efv5WBzL3cpwh1Q0CQl/VuuHXmvKrmx2x/eLEr ULHlbbpsliyF78QTJk1aDfMB1fPejrsuN0rf0dt5KINdsJ4h6VltGbm9cxEy1SDnWtUo Pf54CclxtPYULjx5Vdh4T90InxpgK5Xa5KGfQL3MZeGni5+0VG/+7QUF/SfzDWJPSeuQ 1kfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zMYeHp7izR4Rb+xnGWV9UyZpsqdqC4NZ7xAtUKg6nOo=; b=FYTSC3eGvacjdiLC7FN2A8UtTda0Hs7elGx/lodItQQOL1c8Iu/CKlUXlMXQEjFmmi c+xTz75bsBOkefsgtiL7Dk2D7oiIY3kRn/ih02Nex7jPa/bu3HhWmy+fEjAyxC7Si1Z8 lB3Y+YcvPdp+wNIGEJWULm/bslLONp4ediitCiJpDfEjvzVlHUXArLrLeTsmuR0VOp/7 5B6je8M2fr08e65Ru7gfEyMSx+rawuhZc2GDr5/MIQy8ecsHDn02VE6BJ49EeegSIhu4 Adcuvb/imc7YSvkAjsE5lA4TpqzKI4MXZAaZhHSetvtuBPfEZY8ug2jBeEw0iaqb9qk4 yooQ== X-Gm-Message-State: APjAAAUJ05Y2KQaQCCVK/J2HkbmvuNTlIuuGFpY4scG76s00p4l0j3Ps uOkcFRq/+hqDsjbd2gyiDf4HOw== X-Received: by 2002:aa7:820d:: with SMTP id k13mr9337393pfi.10.1581069170055; Fri, 07 Feb 2020 01:52:50 -0800 (PST) Received: from hsinchu02.internal.sifive.com (220-132-236-182.HINET-IP.hinet.net. [220.132.236.182]) by smtp.gmail.com with ESMTPSA id s23sm2060934pjq.17.2020.02.07.01.52.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 01:52:49 -0800 (PST) From: Zong Li To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zong Li Subject: [PATCH 0/2] Fix the page table size of KASAN use. Date: Fri, 7 Feb 2020 17:52:43 +0800 Message-Id: <20200207095245.21955-1-zong.li@sifive.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Each page table should be created by allocating a complete page size for it. Otherwise, the content of the page table would be corrupted somewhere through memory allocation which allocates the memory at the middle of the page table for other use. For example, if it only allocates 200 pmd entries memory size for pmd page table, then the original 201 entry will be used to other purpose, and cause the unexpected fault when accessing the page table. Zong Li (2): riscv: allocate a complete page size for each page table riscv: adjust the indent arch/riscv/mm/kasan_init.c | 53 ++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 22 deletions(-) -- 2.25.0