From patchwork Sat Mar 20 04:16:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 12152183 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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 B76CEC433E0 for ; Sat, 20 Mar 2021 04:17:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91AE061998 for ; Sat, 20 Mar 2021 04:17:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229883AbhCTERD (ORCPT ); Sat, 20 Mar 2021 00:17:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbhCTEQf (ORCPT ); Sat, 20 Mar 2021 00:16:35 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 581F9C061764 for ; Fri, 19 Mar 2021 21:16:35 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id kk2-20020a17090b4a02b02900c777aa746fso5781965pjb.3 for ; Fri, 19 Mar 2021 21:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AnMg47T8Z7mVw2QYcNj+ca1PflwjFpQ0knP09yHBQe8=; b=PrfZRsmz3UsByLzMgIDUIzCr+LhjgOYA+Nh9/H13Agb9hHJi7ziHDjVe3JuOzAL2FX xUiC3V+PT+eCW5XYT+iDKAAQ0o3CxYXpEdi8GCRjDUw/U5Of+RBSi7tmM31+HWvwZ7Fm XIU5+XedKEFeMg9zmn1ExdTrB4wQMwqm98ODw= 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=AnMg47T8Z7mVw2QYcNj+ca1PflwjFpQ0knP09yHBQe8=; b=Ul6AsIU3W11m4vTsySHTLrAzCiN9vVkIaCccWhyX7u3zbsJ05QFpFcPqUsRJXF2zvh BEYK5yn4pJc3Mu8kHAsb5c1PaMd088inaxCDz3gWjrT6LvJJiIOJpNLZpco8Vzt7Q+aX beNFGsypNQsCgqjh03xGk/zyqf4bXaWJ10NGT7gAoeR+VqmKqNPj+laxYnrBxuDjGCud 7cVwLxrTB8P6+R3XtDYpa5Tf9+x2GTu+bMJXWYX7r4sDFka6j334RdWPlhn+qR/1x5cN WGXgdIeqjzNSf29mkwbkINTavYu4PDe+PLtFip5CMPL6v4D+7ldZ/1TntB4HwFrMkaZK 8bGw== X-Gm-Message-State: AOAM530IXlT/X4zrBi7ueDoIOMma4vE5tLeum4xhrwWkjZ1ONAvwxXou 9L3a4tutVQXxtgIS2CJfQNOGLA== X-Google-Smtp-Source: ABdhPJw4hRCPEH2/kfcgtaref9TF8lFo2zdT4xoTpYUa2F76wDEZKZFyP619enk9tKUj0PiS8O5eJg== X-Received: by 2002:a17:90a:ab09:: with SMTP id m9mr1910002pjq.122.1616213794673; Fri, 19 Mar 2021 21:16:34 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:f0c7:e1f7:948e:d8d5]) by smtp.gmail.com with ESMTPSA id s62sm6998869pfb.148.2021.03.19.21.16.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 21:16:34 -0700 (PDT) From: Nicolas Boichat To: stable@vger.kernel.org Cc: groeck@chromium.org, Nicolas Boichat , Alexandre Chartre , Arnd Bergmann , Benjamin Herrenschmidt , Christopher Li , Daniel Axtens , Greg Kroah-Hartman , Kees Cook , Masahiro Yamada , Michael Ellerman , Michal Marek , "Naveen N. Rao" , Nicholas Piggin , Paul Mackerras , Peter Zijlstra , Thomas Gleixner , clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [for-stable-4.19 PATCH v2 0/2] Backport patches to fix KASAN+LKDTM with recent clang on ARM64 Date: Sat, 20 Mar 2021 12:16:24 +0800 Message-Id: <20210320041626.885806-1-drinkcat@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Backport 2 patches that are required to make KASAN+LKDTM work with recent clang (patch 2/2 has a complete description). Tested on our chromeos-4.19 branch. Also compile tested on x86-64 and arm64 with gcc this time around. Patch 1/2 adds a guard around noinstr that matches upstream, to prevent a build issue, and has some minor context conflicts. Patch 2/2 is a clean backport. These patches have been merged to 5.4 stable already. We might need to backport to older stable branches, but this is what I could test for now. Changes in v2: - Guard noinstr macro by __KERNEL__ && !__ASSEMBLY__ to prevent expansion in linker script and match upstream. Mark Rutland (1): lkdtm: don't move ctors to .rodata Thomas Gleixner (1): vmlinux.lds.h: Create section for protection against instrumentation arch/powerpc/kernel/vmlinux.lds.S | 1 + drivers/misc/lkdtm/Makefile | 2 +- drivers/misc/lkdtm/rodata.c | 2 +- include/asm-generic/sections.h | 3 ++ include/asm-generic/vmlinux.lds.h | 10 ++++++ include/linux/compiler.h | 54 +++++++++++++++++++++++++++++++ include/linux/compiler_types.h | 6 ++++ scripts/mod/modpost.c | 2 +- 8 files changed, 77 insertions(+), 3 deletions(-)