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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no 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 D2729C38A2A for ; Thu, 7 May 2020 12:47:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A28E4207DD for ; Thu, 7 May 2020 12:47:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="h66Ghp0b"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZxTpW8Lw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A28E4207DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jdQsSSeZaZfU/TBLpKxw98NaQK5ajo5DYxcXKSZtv4A=; b=h66Ghp0bNfsJt+ i84BmIL+bNCALg+6czKsB6lh9Z3mFmo7EE9asY8RBpiv74prhHU3uqD+WOH0Qu2rtfQGa4vL67RJ4 2e7CQBq0kJiVIz7zFHVL2VGC/XpzyPuIZ7nn5SYQowR6MSPztbuNdH9MqgUa1PNNKlpkEeqn9zooY I+JMn6k9glThq34J0cXJ7p2T4HcSRuOUxhqzAiDRePb4xv6C4wfI6DIy2buNXWColostnZgKpdsQi cqY62Cf0z470FGYlQM692xzyvFD9SpUlT+/aZ/A7EFW6ttPblsBkM9OH4VEFIFx+WTaMQQvaUVtfl mu9zoM+XlHGQzpottoFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWfwA-0003dl-CH; Thu, 07 May 2020 12:47:38 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWfw5-0003dR-DD for linux-arm-kernel@lists.infradead.org; Thu, 07 May 2020 12:47:37 +0000 Received: by mail-lj1-x243.google.com with SMTP id f11so6189518ljp.1 for ; Thu, 07 May 2020 05:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lqPn5Uqqqbv3GywvQ9PqZtaNDbBkbD1A2nXmHrANXi8=; b=ZxTpW8LwdrsEW7TF6acI3Ig+nEdiigxMzVp2ZbnbBCiV06L8XTkb+3g4rhLr3O2DkT hHo112ZStFCw85SFGnRTL1X1kHVA/i15f0lkJ0lwZtFl720f/+ox0sdrIiE8kEu7dx+k cztrNruQcdaNrdwJ0VG1iZ0e4fvAwU1g5RWGlucgY8+TkOucFzqvB1qWzyM0dWXc9cYC jCfY3xHdVfZlqBGQKsOQdlBe3V2FkV31ENVLI5y2cfu3QlWeoCo0Q2/ERV8vz49ABQ8B +C9mwBX030zfaj+lA4kw94je20NhIZpjgJxUc1WR8X2AIk9wr7gul+VOzF1sMPCdsh3g bKAQ== 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=lqPn5Uqqqbv3GywvQ9PqZtaNDbBkbD1A2nXmHrANXi8=; b=fwy3vUmBGN4NEVjVKHAlKWf6WXTUtBUTJhGguqW4Bcpp3IPGCUK6V583MxUHLmOAl7 s18hISRNRuBtegBmCUK8ej2G0i2sNQjeoyJNVxrM6BErP0N2Mm9LQroD+UEV5c1uDC93 /HAIJXQHi4kytsU50QF9pIIOegkVFB6SZRwfW815xiekVYiy8GEtY0yngjqPWZvxx+U7 8GSWrgXN4cuzLDJ8Vr77qPqCxnEuX4U45zSACBHQBpsoRA5Ek4GICFTqpkVzznyIyi9I 4thCxSEyI3VPc6y1Vb5RQobKlMgcJcPiIr97ttkVHWZizEgdbqQzRPE8lu8jCkpgvLwh nxgg== X-Gm-Message-State: AGi0PubInhYRH4FIAwEqkXPfr7gCxqvDAes4B8t4ZyjudVndcIIOm37P w+bFSkYxlDlzqQJlgGwKnfzWGQ== X-Google-Smtp-Source: APiQypIYKBBEjJU53fX1304WuId3o7/LIdiADRwwmw8RZNSGlVTg65i75szsKysSLUD5Nlu6tWGtAw== X-Received: by 2002:a2e:89cb:: with SMTP id c11mr8521537ljk.121.1588855648916; Thu, 07 May 2020 05:47:28 -0700 (PDT) Received: from localhost.localdomain (c-f3d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.243]) by smtp.gmail.com with ESMTPSA id b4sm3730126lfo.33.2020.05.07.05.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 05:47:28 -0700 (PDT) From: Linus Walleij To: Florian Fainelli , Abbott Liu , Russell King , Ard Biesheuvel , Andrey Ryabinin Subject: [PATCH 0/5 v8] KASan for Arm Date: Thu, 7 May 2020 14:45:17 +0200 Message-Id: <20200507124522.171323-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200507_054735_939252_FE329498 X-CRM114-Status: GOOD ( 16.71 ) 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: Linus Walleij , Arnd Bergmann , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org It's time to repost this, now that I got it into better shape. Main changes: - Restore the series number to v8 following my previous "v1" which was actually v7, following Florians versions. What was I thinking. :( - Doesn't crash randomly in QEMU etc. This was because mmu.c was instrumented, and when we were lucky this did not poke around in memory that crashed us. - Handle the undefined symbols better (like suggested by Ard) - Fix up documentation. - Better patch split in logical chunks. Remaining issues: - Does it work for you? - Crash on ARMv5/v5 in v4wbi_flush_user_tlb_range+0x10/0x4c. I wonder why. If you know, please tell me, I naturally have to fix this. - The code in kasan_init.c to first back up TTBR0 and then restore it looks *fragile* even if it is working. I think we need to do something better in a per-proc file such as is done in cpu_v7_switch_mm() and other well organized MMU manipulation, I certainly feel this should be done like that. Abbott Liu (1): ARM: Define the virtual space of KASan's shadow region Andrey Ryabinin (4): ARM: Disable KASan instrumentation for some code ARM: Replace string mem* functions for KASan ARM: Initialize the mapping of KASan shadow memory ARM: Enable KASan for ARM Documentation/arm/memory.rst | 5 + Documentation/dev-tools/kasan.rst | 4 +- arch/arm/Kconfig | 10 + arch/arm/boot/compressed/Makefile | 1 + arch/arm/boot/compressed/string.c | 19 ++ arch/arm/include/asm/kasan.h | 32 +++ arch/arm/include/asm/kasan_def.h | 81 ++++++++ arch/arm/include/asm/memory.h | 5 + arch/arm/include/asm/pgalloc.h | 9 +- arch/arm/include/asm/string.h | 21 ++ arch/arm/include/asm/thread_info.h | 4 + arch/arm/kernel/entry-armv.S | 5 +- arch/arm/kernel/entry-common.S | 9 +- arch/arm/kernel/head-common.S | 7 +- arch/arm/kernel/setup.c | 2 + arch/arm/kernel/unwind.c | 6 +- arch/arm/lib/memcpy.S | 3 + arch/arm/lib/memmove.S | 5 +- arch/arm/lib/memset.S | 3 + arch/arm/mm/Makefile | 5 + arch/arm/mm/kasan_init.c | 324 +++++++++++++++++++++++++++++ arch/arm/mm/mmu.c | 18 ++ arch/arm/mm/pgd.c | 15 +- arch/arm/vdso/Makefile | 2 + 24 files changed, 581 insertions(+), 14 deletions(-) create mode 100644 arch/arm/include/asm/kasan.h create mode 100644 arch/arm/include/asm/kasan_def.h create mode 100644 arch/arm/mm/kasan_init.c -- 2.25.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel