From patchwork Thu Oct 22 20:23:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 11851871 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=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,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 9262BC388F9 for ; Thu, 22 Oct 2020 20:25:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 1395E24679 for ; Thu, 22 Oct 2020 20:25:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H1cCHskS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="bJDYKack" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1395E24679 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:Mime-Version:Message-Id:Date: 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=8TGbNfpsVPZKZKNCWmHEu0HU/mRgUJQH5MvcTN0KD2c=; b=H1cCHskSOpmoINuyEI8x7vOr6p 3gwC/jZ3YecQGYiMVKzyGbOloTpF6O1WbFIoL1w1LzdKE+nmuspoUskIbA3fnfGSceaTBY4nDDsmK ayzFxSbJLmuadiP9LC9QVxc4p5Ju9Tsi9mnQe7xBBIWBj5aHDLGyAdN/tnS72pL7DYUFsRuBblQde U2nvpBfRmypY2kFM6w+38u5XT7ud/G59EZofbWHFXOgCD2yXrCYMkzeEElHFQZRStK9kga8v2v92H snHxc/z0cpFBJ0aTi1WyDOIuH8rJR3PqBAyug/Aex9lnBBslVkfuyJtIlQpQqGqtMtW1EMqlvT7EB +MhaUX+g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVh85-0001nd-PJ; Thu, 22 Oct 2020 20:24:09 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVh82-0001mV-Cn for linux-arm-kernel@lists.infradead.org; Thu, 22 Oct 2020 20:24:07 +0000 Received: by mail-yb1-xb49.google.com with SMTP id y11so2918284ybm.22 for ; Thu, 22 Oct 2020 13:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=HUKMjAMdYgAudHjv40qJho4+mpPsVV2zIf1Pb9dxju8=; b=bJDYKackW4gnmf4ke0c70lVD/bvgt4vxrVlTfcw021E+/nI0zlLw0Rr5wu6nZzdJgT fZoZk5T+jtiuRl6Rssqck66cxO+v997nKlECMftQ+LGsmdSVzGz+pxfMtBD5IBjEIu6E ApDdkKQuW4QUNsmzaJYrkDCqymE/wen9+bvhshK3X/untssj0s0rstgCTA+AhlwcBLqB yuTtiBFKJAWL+4zKPM0X4Gqrb6tB9wQ+yb4cwSLVGiOtIsFX4nf+xyzuUjCvExYvotN9 tAazT+jn6/FbN5tuqyT0IIJt2ngP+xxNYRJ+yPEe8dkqXgfOfKx09DiDlpjjNE17Ak4e oWkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=HUKMjAMdYgAudHjv40qJho4+mpPsVV2zIf1Pb9dxju8=; b=d09XTZPtoe+eUOiNnVnBP2WWPm1HdYoyJCLRl7bkOI2jNXzrTLS5hf08IKFwI4z6YK wbndoa2n+wxBB7tmSjsRC+PJYZb0BBdAqIsqlstye45cFxx1dn+OmoAhs48M/LDFfhCQ qeLFxF2hZgHd2uItmurYis2TFtZp2fi0JSa2A5Rcf6rkGBpsWk+YQMUaHKwdQfeeJaYX hLRGqW0A5MfYrtIUeRMubJVuGEbGCpA0QE1z8EB9qUMmbR4hUc0J09VCSDYsMkLgtNe7 kiQZ4a5oAfcTRC9JTUxqY8SNFFegPgtRLhD33etK1IcYerZwUCpDf+p0njdQRtIlRqNB 8wpw== X-Gm-Message-State: AOAM531gWLKrX4Fn/UIUo2ko/wdsJ1VGrr1vhl8s/ugV6ESQA2ErTzUD 5S7Y3yXPEHFLkKLRv0cd6sHIQ7TfScTYo4idFQg= X-Google-Smtp-Source: ABdhPJz1QFO4Sm3gtxxFG/5nw82gV7L2ChGBMWbfdgNmnRF6Ft1+bcSrSU7SSX+U0dOB1MhI3HCKjtPdi1PvKNAcQdQ= X-Received: from samitolvanen1.mtv.corp.google.com ([2620:15c:201:2:f693:9fff:fef4:1b6d]) (user=samitolvanen job=sendgmr) by 2002:a25:ba4c:: with SMTP id z12mr5684689ybj.366.1603398242686; Thu, 22 Oct 2020 13:24:02 -0700 (PDT) Date: Thu, 22 Oct 2020 13:23:53 -0700 Message-Id: <20201022202355.3529836-1-samitolvanen@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog Subject: [PATCH 0/2] scs: switch to vmapped shadow stacks From: Sami Tolvanen To: Will Deacon , Catalin Marinas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201022_162406_481465_E417D124 X-CRM114-Status: GOOD ( 10.69 ) 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: Mark Rutland , Kees Cook , Ard Biesheuvel , linux-kernel@vger.kernel.org, James Morse , Sami Tolvanen , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As discussed a few months ago [1][2], virtually mapped shadow call stacks are better for safety and robustness. This series dusts off the VMAP option from the original SCS patch series and switches the kernel to use virtually mapped shadow stacks unconditionally when SCS is enabled. [1] https://lore.kernel.org/lkml/20200515172355.GD23334@willie-the-truck/ [2] https://lore.kernel.org/lkml/20200427220942.GB80713@google.com/ Sami Tolvanen (2): scs: switch to vmapped shadow stacks arm64: scs: use vmapped IRQ and SDEI shadow stacks arch/arm64/include/asm/scs.h | 21 ++++++++++- arch/arm64/kernel/entry.S | 6 ++-- arch/arm64/kernel/irq.c | 2 ++ arch/arm64/kernel/scs.c | 67 +++++++++++++++++++++++++++++++++--- arch/arm64/kernel/sdei.c | 7 ++++ include/linux/scs.h | 15 +++----- kernel/scs.c | 67 ++++++++++++++++++++++++++++++------ 7 files changed, 156 insertions(+), 29 deletions(-) base-commit: 96485e4462604744d66bf4301557d996d80b85eb