From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 840F533D5 for ; Wed, 4 May 2022 20:18:02 +0000 (UTC) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-2f7b815ac06so28279497b3.3 for ; Wed, 04 May 2022 13:18:02 -0700 (PDT) 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=OQdnNmzv4usFcCEslqJZULlg/FXfYALoeT9o7toWf+k=; b=qxZZQ6AsGHlKFFmOKUtmMByudpi1JNcM2xDw70w505LXnF7lLC/fAGH//lR/VZSrlR bzYODkJGL2C4z48gkOhr1/f+95RehMweBA2jJko7pnpROeEw4lFeekw/gjN1Sr37kxgi VOMlKjWfiWZVgzx71URL6y09ubNYGY2jqAqF8+kHrivs8kT+ROvGvq/omyFx6GiYzqnh 2HFIhB+NVMjgQxOjfu7xbPQLIRCzspV8NJf8VjKSPTDxgkMvVCPk7/5bkBeytyd4UZ3g nvxpwS5oICYNm4lV3uFPcMoYAXHHXPd6xQUHQRffNQmcC4ERg/4fgc/qsJtYGU/9DGZP TTaw== 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=OQdnNmzv4usFcCEslqJZULlg/FXfYALoeT9o7toWf+k=; b=TcZsVhc8xjMyaJvawtMQFCWzh0Y9mAE4Ys4zNd5PgykPmD2GsKP3fbJlkwGnxTbCPS Gfq7JWvw/73pm/p/NHvI7A2XBD7wuDqn2qj/dfH6Gms+aqMrEi+5sycJsNxO3XTvWALQ MUe4ielbVBTiKPkT5AcFwor1E3bykUzqVb2Y0CC+vLGGouMdK5DoLvgdDAfB+rbrB6Wk ZfYi53tnsR+L640o/nfz+8B7bP3RgaPSHcUbTIqe48GPeyb1coaeR0swpHIbaiTLXWnS hM8SYxyYb0nb8kgxGBA/kdv4j/J3rqLS/Mn7jhvxUmLNBoVIOOckuDvVIS8xJCGsH/hH BXjQ== X-Gm-Message-State: AOAM530+/snke2YvBTCL997ZlDv61AouqqYX5wVi5N842jJMzVumqHml WvqDZC9TFpdglwxr/UG/5nMezmYzxE1M8qj5Y1JLXA== X-Google-Smtp-Source: ABdhPJyFwC10hGfB50VlWpxYYTkP/wq9NopFODyumnAGFAWmCLhvv/zUfhxhlo8Okdy8beVJXyf/MQoiY2U1PO5ibCw= X-Received: by 2002:a81:a93:0:b0:2f4:d65a:d44e with SMTP id 141-20020a810a93000000b002f4d65ad44emr20076337ywk.243.1651695481261; Wed, 04 May 2022 13:18:01 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220429203644.2868448-1-samitolvanen@google.com> In-Reply-To: From: Sami Tolvanen Date: Wed, 4 May 2022 13:17:25 -0700 Message-ID: Subject: Re: [RFC PATCH 00/21] KCFI support To: Mark Rutland Cc: LKML , Kees Cook , Josh Poimboeuf , Peter Zijlstra , X86 ML , Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" On Wed, May 4, 2022 at 9:41 AM Sami Tolvanen wrote: > > Hi Mark, > > On Wed, May 4, 2022 at 9:18 AM Mark Rutland wrote: > > I wanted to give this a spin on arm64, but I'm seeing some very odd toolchain > > behaviour. I'm not sure if I've done something wrong, or if I'm just hitting an > > edge-case, but it looks like using -fsanitize=kcfi causes the toolchain to hit > > out-of-memory errors and other issues which look like they could be memory > > corruption. > > Thanks for the detailed bug report! It definitely looks like something > is wrong with the recent switch from std::string to Twine in the Clang > code. I didn't see this issue when compiling the arm64 kernel, but > I'll take a closer look and see if I can reproduce it. I was able to reproduce this by turning off assertions in Clang. It seems to work fine with -DLLVM_ENABLE_ASSERTIONS=ON. I'll go fix. Sami 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 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 350DCC4332F for ; Wed, 4 May 2022 20:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc: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=gSxMCxViwdv17phQwANtvNIlm15bRcTl+pX66AxZlVs=; b=bz/rxCQoN8zLSF IQiJbx6pdq1xJ30n+FpLrX7R5vqoYVjsJmnkONzUU/UZXqu4+1OyGl1tttI4q31r2j4fBIVg4kpmQ A3TgY4df8vwzP+0zXy7djZM1ASapIyYjUwwmt4NzIbp89Mk8Fc6uJgfyZGAUbIWP4j2VBwEf8zqSL mufX1B0r+z/BIc/+g6y3qyDykGvog6g+b4izlWGDG//gLsgD4OxwwEjxvcvjMym+gLsPb+LoKt7z8 /9BQnAiECrEZBCI1OyV8wTQNFugGJiSuwPieswvQfDTzmJBhpqu2S6gTeBJfzJYe0UN20bZFnvNN+ hpU/EiLCwYEW6mYsrBdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmLRn-00CW8N-3E; Wed, 04 May 2022 20:18:07 +0000 Received: from mail-yw1-x112b.google.com ([2607:f8b0:4864:20::112b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmLRk-00CW7Y-F6 for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 20:18:05 +0000 Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-2f7bb893309so28046667b3.12 for ; Wed, 04 May 2022 13:18:02 -0700 (PDT) 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=OQdnNmzv4usFcCEslqJZULlg/FXfYALoeT9o7toWf+k=; b=qxZZQ6AsGHlKFFmOKUtmMByudpi1JNcM2xDw70w505LXnF7lLC/fAGH//lR/VZSrlR bzYODkJGL2C4z48gkOhr1/f+95RehMweBA2jJko7pnpROeEw4lFeekw/gjN1Sr37kxgi VOMlKjWfiWZVgzx71URL6y09ubNYGY2jqAqF8+kHrivs8kT+ROvGvq/omyFx6GiYzqnh 2HFIhB+NVMjgQxOjfu7xbPQLIRCzspV8NJf8VjKSPTDxgkMvVCPk7/5bkBeytyd4UZ3g nvxpwS5oICYNm4lV3uFPcMoYAXHHXPd6xQUHQRffNQmcC4ERg/4fgc/qsJtYGU/9DGZP TTaw== 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=OQdnNmzv4usFcCEslqJZULlg/FXfYALoeT9o7toWf+k=; b=v6Bi/tbBVnfdDo84hwXbz5fmRjQzGEbZEHaEt4Ewze5u4cHb+MzNgeHLCtaVAEaxq0 QZvBYDnUg8r9U36b8aqYR9hERBUbuW48T3pjgDKHVoUma1RV5knq7sB3AULfHtcQc2h9 5L6Md1aFR+IEKyzG+w+7EvJvfNMKhyois3B8uFWcFP3J8GBeDALky/KSAIufDFbEVrqL /xoAgphQOygA9d2uHKD8/lDBf70/k34FQySLSXE4CSMjlfttV+oT3cvN56edQLHHZ78+ rlvh6bnRuCU/kFnkYzBdlAZkuBF9raVoEC8XMxigK6lkvYHRMIVU+glzARB5NIJJrtol JlvQ== X-Gm-Message-State: AOAM532Vy7c8zJ2p+6QmHWT5GuYg6PUCIFzj1WjIZ8KqtQbKgjyOzZHo A4hBMK/cgovsDigO5jPRYc8wjmLh54ANIlB36pOqCA== X-Google-Smtp-Source: ABdhPJyFwC10hGfB50VlWpxYYTkP/wq9NopFODyumnAGFAWmCLhvv/zUfhxhlo8Okdy8beVJXyf/MQoiY2U1PO5ibCw= X-Received: by 2002:a81:a93:0:b0:2f4:d65a:d44e with SMTP id 141-20020a810a93000000b002f4d65ad44emr20076337ywk.243.1651695481261; Wed, 04 May 2022 13:18:01 -0700 (PDT) MIME-Version: 1.0 References: <20220429203644.2868448-1-samitolvanen@google.com> In-Reply-To: From: Sami Tolvanen Date: Wed, 4 May 2022 13:17:25 -0700 Message-ID: Subject: Re: [RFC PATCH 00/21] KCFI support To: Mark Rutland Cc: LKML , Kees Cook , Josh Poimboeuf , Peter Zijlstra , X86 ML , Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel , llvm@lists.linux.dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_131804_544307_E2B5993C X-CRM114-Status: GOOD ( 21.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Wed, May 4, 2022 at 9:41 AM Sami Tolvanen wrote: > > Hi Mark, > > On Wed, May 4, 2022 at 9:18 AM Mark Rutland wrote: > > I wanted to give this a spin on arm64, but I'm seeing some very odd toolchain > > behaviour. I'm not sure if I've done something wrong, or if I'm just hitting an > > edge-case, but it looks like using -fsanitize=kcfi causes the toolchain to hit > > out-of-memory errors and other issues which look like they could be memory > > corruption. > > Thanks for the detailed bug report! It definitely looks like something > is wrong with the recent switch from std::string to Twine in the Clang > code. I didn't see this issue when compiling the arm64 kernel, but > I'll take a closer look and see if I can reproduce it. I was able to reproduce this by turning off assertions in Clang. It seems to work fine with -DLLVM_ENABLE_ASSERTIONS=ON. I'll go fix. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel