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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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 B8C4AC433F5 for ; Mon, 13 Sep 2021 11:25:56 +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 8507B61029 for ; Mon, 13 Sep 2021 11:25:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8507B61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=r0WfVlhdI5auLOQ+L9xKviZaj1UryiPgb5qMEgByoxs=; b=dDj7KKpdiBmHJk FFCe38LcTdzK9Fyt9i6wHHDyA1AyJ99hgPRX9WuoOl+Gb8/qASJBRiN6Me8HF9Q0iNbRRCR7Ru+X8 dKbQd1eHZYGtubPqonFDbVa4oKBB9BOiO3XU8Yczp5154ESfW9ZIyeXFNY/kOVjHqNm8vYLX7TTuD NVWUteJoBRMQBM61vSXWNZ8zHFf4fkn3ucJzQqnbNgBSjaUhy8pLkphU/i3eYrUxi2+O471n37Alf xD2D96ndd5S7bsU5r0S8oU1+dcd7HgtT6qEQXJe0nv5wfFSgGAbA1HcyjVKKlvfoEG6vlzBSE/upa UuUrwkKV2xls/P7x3Neg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPk3u-001TGt-R8; Mon, 13 Sep 2021 11:23:46 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPk3p-001TGV-BO for linux-arm-kernel@lists.infradead.org; Mon, 13 Sep 2021 11:23:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nApvNwvFuM3tLcJ1BsAS4WDiZIYKAMPppRiQn6nQ4zg=; b=tk1fEqJL7P9XFB1ZmImwFzxcKI G6Qo0yzlS8M9dqEomc2kTCuKKhbi3nCTXudNkMwGEJFyEfIz8OLIznQqBNIZns7l4AFZC9Yj1IOSG kjEmfNyvMj7SyySVv2+IbcKHKZvdpbxOAnZ+LxrFV0eWb0Ohkk17dJ4BHOlZiK7N8uYwozqSvR95Z tAKxXNsurCJPLFiKosOaow2a9QuDBtQuwH83JX0MBgTiBpAcTDbyK103VpxNMhVnHo0hwHbn6Re7J DCgQEDnOo9/nUCxItmgWR3T8qLL9N8nNCuSAaBLMjNtykiMe/4OAharhpdN4g4MvhLWvX2YCyvZFo XRJ/Awjw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45076) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mPk3m-0003Mh-O6; Mon, 13 Sep 2021 12:23:37 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mPk3l-0001ze-34; Mon, 13 Sep 2021 12:23:37 +0100 Date: Mon, 13 Sep 2021 12:23:37 +0100 From: "Russell King (Oracle)" To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, Keith Packard , Kees Cook , Arnd Bergmann , Linus Walleij Subject: Re: [PATCH v4 0/5] ARM: support THREAD_INFO_IN_TASK Message-ID: References: <20210913104001.3043132-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210913104001.3043132-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_042341_647597_84867477 X-CRM114-Status: GOOD ( 21.45 ) 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, Sep 13, 2021 at 12:39:56PM +0200, Ard Biesheuvel wrote: > Placing thread_info in the kernel stack leaves it vulnerable to stack > overflow attacks. This short series addresses that by using the existing > THREAD_INFO_IN_TASK infrastructure. > > This v4 is a follow-up to Keith's v3 [0], which did not address all > concerns I raised in response to v2. After collaborating with Keith > off-list, we decided that I should go ahead and post our joint v4. > > Changes since v3: > > - Leave the CPU field in thread_info, and keep it in sync at context > switch time. This is by far the easiest and cleanest way to work > around the fact that it is infeasible to implement > raw_smp_processor_id() in terms of task_struct::cpu (for reasons of > header soup). > > - Drop the VFP changes, they are no longer necessary given the previous > point. > > - Drop the change to pass the CPU number to secondary_start_kernel(). > Given that we also need to pass the idle task pointer, which carries > the CPU number, passing the CPU number directly is redundant. > > - Use the TPIDRURO register to carry 'current' while running in the > kernel, and keep using TPIDRPRW for the per-CPU offset as before. This > way, there is no need to make any changes to the way the per-CPU offsets > are programmed. It also avoids the concurrency issues that would > result from carrying the 'current' pointer in a per-CPU variable. > > - Update the per-task stack protector plugin to pull the stack canary > value directly from the task struct. Overall, this looks much simpler than Keith's v3 to me, so probably less likely to run into issues in the future. The only suggestion I hvae is the comment I've made on patch 4. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel