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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78D4FC433EF for ; Mon, 18 Apr 2022 22:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbiDRWCp (ORCPT ); Mon, 18 Apr 2022 18:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbiDRWCb (ORCPT ); Mon, 18 Apr 2022 18:02:31 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED2A5764C for ; Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id u5-20020a17090a6a8500b001d0b95031ebso498580pjj.3 for ; Mon, 18 Apr 2022 14:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cLLWAAHArn9WgPwOUwNflPPJDgjsRY1O3bHGAhIDsQw=; b=LTURonE53ti9q/GT1aK7iRoPMpGAeCy1e4EeYMoQ5ND31pPzYRrBIuxOtS32aAiFM+ 1XHlY0ymuxtf7KP5zzxh8j9ip4/ZkYqKkInt8TY5JnA0taa6ag1p6HhrtkPYOmL/X1BS 68H/ZEsyd88OXRqhJx4ed+KaxwMRzhvwF+Q30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cLLWAAHArn9WgPwOUwNflPPJDgjsRY1O3bHGAhIDsQw=; b=nSr0h1jqnN9xYYik89k1jw5T1x5GQcidmirO3H243wu0ZiyYPrnutohCpaETTK4smD qmcbsvZrDg47XRE6Yg2oLGDrqwCWIj5DlP2WQMQzarX3g/qXnkjXSA/sIMKbYuBqYYGV KKxMBRckOu+vW6SHu7LiexmWWJdVobPMEQ7I9iCuUPkPaDuRQefz/tc+mfNs7a1x32QN 9/RZvL0UPRJMlFI205ehgLMtTjRP9QuiNJM3KSQjj/KyYeAB1+OYzzfikDSMHCIlDvk3 4xTAZ5TxegSbmzD1Nw5jonKgxuMdecZOd+Dgut1AZ5LnRfOdSqaKqK68AQLqmposom40 eZzA== X-Gm-Message-State: AOAM5306BsHIiEFcDaioNFiqnYgHxq2Wgsnp3tKRPsyqn/zBhvxQZdAE RsiFIt3teujjAr1t5ZbSdHu1aQ== X-Google-Smtp-Source: ABdhPJysM2kkydsu6S512r9sNHn81bBvZQZwemOKp8WmD7sADc0kfHvR6/TUHLqhcn1MQ99fL/O1Og== X-Received: by 2002:a17:902:6bc2:b0:158:a26b:5884 with SMTP id m2-20020a1709026bc200b00158a26b5884mr12917161plt.38.1650319190427; Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z15-20020a056a001d8f00b004fda37855ddsm12953099pfw.168.2022.04.18.14.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Date: Mon, 18 Apr 2022 14:59:49 -0700 From: Kees Cook To: He Zhe Cc: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, bp@alien8.de, dave.hansen@linux.intel.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, benh@kernel.crashing.org, paulus@samba.org, borntraeger@linux.ibm.com, svens@linux.ibm.com, hpa@zytor.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames Message-ID: <202204181457.9DE190CE@keescook> References: <20220418132217.1573072-1-zhe.he@windriver.com> <20220418132217.1573072-3-zhe.he@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220418132217.1573072-3-zhe.he@windriver.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote: > This function checks if the given address range crosses frame boundary. > It is based on the existing x86 algorithm, but implemented via stacktrace. > This can be tested by USERCOPY_STACK_FRAME_FROM and > USERCOPY_STACK_FRAME_TO in lkdtm. Hi, Thanks for doing this implementation! One reason usercopy hardening didn't persue doing a "full" stacktrace was because it seemed relatively expensive. Did you do any usercopy-heavily workload testing to see if there was a noticeable performance impact? It would be nice to block the exposure of canaries and PAC bits, though, so I'm not opposed, but I'd like to get a better sense of how "heavy" this might be. Thanks! -Kees -- Kees Cook 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 099ECC433F5 for ; Mon, 18 Apr 2022 22:00:19 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=kiRylnIa/VJdlY0Dz1t+n18wjFRyw4bEMys+1nTX2II=; b=NavWtgDXA5/0aR LNTI8KSgjq8eCxVdIqrgnWtMQMSBaUVfidVWehVSzaiPim7OxEXOyj4WVsg4DcrSk+AYbOOcS43IH gf9rx7JAc1EXs4dUxBYRvV5Wk29V7lgqjsq6TqSgKaYbCEQZ4Vr6UAVkr3xkk68HHIHnC5d/iCclK qZjV6GiA2K/0hSc0wHO4GGxvkCaQ6h3DVHCUiRPvGYP2PzcI0nOVrMQafvjMIsUrxh0LnaWeSoMiE H4/44avhzQnILXv+dU6xw9SaDuxlr/5CVoyj7z8kjXvTIJeLmbqAkMJG8WWEgb17tFF2GRGvKPUMy a+HsQv8ivS6z4TASQnRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngZPe-000g2o-Qi; Mon, 18 Apr 2022 22:00:02 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngZPU-000fzr-IH for linux-riscv@lists.infradead.org; Mon, 18 Apr 2022 21:59:53 +0000 Received: by mail-pl1-x635.google.com with SMTP id b7so3772005plh.2 for ; Mon, 18 Apr 2022 14:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cLLWAAHArn9WgPwOUwNflPPJDgjsRY1O3bHGAhIDsQw=; b=LTURonE53ti9q/GT1aK7iRoPMpGAeCy1e4EeYMoQ5ND31pPzYRrBIuxOtS32aAiFM+ 1XHlY0ymuxtf7KP5zzxh8j9ip4/ZkYqKkInt8TY5JnA0taa6ag1p6HhrtkPYOmL/X1BS 68H/ZEsyd88OXRqhJx4ed+KaxwMRzhvwF+Q30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cLLWAAHArn9WgPwOUwNflPPJDgjsRY1O3bHGAhIDsQw=; b=iT9xEfbbvKr2tSFcitX+sU+SzXdU1OJMfe8GlxJlwDrO0lLkzeUl1q+EJBQyxaaL+Z SwQDxWz1AOyvKyMJ8gA0BmFOIOGBFFcginMNfMPYcIJBj2mZGhht0Sth/V/J3nkUgkCk ApUc8WgQvEOn5R05sojVuPSVNAM1bNUADewgxsunyxDugnDJw176VMD9VyAUUpaEttin 03X2lMtLzQr9n4jGvi6mfyn7P9WBVdRwE/kaTtM/4/gaGWq/bvM8WtTVlcumV1l5Rp7B brO85PK5O14/tG1AdtSjbVTzE9M1AO/xmLKi505iOeHR2hCzpEtaeb7r5Ok1Fw1JH7lH US/w== X-Gm-Message-State: AOAM531nItlAHkP5FGdYA0xI7s9Nq/Iov7q7qq1kqG9wZCunUMJfPzrT 6OgvvyXGkTQK8i6dFdqnlWYN4Q== X-Google-Smtp-Source: ABdhPJysM2kkydsu6S512r9sNHn81bBvZQZwemOKp8WmD7sADc0kfHvR6/TUHLqhcn1MQ99fL/O1Og== X-Received: by 2002:a17:902:6bc2:b0:158:a26b:5884 with SMTP id m2-20020a1709026bc200b00158a26b5884mr12917161plt.38.1650319190427; Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z15-20020a056a001d8f00b004fda37855ddsm12953099pfw.168.2022.04.18.14.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Date: Mon, 18 Apr 2022 14:59:49 -0700 From: Kees Cook To: He Zhe Cc: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, bp@alien8.de, dave.hansen@linux.intel.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, benh@kernel.crashing.org, paulus@samba.org, borntraeger@linux.ibm.com, svens@linux.ibm.com, hpa@zytor.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames Message-ID: <202204181457.9DE190CE@keescook> References: <20220418132217.1573072-1-zhe.he@windriver.com> <20220418132217.1573072-3-zhe.he@windriver.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220418132217.1573072-3-zhe.he@windriver.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_145952_629058_CBE08455 X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote: > This function checks if the given address range crosses frame boundary. > It is based on the existing x86 algorithm, but implemented via stacktrace. > This can be tested by USERCOPY_STACK_FRAME_FROM and > USERCOPY_STACK_FRAME_TO in lkdtm. Hi, Thanks for doing this implementation! One reason usercopy hardening didn't persue doing a "full" stacktrace was because it seemed relatively expensive. Did you do any usercopy-heavily workload testing to see if there was a noticeable performance impact? It would be nice to block the exposure of canaries and PAC bits, though, so I'm not opposed, but I'd like to get a better sense of how "heavy" this might be. Thanks! -Kees -- Kees Cook _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 D8128C433F5 for ; Mon, 18 Apr 2022 22:00:32 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Kj18H01ZVz3096 for ; Tue, 19 Apr 2022 08:00:31 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=LTURonE5; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::102d; helo=mail-pj1-x102d.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=LTURonE5; dkim-atps=neutral Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Kj17c1qJTz2x9B for ; Tue, 19 Apr 2022 07:59:53 +1000 (AEST) Received: by mail-pj1-x102d.google.com with SMTP id s14-20020a17090a880e00b001caaf6d3dd1so483873pjn.3 for ; Mon, 18 Apr 2022 14:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cLLWAAHArn9WgPwOUwNflPPJDgjsRY1O3bHGAhIDsQw=; b=LTURonE53ti9q/GT1aK7iRoPMpGAeCy1e4EeYMoQ5ND31pPzYRrBIuxOtS32aAiFM+ 1XHlY0ymuxtf7KP5zzxh8j9ip4/ZkYqKkInt8TY5JnA0taa6ag1p6HhrtkPYOmL/X1BS 68H/ZEsyd88OXRqhJx4ed+KaxwMRzhvwF+Q30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cLLWAAHArn9WgPwOUwNflPPJDgjsRY1O3bHGAhIDsQw=; b=YyvW/YttGlC5HmsSAN6d2hBk5tJNS4lUV1aNK3+FsMV1sFns1KWOG2DhLADy1jS6n5 rHEY8QBKtDB4d3Q0yXCgJOCzQtmnIc3A8l0OZEjhhpa+7/uUFa7r2E/82bE3VViCk5Jq XEVrfeDe7mEVksbNN4xtExacXGmgZrAQ8EMwRFl9E5vIBwvFoMZoMcZS71EsjRbL7ChP eqTOFTLVRYDuIcencu3O8/Fm8wojcVHX3wtkQ5JEqttS45qLbHrM0o4H2OnfHBNMTrCL 5FmCiEkiY/SIUefEZHtaFuiLZBcLqjJSBagAUZ7XLRfhiwnDvtkVp5JBIow/WUm53N5J Imtg== X-Gm-Message-State: AOAM530oXk9qcCOIsdovNMeGPUZt9jblZY/dNdAKYIaOQRAC4QjGRTt4 UX3R97eJspiwrkb9LmOkaUv6eQ== X-Google-Smtp-Source: ABdhPJysM2kkydsu6S512r9sNHn81bBvZQZwemOKp8WmD7sADc0kfHvR6/TUHLqhcn1MQ99fL/O1Og== X-Received: by 2002:a17:902:6bc2:b0:158:a26b:5884 with SMTP id m2-20020a1709026bc200b00158a26b5884mr12917161plt.38.1650319190427; Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z15-20020a056a001d8f00b004fda37855ddsm12953099pfw.168.2022.04.18.14.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Date: Mon, 18 Apr 2022 14:59:49 -0700 From: Kees Cook To: He Zhe Subject: Re: [PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames Message-ID: <202204181457.9DE190CE@keescook> References: <20220418132217.1573072-1-zhe.he@windriver.com> <20220418132217.1573072-3-zhe.he@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220418132217.1573072-3-zhe.he@windriver.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, linux-s390@vger.kernel.org, x86@kernel.org, hpa@zytor.com, alexander.shishkin@linux.intel.com, catalin.marinas@arm.com, dave.hansen@linux.intel.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bp@alien8.de, svens@linux.ibm.com, jolsa@kernel.org, namhyung@kernel.org, tglx@linutronix.de, borntraeger@linux.ibm.com, will@kernel.org, linux-riscv@lists.infradead.org, paulus@samba.org, linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote: > This function checks if the given address range crosses frame boundary. > It is based on the existing x86 algorithm, but implemented via stacktrace. > This can be tested by USERCOPY_STACK_FRAME_FROM and > USERCOPY_STACK_FRAME_TO in lkdtm. Hi, Thanks for doing this implementation! One reason usercopy hardening didn't persue doing a "full" stacktrace was because it seemed relatively expensive. Did you do any usercopy-heavily workload testing to see if there was a noticeable performance impact? It would be nice to block the exposure of canaries and PAC bits, though, so I'm not opposed, but I'd like to get a better sense of how "heavy" this might be. Thanks! -Kees -- Kees Cook 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 C9230C433EF for ; Mon, 18 Apr 2022 22:01:13 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=TPuWbTNq+Xnj3RAJyUj4vMz4Hz4TlrlMA3e8FVEaYQE=; b=FKmJMav5LY9+Q+ OMO/ncnQx9n1L/2OSnAd+OetdfyxcvOEWDKOGXs5bdNyfXNlA4IiFPwGsEvgSvhSU7uzwzDDf7pYQ MrQerQwoOUbLUwj0QqDL/MvCGfUQX7jTOcee8KbQG3drHZzEdF/3hCx191uZV+iC+Dl/LB/lW6k6b RKmicgdV/RiguDiG7Gi+tSO9isMRwyvxQbiHdYoAwUe31g78VR+UIqq3lYGssPWdE76Yzd8YgzJUC 3ebOoAe+mCYNcQMGUTNvZLITzbgQUyEkJ8lQY8hRA3bqqWZYrXJb8+reXMyM+hcBOd48fdgQUrubA iQvPaYw2HtaRNgh0+tZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngZPW-000g1P-Io; Mon, 18 Apr 2022 21:59:54 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngZPU-000fzq-Cs for linux-arm-kernel@lists.infradead.org; Mon, 18 Apr 2022 21:59:53 +0000 Received: by mail-pl1-x62c.google.com with SMTP id s17so2590003plg.9 for ; Mon, 18 Apr 2022 14:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cLLWAAHArn9WgPwOUwNflPPJDgjsRY1O3bHGAhIDsQw=; b=LTURonE53ti9q/GT1aK7iRoPMpGAeCy1e4EeYMoQ5ND31pPzYRrBIuxOtS32aAiFM+ 1XHlY0ymuxtf7KP5zzxh8j9ip4/ZkYqKkInt8TY5JnA0taa6ag1p6HhrtkPYOmL/X1BS 68H/ZEsyd88OXRqhJx4ed+KaxwMRzhvwF+Q30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cLLWAAHArn9WgPwOUwNflPPJDgjsRY1O3bHGAhIDsQw=; b=WM1mQOTfU6BIzS7RUXAXvz7tuX6KWbiePQqDFIkOwGrR/X7PWXkMAih8c28Il4TXL7 BPWrAhiL0AlOxmbK3BxxvvyBHScrutU9IDNYmr3NgeFTNDkPEgyTOB0UuTAsxoPAUbCG kqOUWVuRSQwnlC7dYuiEl74biIAz1+N13yhgjdrRepIvCtkfrUEknCnwvC/spaX/R/DW MRFpVxovWruvzVTMnd3bXCyqQRuXCBmprNUCeR2D0V0eq5uTlpQvciynv9hyuHjbU+Pz hBtBwZGg+CIlNMCJ/pn9/4YoMUv7ivoC1ResDCy+8oQpKmq30edzLNivtu/UXvF23gWi Gh7w== X-Gm-Message-State: AOAM533i8WUGrWrlTK3TT5w3G/r7+b1AqMuTHzVir1Zks6ltfmB0/xCC UjXCUOlcyIM4t6BmWZUxu9b5J2N7fqTPPA== X-Google-Smtp-Source: ABdhPJysM2kkydsu6S512r9sNHn81bBvZQZwemOKp8WmD7sADc0kfHvR6/TUHLqhcn1MQ99fL/O1Og== X-Received: by 2002:a17:902:6bc2:b0:158:a26b:5884 with SMTP id m2-20020a1709026bc200b00158a26b5884mr12917161plt.38.1650319190427; Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z15-20020a056a001d8f00b004fda37855ddsm12953099pfw.168.2022.04.18.14.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 14:59:50 -0700 (PDT) Date: Mon, 18 Apr 2022 14:59:49 -0700 From: Kees Cook To: He Zhe Cc: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, bp@alien8.de, dave.hansen@linux.intel.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, benh@kernel.crashing.org, paulus@samba.org, borntraeger@linux.ibm.com, svens@linux.ibm.com, hpa@zytor.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 2/8] arm64: stacktrace: Add arch_within_stack_frames Message-ID: <202204181457.9DE190CE@keescook> References: <20220418132217.1573072-1-zhe.he@windriver.com> <20220418132217.1573072-3-zhe.he@windriver.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220418132217.1573072-3-zhe.he@windriver.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_145952_489276_9CA3FF38 X-CRM114-Status: GOOD ( 13.14 ) 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 Mon, Apr 18, 2022 at 09:22:11PM +0800, He Zhe wrote: > This function checks if the given address range crosses frame boundary. > It is based on the existing x86 algorithm, but implemented via stacktrace. > This can be tested by USERCOPY_STACK_FRAME_FROM and > USERCOPY_STACK_FRAME_TO in lkdtm. Hi, Thanks for doing this implementation! One reason usercopy hardening didn't persue doing a "full" stacktrace was because it seemed relatively expensive. Did you do any usercopy-heavily workload testing to see if there was a noticeable performance impact? It would be nice to block the exposure of canaries and PAC bits, though, so I'm not opposed, but I'd like to get a better sense of how "heavy" this might be. Thanks! -Kees -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel