Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp352807iob; Wed, 11 May 2022 16:18:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFG2RHLDe4gdtjwUoaoLISZ9bcqYpqyFg6hGRtnAtF+aIhIG7f+v4fgRtB6+yuyQZNUum3 X-Received: by 2002:a17:90b:1d09:b0:1dc:67b8:983f with SMTP id on9-20020a17090b1d0900b001dc67b8983fmr7811351pjb.1.1652311134646; Wed, 11 May 2022 16:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652311134; cv=none; d=google.com; s=arc-20160816; b=DcOTyrw9cbKP08tulSO8RYEjKQ7z38/3NR+ljy6eGc7+mnF+lUNKtb8UgOYTNGCShE Kl8qPK0PnsPA1gxN6DFaD8nW4ZteRiKe8Jah5POsPYltYHvU6xnJ7kqwgf4/VvWCEYQd Q0zxFI7SZLG0yfeywfBgFdy5og0V9j2Hziyns60113EIE7/ptEjHDtlX0Ko2jxy7iOjG EGE8YJnCDX6SCvJRcHMOHiGbSz9yEmAIPglom+yd5N92QPOnPIXgAuXGTUiC59R8NJAs kd2PAJYqAV7gyQYhH8RXCjGGacledyizhLCsN56vqaodh5O5RLSYYT75sAXi5T5UKVxf ZoMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Ag3JfGMB+gFHGBhtZHFcAOTwxJoZx2hjYRGcDKBPnjg=; b=xADtaJvtdtDfJFbSFWTpotQn31pyPrF+2fdakKJEVL+M34D7d7pCE91IBRmFDWtqfF sCYyeoIv+VOYFjczK+9tJPeNu06glSzCDJsJxFiKy6p9lC3jXdd3TV80t2TVIAoVYZMb siVPmiFNGQyv/7kYi1hJlecO11XbgOkMbwngwREX2j8Lnb3BWNptx7ZdSw7NL0QolJye 5K+uPEjI68oRNdcHYFLX0+Qn6JS4RYbcVRAmrnepXKEFWOXH3pKyuWyfgB67z2hkYNvQ 3cxR/yOULHPvzNLFz05mppa0hxfq59u7wbDf+l6S9C96r1dEXAsj7aILfdMP7ESizDBy iPAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I7hFY6qb; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i64-20020a638743000000b003c1eb460705si1295126pge.33.2022.05.11.16.18.42; Wed, 11 May 2022 16:18:54 -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=@kernel.org header.s=k20201202 header.b=I7hFY6qb; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233310AbiEKQYW (ORCPT + 99 others); Wed, 11 May 2022 12:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240020AbiEKQYV (ORCPT ); Wed, 11 May 2022 12:24:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50CF76A42E; Wed, 11 May 2022 09:24:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D974C61C77; Wed, 11 May 2022 16:24:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE4CAC340EE; Wed, 11 May 2022 16:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652286259; bh=41kHDcKCUtsjErhh6LBF6+Fk65WUSvEWpX5q5DpBFig=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=I7hFY6qbCdUXqPiXBiWkDmwm8Fmi5U1mi15yZNMXM8nVcGr4hlgIfj0FQxtoWzbRk D9tEpd942lA+tS1JiDK47eMFx75sV0YYAk2/Ujd1RBJaZXLmM436n0dNd5TXXwckTJ t+xIaKLkAjjZfpex2A483jABfprDO3kqZjaOohTWfLrYtosdvOrloDLdL2M/RvyGkS jcXpPWxWondlP4z/Ujx4Wo0hnv4/4imOqbR7wMIH7CLcZXlYi3jrlJ+VWSjb2fapM5 EJXoLarWaNQAfPhMaycHxcjPUQ45fZyAdX/G0a4yrxhPqMEFmMZdSLLEtdVqHBov4G Q11tSOPraBBOg== Date: Wed, 11 May 2022 09:24:17 -0700 From: Jakub Kicinski To: Kees Cook , Saeed Mahameed , Leon Romanovsky Cc: Eric Dumazet , "David S. Miller" , Paolo Abeni , Coco Li , Tariq Toukan , netdev@vger.kernel.org, linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH] fortify: Provide a memcpy trap door for sharp corners Message-ID: <20220511092417.3c1c60d9@kernel.org> In-Reply-To: <20220511025301.3636666-1-keescook@chromium.org> References: <20220511025301.3636666-1-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, 10 May 2022 19:53:01 -0700 Kees Cook wrote: > As we continue to narrow the scope of what the FORTIFY memcpy() will > accept and build alternative APIs that give the compiler appropriate > visibility into more complex memcpy scenarios, there is a need for > "unfortified" memcpy use in rare cases where combinations of compiler > behaviors, source code layout, etc, result in cases where the stricter > memcpy checks need to be bypassed until appropriate solutions can be > developed (i.e. fix compiler bugs, code refactoring, new API, etc). The > intention is for this to be used only if there's no other reasonable > solution, for its use to include a justification that can be used > to assess future solutions, and for it to be temporary. > > Example usage included, based on analysis and discussion from: > https://lore.kernel.org/netdev/CANn89iLS_2cshtuXPyNUGDPaic=sJiYfvTb_wNLgWrZRyBxZ_g@mail.gmail.com Saeed, ack for taking this in directly? Or do you prefer to take this plus Eric's last BIG TCP patch via your tree?