Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3019897rwi; Tue, 1 Nov 2022 14:57:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4MSF0TfIl9wjfgemnDNVmB/ZBaiU8Jwi3T9ew5fJsvPt+WjxZzjrTH05tks1YG1xS4c18/ X-Received: by 2002:a17:902:b101:b0:186:7067:3ea3 with SMTP id q1-20020a170902b10100b0018670673ea3mr21778338plr.59.1667339832252; Tue, 01 Nov 2022 14:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667339832; cv=none; d=google.com; s=arc-20160816; b=wSga5FoQLw1AlczUVR2AqcxEiRYFPfyVFNb5xjG8bdmbvK41u8AO8F5nyngbBFK6w8 DYQZq1QibSbsz0uRzIlQIdCr8b2aNpVzBjGzReGiFpZB2xhfqxL15s0iGAnSHexVGSZY 2i3iornSX5coWffqpBrsyX3zjQewPQoWyijs5iZPP/M+b228GpdyF0jQmmAQzSDiSqWZ mqP4ZvJfnpbtzxPw1M9mZFieKuFrqPvTa+W9MOfZlzJvJoL/d5PKYCdStN/tboPmOC1l 9uNVxMLv0/ekNAEa5RJzdhNtExid4y4OpWdN+eV/b1uYYgYGk/xYWMN3jzsk/QFN8aYe L74w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=siwkIyyuZG4xeCnv0VHeDjVH84W8UaMBkojoiy/guyY=; b=S70q6gJdElDVXcpmhdsfB08Wl7Mv+TjdH5+S8C41DZuUtEwfYFTJGRUu39OQ0ee+hZ z/SHJTgooYbMw1peTTp6ZTYzODydxFe2WnFoykiRolp+wSapR7K6TY/X3cl1/UKOuSnH ih+nCdGsZirOWJk6cp4xPW7las7ekF8l5MxTkwJV1TFqC2BvgWAkzjmYSPQksj8YbLF/ Hb9wzC2USkDVdVkv76o81UJhwjAcgCAmdfokeA3QeavU1hY8zGdbojnLhcblmaeN1Ynf ECrK1B+itQnIEaP/bV6XAtQG8u5SG6OHD0eR5yqm5pMOS9ux0uQB8VuyPvdbCIxOaVR2 m7HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YF5jK69c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y21-20020a056a00191500b00565d37ee1casi13734679pfi.166.2022.11.01.14.56.59; Tue, 01 Nov 2022 14:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YF5jK69c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230208AbiKAVkC (ORCPT + 97 others); Tue, 1 Nov 2022 17:40:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbiKAVkA (ORCPT ); Tue, 1 Nov 2022 17:40:00 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26D0F1CB13 for ; Tue, 1 Nov 2022 14:39:59 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id m6so14698670pfb.0 for ; Tue, 01 Nov 2022 14:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=siwkIyyuZG4xeCnv0VHeDjVH84W8UaMBkojoiy/guyY=; b=YF5jK69caQWmV8rcz8CcyGGg1pBFJHi5clEcGtY4Tsu88X8eF45VcArWfaq3qhBmus 1VbOOCvBkQ1jmI/01o3/YQ2r38jr/IdGypjkEoMSLitJgzkmt4h70HcXtrIlu7iJdT/i HWl8GvMcWBVfbvqZIXyAPQT45jDdNWrweF8Ho= 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:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=siwkIyyuZG4xeCnv0VHeDjVH84W8UaMBkojoiy/guyY=; b=0CEtCRXbxRslp1zb4C6O4SsuqgBIfBkggbwvGeESwS++cU1ajLvCaMAv+p3ZtIB37a kQ5V6ZSwQuoTHNUrO0njhk+g1LTUGhQlvC27SixmrX2p3CApZyc8xxu+mrfFX5l6o0c+ WbIM5dBdqhDVbuKFDAhvJgiWktLr+0qxGRr0Qo6f8WD1Hp7nw5HZpRjKb+DdsuyXLfiv 0VytSLQ/tT238Fyo/tK3xwPFavW9YRwHh61gWZSgZ+qOET68hc6Rygdn/O5zeBbT8PrH bImPgb3PUwhaIiNdibQV9iSyB/WhQWTfde8OhQW1QQPCmK/fXskc+DyUCRfAE5noAOXL et8g== X-Gm-Message-State: ACrzQf0qu2TW2x+UK7dQgMYubhOQcP6Fl6GEGENJw6xy6fsgvciVibpd TO04LDfRTxH/LukBlwjZoyQl5Q== X-Received: by 2002:a63:1612:0:b0:461:4180:d88b with SMTP id w18-20020a631612000000b004614180d88bmr19284053pgl.434.1667338798650; Tue, 01 Nov 2022 14:39:58 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id g5-20020aa79f05000000b0056d1fdcde75sm6872796pfr.170.2022.11.01.14.39.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 14:39:58 -0700 (PDT) Date: Tue, 1 Nov 2022 14:39:57 -0700 From: Kees Cook To: Joao Moreira Cc: Peter Zijlstra , x86@kernel.org, Sami Tolvanen , linux-kernel@vger.kernel.org, Mark Rutland , Josh Poimboeuf Subject: Re: [PATCH] x86/ibt: Implement FineIBT Message-ID: <202211011437.F82B61B8C@keescook> References: <202210181020.79AF7F7@keescook> <202210182218.56AD2871@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 31, 2022 at 12:13:50PM -0700, Joao Moreira wrote: > On 2022-10-18 22:19, Kees Cook wrote: > > On Tue, Oct 18, 2022 at 09:48:42PM -0700, Joao Moreira wrote: > > > > > Is it useful to get the compiler to emit 0xcc with > > > > > -fpatchable-function-entry under any circumstance? I can probably > > > > > change > > > > > that quickly if needed/useful. > > > > > > > > Having it emit 0xcc for the bytes in front of the symbol might be > > > > interesting. It would mean a few kernel changes, but nothing too hard. > > Should I push for this within clang? I have the patch semi-ready (below) and > would have some cycles this week for polishing it. Sure! While the NOP vs CC issue isn't very interesting when IBT is available, it's nice for non-IBT to make attackers have to target addresses precisely. If it's really invasive or hard to maintain in Clang (or objtool), then I'd say leave it as-is. -- Kees Cook