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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=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 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 58482C81857 for ; Mon, 27 Apr 2020 22:09:55 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 11748206D9 for ; Mon, 27 Apr 2020 22:09:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ly31RIpW"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="axOblyzY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11748206D9 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+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XfyO3yXq5DA6WulSW5Lfum6A9e/C0x7inuQGsL6CTx0=; b=Ly31RIpWc38wae S4zvk0W77WSX851dmGKmH7FjxipJragvSFZ7eNF2vLnfDq+e39sgKcwKhKCXUPfyaGbA2NUIosQ6V CtUDMfyjHZoN5fQFvDSnuE1Hc0xcMVdF2r8+2a72b5oP+LRiCoqG/u+fMlyrHd31M64x6jpg3CnU6 Kdis04VWTpKs7QNoIvyMAUF5ncB7KaWmTrZqa8r6Y9N1kUKzxhRSz3Kj6i6i883JcX88rvMiCJjqm 2BgMJJ3GMhPfqMghDTp5X5hN2uEA8aiX5r3P3E4sSSjlDvIHMWlT1fBFgDyTh4vcELkVe3InA32B2 i9RvMv+NXnhe5YhGWQyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTBwo-0005Px-NO; Mon, 27 Apr 2020 22:09:54 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTBwm-0005PC-9Q for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2020 22:09:53 +0000 Received: by mail-pf1-x444.google.com with SMTP id x2so5959284pfx.7 for ; Mon, 27 Apr 2020 15:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Xe8RUkEJu/E4jWUvQIevudFni0eW89aFKGU5bjDlftc=; b=axOblyzYYZwm23zJs/yIhW4AiXhyGbo1u4AhSQWZk6aCS3SbgYhrO3uxU/GIgXJe+R lZFY51Gu9ZAm1+Wx8ojNeFt262o3xlrjkkPW0UDsqW7aQHJ1kxx3GUTkZZ+SHEwEx4sj qIXCdTHxBwmKDJGtD8EE1vu3RoM8rdzvr7zJDbahVKaFbLW3BvoGBtbrg30QQDm9ZjL4 NPsfDMvwSpCub92zGM4zYe+Jb2mMQ9YPQ+DnbHm8ALegArlm8BVMTVmhVxMj9B3OIDe9 C66WGlEQ/5l6bbT1mq3LFfU7EdwlU0npz53O3fl3EQgOzkoYeSp2jk4DOPWs1j31cN1R XZyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Xe8RUkEJu/E4jWUvQIevudFni0eW89aFKGU5bjDlftc=; b=NNPfb8acqzgZIM1OV8gL5i4kpsmbOeC7Jppdq7lU6mgZ0FzoKnGh7XhW+ZOJyj/ZxU 2PVOmwmt0F7Ixr6KhJYKIg4DQjiGt7bKIinMBrGYzz1yzIjrktHc1C/mt7/Vls2REQg2 r9bTKvm81Ub5Ah9+oQLqUVjhn2Kot8MdBMRLjLNPPWOoMbBrczaif5hqbf7UCrDT7WPR jNw7vB+3WGkmwcfAGBxGha0zvfW0F7AhdCMGg1TethFT8lco1MfYSWvHpveHia9KuhP5 hlV9GAAeNQRWKRZdbD6ujtpYd/F5x5l7kD5Og4TJfpsesfCV7vXWUtCMc1550ELnykuX 55KA== X-Gm-Message-State: AGi0PuZz2CTNjK3pwm+meKsQK6pPEhBW/vUQBtdiaX2A7g30eg/HsOcw tfPTPCwC04UHsWVF+yI8RDxxog== X-Google-Smtp-Source: APiQypJpQnaMid4q4FwB9UWWT+cZC0Q4L77KS//F8Pl43k21RxaiBYMIK3X+fVPtnLNFejOX3p7P2Q== X-Received: by 2002:aa7:951a:: with SMTP id b26mr25384503pfp.44.1588025389927; Mon, 27 Apr 2020 15:09:49 -0700 (PDT) Received: from google.com ([2620:15c:201:2:ce90:ab18:83b0:619]) by smtp.gmail.com with ESMTPSA id l8sm3554016pga.60.2020.04.27.15.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 15:09:49 -0700 (PDT) Date: Mon, 27 Apr 2020 15:09:42 -0700 From: Sami Tolvanen To: Ard Biesheuvel Subject: Re: [PATCH v13 00/12] add support for Clang's Shadow Call Stack Message-ID: <20200427220942.GB80713@google.com> References: <20191018161033.261971-1-samitolvanen@google.com> <20200427160018.243569-1-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200427_150952_352907_950FEC00 X-CRM114-Status: GOOD ( 18.92 ) 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 , Juri Lelli , kernel-hardening@lists.openwall.com, Peter Zijlstra , Catalin Marinas , Will Deacon , Marc Zyngier , Masahiro Yamada , clang-built-linux , Ingo Molnar , Laura Abbott , Dave Martin , Kees Cook , Jann Horn , Steven Rostedt , Linux ARM , Michal Marek , Ard Biesheuvel , Nick Desaulniers , Linux Kernel Mailing List , Miguel Ojeda , James Morse , Masami Hiramatsu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 27, 2020 at 10:50:34PM +0200, Ard Biesheuvel wrote: > > OK, so one thing that came up in an offline discussion about SCS is > > the way it interacts with the vmap'ed stack. > > > > The vmap'ed stack is great for robustness, but it only works if things > > don't explode for other reasons in the mean time. This means the > > ordinary-to-shadow-call-stack size ratio should be chosen such that it > > is *really* unlikely you could ever overflow the shadow call stack and > > corrupt another task's call stack before hitting the vmap stack's > > guard region. > > > > Alternatively, I wonder if there is a way we could let the SCS and > > ordinary stack share the [bottom of] the vmap'ed region. That would > > give rather nasty results if the ordinary stack overflows into the > > SCS, but for cases where we really recurse out of control, we could > > catch this occurrence on either stack, whichever one occurs first. And > > the nastiness -when it does occur- will not corrupt any state beyond > > the stack of the current task. > > Hmm, I guess that would make it quite hard to keep the SCS address > secret though :-( Yes, and the stack potentially overflowing into the SCS sort of defeats the purpose. I'm fine with increasing the SCS size to something safer, but using a vmapped shadow stack seems like the correct solution to this problem, at least on devices where allocating a full page isn't an issue. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel