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 6768EC433EF for ; Tue, 25 Jan 2022 20:59:49 +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=NZ+Baygdxbdjz5xaT6I0xE/uVO+9j4OCIhRn89yxhy0=; b=I6kNzdyxGutD/l 7aYfs+fZrwhXbMNrDAQ7nwL75KH7Br1UQWX2eBNpMUFcNAh+jEiqNLfOjdSPj9qbBtx5EeT06sBy1 HyehZyGkfIHhmJ0x1U1PEchxrnh2bbJQjAE5oGb6cejy5bUhESIoIt9b+2h6TcY5P1OCX69E9SyL5 hWM0Vqi2s9bQ3lW3B7QxkMCZT71rLfQA70nT6VRsl1maGIar/16dnDPyK2vnO6H0ju7rnl4MCK3jW nQd9h6FbY5TBHP3B+yHkF4m9v7McPYAPRhI3EdlIeiP8V6pprpU4q2fEeBAKc3H3LfM0icgTRujkS ELa4wjUkAS1rRZobVtlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCStV-009YZU-Cs; Tue, 25 Jan 2022 20:58:25 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCStS-009YYy-9G for linux-arm-kernel@lists.infradead.org; Tue, 25 Jan 2022 20:58:23 +0000 Received: by mail-pf1-x42b.google.com with SMTP id 192so17441354pfz.3 for ; Tue, 25 Jan 2022 12:58:21 -0800 (PST) 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=PUYqmPkBvQIdGU58jwht3HN/0yzGfx8qaQRsB+UNiy0=; b=GQGmBB1DYw8/WmXT+ZpwruOtWZCF/qyI617MKboXaKLvTx8ABhBi0H+J/pYvhrLRMw 33cPD0VliF2igzkBK3n7iiwAcFOBDA7my4ywLqovD98nfw3yIixprfAw/WExFlS3ReyT zor0+7rEnTcGVrnObxdq1OSaJor/ORgM+z1io= 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=PUYqmPkBvQIdGU58jwht3HN/0yzGfx8qaQRsB+UNiy0=; b=sAvVcoLWdH1/HcwMthOcg09IeQuZLLSf0xPvzbOgsB+oTLVoyIplGshPWkEi4+xcav U0eMvfTV/jwOmL3GGZcwuUSkyCoJJKvJUvEp13JESlBF0iBIsv6ekQEdas3Grofys/l/ jXyD4Pb8of/YGqP0f4UU2cSARUP3WR/aipSkXAMxSG6nVf4BoS2QIt70eBiFTQRwjawm j7MvOVNmy5NZYw+YjhwZm7MGd1PcXIwMnHNBEyJF++6oIJ0CBDk88pzjoNyYHy1Aw/Hn Zln0axzvVQkdct+zSXe87YTN5AtQMgAMkXcCGG78USqS0r+LLub4EqXiGiouGtN9BRPC InEg== X-Gm-Message-State: AOAM531BH1EhSMw9TFR5as2xCHYsHdVeGZt7kLAEhiLqjJZ6jUj9Dvs7 BtiMLQMt89WnJPXsyyso4cwlnveYQNdhyA== X-Google-Smtp-Source: ABdhPJw2O9JF37i0mzVfYkjnoM1KRfH+UcS6dsMeXv3AbRyHDSJglWOnK4x1rGSswLJsPisNjQ+bsw== X-Received: by 2002:a63:9712:: with SMTP id n18mr16616112pge.594.1643144301071; Tue, 25 Jan 2022 12:58:21 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q12sm11984967pfk.199.2022.01.25.12.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jan 2022 12:58:20 -0800 (PST) Date: Tue, 25 Jan 2022 12:58:20 -0800 From: Kees Cook To: Ard Biesheuvel Cc: Nathan Chancellor , Linux ARM , Nick Desaulniers , llvm@lists.linux.dev Subject: Re: [PATCH] ARM: stackprotector: prefer compiler for TLS based per-task protector Message-ID: <202201251258.35AAAB07E5@keescook> References: <20211021142516.1843042-1-ardb@kernel.org> 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-20220125_125822_356496_55DD1470 X-CRM114-Status: GOOD ( 30.29 ) 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 Tue, Jan 25, 2022 at 07:55:37PM +0100, Ard Biesheuvel wrote: > On Tue, 25 Jan 2022 at 19:50, Nathan Chancellor wrote: > > > > On Thu, Oct 21, 2021 at 04:25:16PM +0200, Ard Biesheuvel wrote: > > > Currently, we implement the per-task stack protector for ARM using a GCC > > > plugin, due to lack of native compiler support. However, work is > > > underway to get this implemented in the compiler, which means we will be > > > able to deprecate the GCC plugin at some point. > > > > > > In the meantime, we will need to support both, where the native compiler > > > implementation is obviously preferred. So let's wire this up in Kconfig > > > and the Makefile. > > > > > > Cc: Kees Cook > > > Cc: Nick Desaulniers > > > Signed-off-by: Ard Biesheuvel > > > > I see this patch in the KSPP tree as commit 151bbc8be85e ("ARM: > > stackprotector: prefer compiler for TLS based per-task protector"), > > which breaks booting aspeed_g5_defconfig in QEMU with clang-14. It seems > > like this patch depends on Ard's patch "ARM: decompressor: disable stack > > protector" [1]; applying that on top of next-20220125 allows me to boot > > again. > > > > This patch is still queued up in Russell's devel-stable branch as > > commit f05eb1d24eb5 ("ARM: stackprotector: prefer compiler for TLS based > > per-task protector") so perhaps this patch should be dropped from the > > KSPP tree? I assume once Ard's recent fixes series [2] is applied to > > devel-stable, it will be added back to for-next? > > > > [1]: https://lore.kernel.org/r/20220124174744.1054712-9-ardb@kernel.org/ > > [2]: https://lore.kernel.org/r/20220125091453.1475246-1-ardb@kernel.org/ > > > > Yeah. better drop it from KSPP. > > The problem is that the compiler version of the per-task > stackprotector feature does not get disabled when building the > decompressor, which means it ends up dereferencing bogus TLS register > values. Ooh! Whoops, sorry. Dropping. -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel