Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp713471pxm; Fri, 25 Feb 2022 18:04:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwF/sj0et6MQw25AVH0DWuKtkYFbHwAjye7EE5tVWWFlX2xClRqFE/xur+fSzeZfUF3tvAp X-Received: by 2002:a17:902:7296:b0:14b:4bc6:e81 with SMTP id d22-20020a170902729600b0014b4bc60e81mr9964167pll.132.1645841044522; Fri, 25 Feb 2022 18:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645841044; cv=none; d=google.com; s=arc-20160816; b=p1DgcMqNhUm01KRIX1ajfsrlnuGaZga61SOr9fnOMQTFvA8AEQYeKvPD8hrvqKpwDC ycQuRERpgOkT/baMMEdVHdiLeLHxCJdv3+2XZu/j2raHvxvBAJXXacr96vSXUcsxuSjz ZZv/IITPemOLrCj3T2qb+91wPszXuta3smAWTdtfS+xeDDAhIfIja5UtIvR8bAOjR8KI lL/w2UO0XhJXBuhmbt0naP87jbPLmUOgi4EmLoShWvog5FUx0jiZdYzqu+6K0SKb5WIz yssSAdc7RsGjuiLLkTy/ZvmJa+C+/g3mx0vr2TOpWmGWffGavLtjrz21Xtp3drzsGoLL AuNw== 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=CjlJlBkP2e+/eFmfCqhPdVWAk3EFsqX+NuJR7ljtW50=; b=iQ7JRv5Tr25qSbh9FdHUvwzubd3k1PepwAvpx4HLgPweN8VthduQhDk+o6DVw752F9 eXqsdFdImxajih21ZrBYewyw7e55VwSuMA2PvQXkvxH6HawQiYziawftRmYS4/1mY6j7 DK+AV/OLRBH8t1dIs2lnKguBACxejWGoK3A9/We9a4RlSaUYBB03rtWB5GYCRQHCKQhO zlWBd5P4+B3egOvrbicIFMkdUDjF/ITf8XtBEOVy2SWRdYc8fkgJSD6GFbyJ8VtttOqJ UIaGQpHbkBam0JFCNYpBCgeB5n2C3jY9O8Xjz0yMT5P9SLVKomFvwgva+Tt+bqkmutZy +Org== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=M3B7HMJm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r6-20020a17090a4dc600b001bc11f9ba1asi8793507pjl.66.2022.02.25.18.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:04:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=M3B7HMJm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8763D527F7; Fri, 25 Feb 2022 17:43:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235037AbiBYXp5 (ORCPT + 99 others); Fri, 25 Feb 2022 18:45:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbiBYXpz (ORCPT ); Fri, 25 Feb 2022 18:45:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 172BA1B7561; Fri, 25 Feb 2022 15:45:23 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id AAE84B833C1; Fri, 25 Feb 2022 23:45:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5AD5C340E7; Fri, 25 Feb 2022 23:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1645832720; bh=NDHUSkypJld5d5CGQR6W7J8F3jQ+Dhc1F620s3ekMVg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=M3B7HMJmt3xObSeYIG/wl8EEhpwltcLfl74Qun9Npta6HKmi1lGd0bjzQTbrl7T7b 961g+Ynw1WYvQ6fMSsP7ryJsEr6+GR1FHEo1VVtT8Vzf+xriyAxgU+8xWecdee4F2e WFr7BqMNe7tbXnbOaopVlZvMs9rr1WyUSSBjyo54= Date: Fri, 25 Feb 2022 15:45:18 -0800 From: Andrew Morton To: Kees Cook Cc: llvm@lists.linux.dev, Marco Elver , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , linux-mm@kvack.org, stable@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Christoph Lameter , Nathan Chancellor , Nick Desaulniers , Daniel Micay , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] mm: Handle ksize() vs __alloc_size by forgetting size Message-Id: <20220225154518.0d1159fdc6f37ee38e39e90c@linux-foundation.org> In-Reply-To: <20220225221625.3531852-1-keescook@chromium.org> References: <20220225221625.3531852-1-keescook@chromium.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, 25 Feb 2022 14:16:25 -0800 Kees Cook wrote: > If ksize() is used on an allocation, the compiler cannot make any > assumptions about its size any more (as hinted by __alloc_size). Force > it to forget. > > One caller was using a container_of() construction that needed to be > worked around. Please, when fixing something do fully explain what that thing is. I, for one, simply cannot understand why this change is being proposed. Especially when proposing a -stable backport! Tell readers what was the end-user impact of the bug. > Link: https://github.com/ClangBuiltLinux/linux/issues/1599 Even that didn't tell me. Is it just a clang warning? Does the kernel post your private keys on reddit then scribble all over your disk drive? I dunno.