Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp486820pxm; Fri, 25 Feb 2022 12:02:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJysLAyv1RScLhwA23ieInRe7DwmkHfhcNa6j7PqNjjWiSc7CYlaU04mO+RtSY8t1cpmE1/J X-Received: by 2002:a05:6a00:198f:b0:4e1:abfd:43cc with SMTP id d15-20020a056a00198f00b004e1abfd43ccmr9057680pfl.20.1645819369557; Fri, 25 Feb 2022 12:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645819369; cv=none; d=google.com; s=arc-20160816; b=nKF3uw3TDQkbWBW3DHnR9z0F8fcNOIYYQE9vFnXQRIeGXf8zEZVyYKAl3wqZClNfPc fH7JxMh00duvds+NtiTUh9b4TXbO4Qsxjl9RfDynLmSJ8pEOBdnJkGZco73JdqtYgWR7 dyv54QhqTR6jkvnT03vLrnp0wvrwMLCo8Khh0XyhAygr8xQQwtkVFmIvMDkjZCI3NE56 dSjSDC5YIO1PI72C65gJ8RlcBbG6mNiF0naDBiBnOlqH4IzC6vNGG10WWYvugcbpIvAW l9rd1z25CLSdscL4CcVdhe9lZhcbwMNM4eJQu8i+p5T9zTV/+tMManJ/u+8Mc3nxKWao gdXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=91lfqerMyrhcvkt/Xxml96fIqw1rCGTngu2Yekjv2ZI=; b=uLd+dDD7VAGJ+UWKgfrzlG/p0d8IRO8BGlWJ9b8q1lnXfHCOwT49zBxq0nIyS8d0TT 45dBm1jvjSyRoJDQKqLBES5cfT+4UwMbPcUNTRi5fsKoxZcikhJ2EOl/FLRxSdBvgDXa Mf++Amm/B1B/R4f+DqUbNYPlhd+pLcMRh5QSHkkGlx/qJUgzP3A6KU3n4bTptYUvQNAs b8erQM5g73m+VfJuGIfHUDiah5hMkGRA/TEz6IFaa4bApalrgzRN+g1ndHqTdwE04oVT VjH2TsiXZVgmlNLbYYN2NvsuQE6zOSDHYwb3xt4yCZAAoxBXaZA5yUJNNfZlZZjX/6Aq y9fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=E+tFHAQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u63-20020a638542000000b003656c6cc42csi2547388pgd.670.2022.02.25.12.02.33; Fri, 25 Feb 2022 12:02:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=E+tFHAQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbiBYNGy (ORCPT + 99 others); Fri, 25 Feb 2022 08:06:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiBYNGw (ORCPT ); Fri, 25 Feb 2022 08:06:52 -0500 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5AFA1E5A63 for ; Fri, 25 Feb 2022 05:06:20 -0800 (PST) Received: by mail-yb1-xb2a.google.com with SMTP id j2so5839563ybu.0 for ; Fri, 25 Feb 2022 05:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=91lfqerMyrhcvkt/Xxml96fIqw1rCGTngu2Yekjv2ZI=; b=E+tFHAQ5pyr27wKtgDUnzIAZDktAJK1JxSFWfkF+uK5aNwQybxvr9cfZBFwUHlYZZ0 MK6E+8qKnHRMT2xPb+Y3izP3sho0aJIaHAWWU6WGuMItBEnSLrYkcV2CPRjJzz6ddAD8 J+br2bR3zJSJbZ1lAl0Zvhjwde64U/c0dbzLVJokqOYSaVRdGySmQbY+mcgRVV91wJ/S S0gSuJmSMUVTB3rcIJiMxIy2B8ateNHDJ54h/N+KaemldpyDH7ioajAiIRB41VhZYbzZ 2wUnoYDRvJ3UgTuByfaLZj+2wiy2OjRN7WW0Gev0AeiFZk/NzaBfeAurcujexBgjgpq9 dmZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=91lfqerMyrhcvkt/Xxml96fIqw1rCGTngu2Yekjv2ZI=; b=Ya1RIpM0EZC5YJlnz8U5z4/rkZbhr1mYrTJZps1GI/veaYRb/wrvxafCOHD/tAC3E8 DMvDYb1FvkeWsRjmFLY0BafKZc1Ah1OktGLLD+493wrEqotzIm6hBjkl12Oq0YpkmM2J fN4PqR15xnDGb3Aax85sUznrsLyC762AVK6A7GspZuC/dF9lTjFSHDuNFu/3syW/9Af6 2JHoeJzZtk+3Tsx1muFdmHlziQVMuS3wFWz+EanXbIe1gLjYWw2eSRLtg19VeQr8fgl5 /NHERN2VQUVLVGmJ6+JaKFGtsL2p7KMYiU7643Orp3Alcw3nQ1HD/fp00vgxDIo22I12 sJAg== X-Gm-Message-State: AOAM531I/gIyNchzdE/B9+IWD2QwmuHrxre/scvm5iTqdbs2JUPT4+l3 qqlkdsiZvFg4hyjcIy53H5jZrXGm6j5ALni10Y8Gxw== X-Received: by 2002:a05:6902:2:b0:624:4cb5:fd3b with SMTP id l2-20020a056902000200b006244cb5fd3bmr7286257ybh.1.1645794379723; Fri, 25 Feb 2022 05:06:19 -0800 (PST) MIME-Version: 1.0 References: <20220225123953.3251327-1-alexandre.ghiti@canonical.com> In-Reply-To: <20220225123953.3251327-1-alexandre.ghiti@canonical.com> From: Marco Elver Date: Fri, 25 Feb 2022 14:05:42 +0100 Message-ID: Subject: Re: [PATCH -fixes v3 0/6] Fixes KASAN and other along the way To: Alexandre Ghiti Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Aleksandr Nogikh , Nick Hu , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 25 Feb 2022 at 13:40, Alexandre Ghiti wrote: > > As reported by Aleksandr, syzbot riscv is broken since commit > 54c5639d8f50 ("riscv: Fix asan-stack clang build"). This commit actually > breaks KASAN_INLINE which is not fixed in this series, that will come later > when found. > > Nevertheless, this series fixes small things that made the syzbot > configuration + KASAN_OUTLINE fail to boot. > > Note that even though the config at [1] boots fine with this series, I > was not able to boot the small config at [2] which fails because > kasan_poison receives a really weird address 0x4075706301000000 (maybe a > kasan person could provide some hint about what happens below in > do_ctors -> __asan_register_globals): asan_register_globals is responsible for poisoning redzones around globals. As hinted by 'do_ctors', it calls constructors, and in this case a compiler-generated constructor that calls __asan_register_globals with metadata generated by the compiler. That metadata contains information about global variables. Note, these constructors are called on initial boot, but also every time a kernel module (that has globals) is loaded. It may also be a toolchain issue, but it's hard to say. If you're using GCC to test, try Clang (11 or later), and vice-versa.