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 CBB8BC433EF for ; Mon, 28 Feb 2022 15:16:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67DB28D0002; Mon, 28 Feb 2022 10:16:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 62C848D0001; Mon, 28 Feb 2022 10:16:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 544218D0002; Mon, 28 Feb 2022 10:16:17 -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 46F978D0001 for ; Mon, 28 Feb 2022 10:16:17 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 0E4178150E for ; Mon, 28 Feb 2022 15:16:17 +0000 (UTC) X-FDA: 79192539594.07.9C32247 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by imf22.hostedemail.com (Postfix) with ESMTP id 9DAD4C000B for ; Mon, 28 Feb 2022 15:16:16 +0000 (UTC) Received: by mail-ot1-f51.google.com with SMTP id g6-20020a9d6486000000b005acf9a0b644so9715693otl.12 for ; Mon, 28 Feb 2022 07:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3erX1W/V8eKoqrAyYmfugbwLeZekQvkkVtHUA9NIwMk=; b=drpj1huI2zUtT9Wxsj1mWTLeR7td9jWzGtULueocDG5ZY8vkEnbQe+F9SxynenJPt9 1YQxDabJkCDr9VRQRt+LIJ+ge7VwvhZRjkVtgccg8gg1LRTeEDZgCj/PK6o3zVxFqXSR IBubXJps1jrO7uwOlTm8tEda55t/VFR/omtiacO+Guj67wxrRfLIWSQuLJpafmaQRxM1 MAAXm47q36VY3tKbW3bqVQY7pd89RN4ie8+Uw2s8ANxcipLCuNiptwD/uNMZZn2VwtpJ LM8YL9V9dzV97ahyiSPKTl6/TaeCbzxCj3cixXfjOrquBp3Q07y1oWvU/vmxBJg/U9Dg 5QtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3erX1W/V8eKoqrAyYmfugbwLeZekQvkkVtHUA9NIwMk=; b=YBtrg8UOC2rME10xLZc/hZmo4kytYM+4seFV0YRhF/NAveR6KJVKvnCfIfNKEtWB1l km50r07+cC77Y7CnaBZDGGeWZQHfxRzCyld3Nb36TI3v6oHJor56gBhzUGugfv5xWoK9 m1jGSVSocDmxu+GdYrLkENilx3mL7u+6m1QfX7ebPI8O/BuN78yml2oDv88dAlJJTfEp mcaq/0TRVKK1yh7NyDqitlO2HTAxMOudmzdaXYouVXzm+Q7A8eh0+6v2yQvopRPpJHLt o8Ts5XPF9Whd4AAs1MXNyfBOINT6GFHGvVeaIZ3XMrgYzWqg2HmeWnp3hXeI+qyDpCcS neig== X-Gm-Message-State: AOAM5314fTH3gsBLL8xHg/+zljUQFi2ofshtNUhQAmvtx3JbcSxAaP/j gLmg5qczfNcI300s+JHkLKUWEyE9jha8Z2yDLvo= X-Google-Smtp-Source: ABdhPJx9TTxxLNEwF+4nqK17T9MfrZryYcQnu8nF9wuFdmJwPKwtyAsHwaCtK/g+ns54aBxeRErB7ut9nPOPqMIGnK0= X-Received: by 2002:a9d:7096:0:b0:5ad:ebf7:a225 with SMTP id l22-20020a9d7096000000b005adebf7a225mr9336023otj.370.1646061375645; Mon, 28 Feb 2022 07:16:15 -0800 (PST) MIME-Version: 1.0 References: <20220225221625.3531852-1-keescook@chromium.org> In-Reply-To: From: Daniel Micay Date: Mon, 28 Feb 2022 10:15:59 -0500 Message-ID: Subject: Re: [PATCH] mm: Handle ksize() vs __alloc_size by forgetting size To: Marco Elver Cc: Kees Cook , llvm@lists.linux.dev, Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , linux-mm@kvack.org, stable@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Christoph Lameter , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 9DAD4C000B X-Stat-Signature: xg37poais6je9374zpkwkrcmxfnh6jt6 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=drpj1huI; spf=pass (imf22.hostedemail.com: domain of danielmicay@gmail.com designates 209.85.210.51 as permitted sender) smtp.mailfrom=danielmicay@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1646061376-34544 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: Looked through them and nearly all seem easy to replace. By the way, the call to ksize in arch/x86/kernel/cpu/microcode/amd.c doesn't look right. It allocates the memory with kmemdup. I don't see how it can assume that the padding is zero, and that seems to be a requirement since it zeroes the destination before copying to it. Seems far more reasonable to add a field with the size.