Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3369480ybv; Sun, 9 Feb 2020 21:57:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwwXtV4irpgTeHBRAedm6+AlyiFYUnK0NNa5AB4EdcIYNqVFWrlOLBNou4IiOvHlGCut/AB X-Received: by 2002:a05:6808:2d9:: with SMTP id a25mr9935599oid.172.1581314244196; Sun, 09 Feb 2020 21:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581314244; cv=none; d=google.com; s=arc-20160816; b=dLjiFpw0WSUFtX+VwYnd3mNLzddlo88c7o0XLkjPtRrJQm5LPvivk+2vmPf3svUlMH DHoRyFCsUQUGSt0LwPy19eS985Yux+8Kwf0FpMzgeo5KZJuoA1xbrh9kOvuL3Zy2DXhG bumQB8d4pIF75+40txcZlwMPPJD03PbY9oOeACYge2gPyNezdjjb8+xXy53/PKPsNwQx fH1XKzjfupTeyIZP922l1pULnqFQQSsZgxKQ8qav+DHUMK9tq7X1xqyWFvLtSArw5XTw HxxPsVxyLJBYFQI2Ob5xIJgna2NxELFbBWWxD1797FLFKwVX6Lj/vq7FDBzSBfhdeEj3 iCHQ== 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=E/VM1VIJNzEuuZ+My2G7oPqQnJ6XIahBlQ6fOgNUJgk=; b=TQYsF59Nezb05Onmgfj+g5rSEzM36y3E81oDs3kqAqzzZyFoVyGIuCqXFAfYq5V+P9 6DDLBsLICfcBqHXtXKwYTujQx8C+2sw/hP1tGsxe3RvsxDR2XVAOkO9mwz/Q6XqMTD0o 9Q30EBIwErKMm4OADMVY2SwhAhCfBhriI1RSaNTNAummNtYd88H8ddt9gJNkb2CQLyzM WGJyziTOHbMqCpNPGDttQc8Q0owxn+maOE2C1Wc2Vm5tFQuUtbv0JrLRSDP/YtV5ZrkC kv1DmAhiLFXvKr6iXcJnUk5zrl3zy54vbOsQuvzHaEY8jb60/V7wT+CqWKUeN3u/ZdT+ 3x8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=f4x8c13M; 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 r82si8030711oie.116.2020.02.09.21.57.10; Sun, 09 Feb 2020 21:57:24 -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=f4x8c13M; 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 S1727029AbgBJF5C (ORCPT + 99 others); Mon, 10 Feb 2020 00:57:02 -0500 Received: from mail-pg1-f174.google.com ([209.85.215.174]:36532 "EHLO mail-pg1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgBJF5C (ORCPT ); Mon, 10 Feb 2020 00:57:02 -0500 Received: by mail-pg1-f174.google.com with SMTP id d9so3315141pgu.3 for ; Sun, 09 Feb 2020 21:57:02 -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=E/VM1VIJNzEuuZ+My2G7oPqQnJ6XIahBlQ6fOgNUJgk=; b=f4x8c13MAeeRWRE4cESjejgYpW8BMy89yubG0jl3pkGqZ1l3BpMaqE2eN0COkIjZXQ L2odcUesg5+HQEcK78+wSYQmtp8z8Gy4oXXGH6ZhnK21aX38Mvmu8hXCenb8tcz0xIBb EUcNz5ka3UfRLEwSpCXWCHcdZ8xpQRRRqzHwt4eUaUgq45T0ER6LNXqwaH/CSvlxohVe ija1t9Ak+H6jDWHFHZMDKzS9OJBaAtL5StlXtAod9aBIB51y9XxMhoI5D58KD/wIVV0o Jggs4xxJCmlQI+qMRdM5IpDaqk0NIjpW2HqHBpjPAzL20Dnp5nHt41LCCeJPnmJcCcH+ J7Yw== 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=E/VM1VIJNzEuuZ+My2G7oPqQnJ6XIahBlQ6fOgNUJgk=; b=qsJaJuzpjAKej3pgRcE1pVF0lEcY9EdGTQSAJ2YY1/vDPDGu4ptKU6+PV/SHIL2jiF QQwNRaMjaxXyJ7w0ELk6OZhXd0fW/uRIy9QeWMnJy1NayG5F19l4djuQwOw4jCBei3Pq a8tnHI5veSSBFgYZ2COKZr/4099UAdi1JhUPNmfL7+/WZW6TWYa8sKt5njpUhjFrqP4N zvbKuM+FP1WiLoA7SznlK1WANGpDsqWRLvLIMMOYRs7tzrrLSz/O/84LG0xzaCgKLtxN Z7WkmxGEJa7ez5OimS3qz3HGVDHoGpIzvk25ldwCCebSnDsOVR3oiIjxADnnDdczCvzo fD+w== X-Gm-Message-State: APjAAAX73ue45XV1dYwooLWynO7lR2zavFYGDZyMUhAuCedNJnlvrqsg czs60LzLBgLqCNO664CIjGXANg== X-Received: by 2002:a63:d705:: with SMTP id d5mr12507113pgg.24.1581314221556; Sun, 09 Feb 2020 21:57:01 -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 s206sm11140234pfs.100.2020.02.09.21.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Feb 2020 21:57:01 -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, joe@perches.com, nickhu@andestech.com Cc: Zong Li Subject: [PATCH v2 0/2] Fix the page table size of KASAN use. Date: Mon, 10 Feb 2020 13:56:52 +0800 Message-Id: <20200210055654.96725-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 | 52 ++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 22 deletions(-) -- 2.25.0