From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03DD1C433DB for ; Thu, 21 Jan 2021 17:45:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C886207C5 for ; Thu, 21 Jan 2021 17:45:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C886207C5 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BVrthGovIjfTa2LTF4Vb+I4LWqLBI1aia1OEoAjNHpc=; b=RQLh3GmiVEZpLZI/deH2smaWi HeaO6XE4vao+Lt22X8fPmsotegngQoBtS1O4sKo1aMYUYXoj3oZ2Lj7JauMUWoQipDsHsRp8ymKZV 0kxK/6FLtrkuqr+kG6cWawIrJdRfPXq7P13Xkh3s7u/+ECZjgfVRnLVxSYwCeFyw9bBeSZbSI3eSY xE0pR8+jB82+PnBzjuOuouxjlGM3JiAnJ2tAjOjaPzoIarh4opESyg/+2YwiPB2eHgJK+Zrfi06z6 Wk86F1VTtMRJkDp83RcC02UtQLgk1Jsycn9Po0zVRsnHZATkWxh7Lw0X5p2eO7BJ9ILtZgSA/5KAg vTzT4t88A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2e0V-0005ER-4d; Thu, 21 Jan 2021 17:44:31 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2e0Q-0005Cn-VI for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 17:44:27 +0000 Received: by mail-lf1-x12a.google.com with SMTP id u25so3724586lfc.2 for ; Thu, 21 Jan 2021 09:44:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PGFFrNGI7jcGt2Ckr0yJXz+AGAE1X7qRw3reHpjfkCo=; b=J12Eeog0Fmap+TFn4o/BsRtL7RlGoYr9aj69/43ryqDeIrWZz8O6eH3sz5fK53lCfO qnr/dqzpguIc3RrhDca00qs4rrR0tqou94HFCsKOtEhd6HDtMGGi54t6i46TsgWVebuX jKtbmWIYK6O0f/MtgRBg3y4uGtbSbHc2ls/2t51tJbSZYZRBJXCaPqDZnq6snLtBxBEi hMB6HkZ19FL5DDJDI2OYkePCcK2PizBGXnk+KQuX26g1Qc6qJyN4wPWHML2sUt4qKUHq HxWsl17O7gfL/vzw25lb5ywfX54GGxZK23gwpTeixXxKkOCl/TYKKeCU11uxcI60XHEC /vqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PGFFrNGI7jcGt2Ckr0yJXz+AGAE1X7qRw3reHpjfkCo=; b=MnF9Z3mTR5s02u4EeOxWP5T5K04JsEUewVmHQfJOUkZNBZd09jRi0a84Ow+DeJAiCe Hl5lixnLDFdR0k7eVB2Z/xMty4uEP/gop21dcIvWo35TF3UMcA6GpemVlcmdpobOxSEj efDD26L6okT6m3Kvd2FHY9r9H9Nc5VjFX6cOpX+I2p8uIvJWn4vZnGGz89n4WYrFZP6j hbkHlMOkxg2GGWx5mjOFE5LXHwaRwG/oihgcb6tz+pM1Oazcrs7gCrJ2B9avIU1GD+pM bd6HPezPZezI8LaO+RYLys7MJNYyu4s8SiPizUP25ipPINbIIB57lGFbFU+N5lJZAJg/ PGJg== X-Gm-Message-State: AOAM532cjZorrh9bHa6LKFfcaaA0d+LCu0g2EG6oi77W+DBiPciBeJY7 vw809Ds+pBNDyPQnG9aYMw1+70awiaN73bDPPkYQhQ== X-Google-Smtp-Source: ABdhPJz1rdXjr4kjJRfAIPtA5v/PBKyGfr+IQ8wFx1vJw2FImN+X5pXM0D8QGr3CCQmd07fO+vj8gob8yfyQ4f+xWfg= X-Received: by 2002:a19:434e:: with SMTP id m14mr162866lfj.73.1611251065593; Thu, 21 Jan 2021 09:44:25 -0800 (PST) MIME-Version: 1.0 References: <20210109103252.812517-1-lecopzer@gmail.com> In-Reply-To: <20210109103252.812517-1-lecopzer@gmail.com> From: Andrey Konovalov Date: Thu, 21 Jan 2021 18:44:14 +0100 Message-ID: Subject: Re: [PATCH v2 0/4] arm64: kasan: support CONFIG_KASAN_VMALLOC To: Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_124427_020192_A24473B0 X-CRM114-Status: GOOD ( 16.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lecopzer Chen , Catalin Marinas , LKML , Linux Memory Management List , tyhicks@linux.microsoft.com, Alexander Potapenko , Vincenzo Frascino , Ard Biesheuvel , yj.chiang@mediatek.com, kasan-dev , Linux ARM , Andrey Ryabinin , Guenter Roeck , Lecopzer Chen , Mark Brown , "moderated list:ARM/Mediatek SoC..." , Dan Williams , Dmitry Vyukov , gustavoars@kernel.org, Andrew Morton , Robin Murphy , rppt@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Jan 9, 2021 at 11:33 AM Lecopzer Chen wrote: > > Linux supports KAsan for VMALLOC since commit 3c5c3cfb9ef4da9 > ("kasan: support backing vmalloc space with real shadow memory") > > Acroding to how x86 ported it [1], they early allocated p4d and pgd, > but in arm64 I just simulate how KAsan supports MODULES_VADDR in arm64 > by not to populate the vmalloc area except for kimg address. > > Test environment: > 4G and 8G Qemu virt, > 39-bit VA + 4k PAGE_SIZE with 3-level page table, > test by lib/test_kasan.ko and lib/test_kasan_module.ko > > It also works in Kaslr with CONFIG_RANDOMIZE_MODULE_REGION_FULL > and randomize module region inside vmalloc area. > > > [1]: commit 0609ae011deb41c ("x86/kasan: support KASAN_VMALLOC") > > Signed-off-by: Lecopzer Chen > Acked-by: Andrey Konovalov > Tested-by: Andrey Konovalov > > > v2 -> v1 > 1. kasan_init.c tweak indent > 2. change Kconfig depends only on HAVE_ARCH_KASAN > 3. support randomized module region. > > v1: > https://lore.kernel.org/lkml/20210103171137.153834-1-lecopzer@gmail.com/ > > Lecopzer Chen (4): > arm64: kasan: don't populate vmalloc area for CONFIG_KASAN_VMALLOC > arm64: kasan: abstract _text and _end to KERNEL_START/END > arm64: Kconfig: support CONFIG_KASAN_VMALLOC > arm64: kaslr: support randomized module area with KASAN_VMALLOC > > arch/arm64/Kconfig | 1 + > arch/arm64/kernel/kaslr.c | 18 ++++++++++-------- > arch/arm64/kernel/module.c | 16 +++++++++------- > arch/arm64/mm/kasan_init.c | 29 +++++++++++++++++++++-------- > 4 files changed, 41 insertions(+), 23 deletions(-) > > -- > 2.25.1 > Hi Will, Could you PTAL at the arm64 changes? Thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel