Message ID | 20241015-arm-kasan-vmalloc-crash-v1-0-dbb23592ca83@linaro.org (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A16F7D20683 for <linux-arm-kernel@archiver.kernel.org>; Tue, 15 Oct 2024 22:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: 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=o1N4AEo67AJDxg5isYDTUU408W1MiStgBZrCEl+upAQ=; b=Ik2rpShkWSZEwP NNpwETrIGJkTFE6lO2S6rQ4y6zzo2t6K5hgWKXaJO48W/OzWsGTJqi3gO+DDdRIOESSyB0K0szafb BwDxrT693DbRw/7r8CGj3fy7oznmjIT2GbmcCFqji4FusG7Aav2CsBbscrM0noowjBviA2SiIndgx UL9F1ONdgMA0AZVkJ6PoR3JjUEK13z7Vk+u1wksmeeP7ue9+Y+CHlyWPfYyEEg7P8HkANjKMVy5d+ /wg94IDL0JQu3cXk6snIoXJs6ux+XSPEA60VqXWMtGAx6iiSc9n3LlM7pmWyGPi4s0keTlrucP0Um 9nUAk9GmQtikWgFq7B/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0qIL-00000009pvG-1lsE; Tue, 15 Oct 2024 22:45:37 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0pET-00000009g9W-0vnl for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2024 21:37:36 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-539eb97f26aso3561265e87.2 for <linux-arm-kernel@lists.infradead.org>; Tue, 15 Oct 2024 14:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729028251; x=1729633051; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=o1N4AEo67AJDxg5isYDTUU408W1MiStgBZrCEl+upAQ=; b=QEiLFTidtKE6PSJgJcATBFZgUC39kzTPLzU7tNJlb17vUANjHSa2i+S1MZQQCD0aH2 mjrPkDzbDLF80FntcQUORZenn9zZVcvqcT57qjiw1Nm6YNznc4yDt22xlN3Dpbv2rUz4 TXMu5GymWj6ST9C6EDV2EOqdoh8SzNsOFTo/ObCMkejS9TmTHEgTmWEwN9Q6n54fFD8V 1AI82SEuj0sViJfQSLanH+1wtg6dCRLhnzpAbbhKyDoxEd6cl0XeD1n0rgHHjtF8MbMR WVJTTPLaSKvT5Epa1/xMvIp3agxGY7PCi3jAaVqbLQ0gytHg2BJIMouPlR9S4+ld8O5Q Oljg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729028251; x=1729633051; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o1N4AEo67AJDxg5isYDTUU408W1MiStgBZrCEl+upAQ=; b=UAwvChUVKlZZFOLj4y8dG+yHrzsjbe92Mv3kla6PGQWrzsWIxPNQdMBi6WQeKA6lfY gy/5XGKw/X/5LWnUJdYF+fLvmChIof7vv0UakbcnhVfyED6EsG/OTwUAuIj9xQa0Jc6u wC/yA1eNGN2OLvNeVQ0G6SLVA4FbxEt8l0PBdsKg0VQEgWl3l7fgKrpXWhwryNYme9Ce d26nlZr7xtF/VqgYVP73SPd634cDnpoi2mOFUOkVHFYcVnVRIiiWW6dh7ONiNSDEi5se okK0bDFVUt6sCns2BGesMowYJjgN2OXrHh6HhC/iEmflOYrlfyTWAi5fCYSc0fvhJUS9 RM6w== X-Forwarded-Encrypted: i=1; AJvYcCUWHnMOtF7ZXkk0ztfVoObi490AG/zRPCSlQwkcBg0IoVufMMr4Q3uhJs9wv+muObbkooQCwKWLM7ZcW0o9kqiN@lists.infradead.org X-Gm-Message-State: AOJu0YzkNl8zMf4SbQZGb5m2oNiYp8RClgpoNtevpqpbezvOEnTeW8X1 Bf5xoX6/ZMZqghJA9rwRe6Y+yx6zx50FzhzNEpG3wrpPto9NVOSQTiSDQvZOuYg= X-Google-Smtp-Source: AGHT+IHrmYVh2s1M1vR8j11JDmsNmTewokj7TjNFd15E6BqGO2sG9UYvH4yAw5v0dpTqUPBHFsORUQ== X-Received: by 2002:a05:6512:3d23:b0:539:d428:fbf2 with SMTP id 2adb3069b0e04-539da3c58f6mr8166447e87.13.1729028250720; Tue, 15 Oct 2024 14:37:30 -0700 (PDT) Received: from lino.lan ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-539ffff39a7sm258959e87.164.2024.10.15.14.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 14:37:30 -0700 (PDT) From: Linus Walleij <linus.walleij@linaro.org> Subject: [PATCH 0/2] Fix KASAN crash when using KASAN_VMALLOC Date: Tue, 15 Oct 2024 23:37:13 +0200 Message-Id: <20241015-arm-kasan-vmalloc-crash-v1-0-dbb23592ca83@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAIngDmcC/x3MQQqDQAxA0atI1gaMzLTQqxQXcYwaqmNJQATx7 g4u3+L/E1xMxeFTnWCyq+uWC6iuIM2cJ0EdiqFt2kANRWRb8cfOGfeVl2VLmIx9xjH1Q6RArxD fUOq/yajHc/5213UDvZs472kAAAA= To: Clement LE GOFFIC <clement.legoffic@foss.st.com>, Russell King <linux@armlinux.org.uk>, Kees Cook <kees@kernel.org>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Mark Brown <broonie@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Ard Biesheuvel <ardb@kernel.org> Cc: Antonio Borneo <antonio.borneo@foss.st.com>, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Linus Walleij <linus.walleij@linaro.org>, stable@vger.kernel.org X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241015_143733_457635_E3197277 X-CRM114-Status: GOOD ( 11.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Fix KASAN crash when using KASAN_VMALLOC
|
expand
|
This problem reported by Clement LE GOFFIC manifest when using CONFIG_KASAN_IN_VMALLOC and VMAP_STACK: https://lore.kernel.org/linux-arm-kernel/a1a1d062-f3a2-4d05-9836-3b098de9db6d@foss.st.com/ After some analysis it seems we are missing to sync the VMALLOC shadow memory in top level PGD to all CPUs. Add some code to perform this sync, and the bug appears to go away. As suggested by Ard, also perform a dummy read from the shadow memory of the new VMAP_STACK in the low level assembly. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- Linus Walleij (2): ARM: ioremap: Flush PGDs for VMALLOC shadow ARM: entry: Do a dummy read from VMAP shadow arch/arm/kernel/entry-armv.S | 8 ++++++++ arch/arm/mm/ioremap.c | 7 +++++++ 2 files changed, 15 insertions(+) --- base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc change-id: 20241015-arm-kasan-vmalloc-crash-fcbd51416457 Best regards,