From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D85007481 for ; Wed, 8 Feb 2023 19:35:38 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id f6so1731316pln.12 for ; Wed, 08 Feb 2023 11:35:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=fAJlaNEf9h29bd8ZkCwxz0tgZ1g6+/vtKmnhDMYhw14=; b=Z+ropjWaZw/qeE6gBW6+idTTpgNFbXec1UuKtNv+KwRvRqvYww0Qyw82gl8VdUjD1B ACJF5dPWNYsUa7aR3pW85ooqgpccPNH1Dp+kQZnlxlvvSNCHRIPzJc8csModV1rzyDMD 0ekiiqa5qwsESerHQbxFrAQkqMUH4COBTL4XE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fAJlaNEf9h29bd8ZkCwxz0tgZ1g6+/vtKmnhDMYhw14=; b=dFSYxqxVNL5xRp+iRDtt0kN8sn65sl/Gq0BUStU6dyzNAobjK0IM2XdqvFLbWyv5/4 hYFCyXXb2K1j6QyNk4sZ9anyGKHH61omE+xHoufBwa6Xq0tSNDO6Nsr53Q9mw/FPOG62 UAGaUGZJtM3u4i2lgI9LJHfJU6Znapzy7fs7iC6B/bf1p3zVX0lmLBXE4g+n2C5E3V3L 5XOYnfybEi+Z2NajcZFj0gKfWtHmvlDQR1C92RrF/mqFrQzl+5PcnclLEDnZ9KRbYldQ dY8lu+kXp+t4dkyQa8hpPNPQ3hjKRv+WbyWf4U42332/noIEHLqqCueLNzh4Tm1jdAwE supw== X-Gm-Message-State: AO0yUKVa8YY8BwVNhi8MPC/WGfpz9mHoiRy6QTSghSai076VIHEdnB5k zpDgiA8ymYFiEDz2xuQC4KhqEw== X-Google-Smtp-Source: AK7set8GfKiDufztTpkuEDYL1b8u28pgvoPHLFhPAmA2kCMFZHHpGOh1C22kzQkvkpANzp/CQdvA0w== X-Received: by 2002:a17:902:ced2:b0:199:fc6:9a9b with SMTP id d18-20020a170902ced200b001990fc69a9bmr10210092plg.17.1675884938273; Wed, 08 Feb 2023 11:35:38 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id iz17-20020a170902ef9100b001990e1aeae4sm7268564plb.47.2023.02.08.11.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 11:35:37 -0800 (PST) Message-ID: <63e3f989.170a0220.60c91.c5ce@mx.google.com> X-Google-Original-Message-ID: <202302081133.@keescook> Date: Wed, 8 Feb 2023 11:35:37 -0800 From: Kees Cook To: Dan Li Cc: concord@gentoo.org, linux-hardening@vger.kernel.org, Peter Zijlstra , Masahiro Yamada , Michal Marek , Nick Desaulniers , Catalin Marinas , Will Deacon , Sami Tolvanen , Nathan Chancellor , Tom Rix , Mark Rutland , Josh Poimboeuf , Qing Zhao , "Paul E. McKenney" , Frederic Weisbecker , "Eric W. Biederman" , Marco Elver , Christophe Leroy , Song Liu , Andrew Morton , Uros Bizjak , Kumar Kartikeya Dwivedi , Juergen Gross , Luis Chamberlain , Borislav Petkov , Masami Hiramatsu , Dmitry Torokhov , Aaron Tomlin , Kalesh Singh , Yuntao Wang , Changbin Du , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [RFC/RFT] CFI: Add support for gcc CFI in aarch64 References: <20221219061758.23321-1-ashimida.1990@gmail.com> <20221219132731.6ng4sz2nv6ujvu7i@ubuntu> <202301061929.6881F6CD40@keescook> <20230107154213.ocyghxd2k66gbvv6@ubuntu> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230107154213.ocyghxd2k66gbvv6@ubuntu> On Sat, Jan 07, 2023 at 07:42:13AM -0800, Dan Li wrote: > Hi Kees, > > On 01/06, Kees Cook wrote: > > On Mon, Dec 19, 2022 at 05:32:04AM -0800, Dan Li wrote: > > > Hi Peter, > > Hi! > > > > First of all, thank you thank you for working on this in GCC. This will > > make a big difference for folks that don't have the option to build with > > Clang to gain CFI coverage. > > > > As for the implementation details, the core issue is really that this > > type of CFI is specifically designed for the Linux kernel, and it took a > > rather long time to figure out all the specifics needed (down to the > > byte counts and instruction layouts). GCC's version will ultimately need > > to exactly match the Clang output, or Linux is unlikely to support it. > > > > We're already on our second CFI -- the original Clang CFI was just too > > clunky for long-term use in Linux, so unless we're going to improve on > > the latest Clang KCFI implementation in some way, it's better to stick > > to exactly byte-for-byte identical results. The KCFI support in Linux > > depends on the arm64 and x86_64 runtimes for catching the traps, and the > > post-processing done (on x86_64) with objtool that prepares the kernel > > for IBT use, and converts to the optional FineIBT CFI mechanism. With > > all those moving parts, there needs to be a very compelling reason to > > have GCC KCFI implementation differ from Clang's. > > > > Hopefully that context helps a little. I'm excited to try out future > > versions! > > Thanks for the context, it makes sense and helped me a lot. :) > > In the next version I'll make the gcc implementation consistent with clang. Hi! Just checking in on this, since there are a lot of interested folks. :) What's the status on the next version (and has anyone been found to tackle the x86 backend part)? Is there anything we can help with? Thanks! -Kees -- Kees Cook