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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A85DFC433F5 for ; Fri, 25 Feb 2022 23:49:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 27DC48D0002; Fri, 25 Feb 2022 18:49:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 22DC38D0001; Fri, 25 Feb 2022 18:49:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 143618D0002; Fri, 25 Feb 2022 18:49:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 0653A8D0001 for ; Fri, 25 Feb 2022 18:49:20 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C621B60E94 for ; Fri, 25 Feb 2022 23:49:19 +0000 (UTC) X-FDA: 79182946038.13.B0B569F Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf31.hostedemail.com (Postfix) with ESMTP id E1F2020F7A for ; Fri, 25 Feb 2022 23:45:21 +0000 (UTC) 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 EF73261D00; Fri, 25 Feb 2022 23:45:20 +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-Rspamd-Queue-Id: E1F2020F7A X-Stat-Signature: ot3in91agu99y3exmfhmzh9aif1oye44 Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=M3B7HMJm; spf=pass (imf31.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1645832721-808269 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.