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 X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A28A4C433DF for ; Mon, 12 Oct 2020 20:43:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 499FD2074F for ; Mon, 12 Oct 2020 20:43:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nkPnEYk/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729162AbgJLUne (ORCPT ); Mon, 12 Oct 2020 16:43:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728944AbgJLUnd (ORCPT ); Mon, 12 Oct 2020 16:43:33 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BBC7C0613D0 for ; Mon, 12 Oct 2020 13:43:33 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id v12so2663617ply.12 for ; Mon, 12 Oct 2020 13:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=A6mr2GZ0DBJINQQpjmdYC2+OXujmO1pjxp1POyMlL2Y=; b=nkPnEYk/TLpBpiZhbw9Co0vkESAqfDQdMLbvHaLr/5IjpIdqevfPju7kohqgEo7ksk j9P4eHXHwHse0/oE9MbGn0/vvREbCk0OI8mhvlDRWvcZK/YTrWdc7u0RFoY/0Xiq7owD nfZ04P9MBRZDiskcE9fB7lgt/sSthpVDBiOtE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=A6mr2GZ0DBJINQQpjmdYC2+OXujmO1pjxp1POyMlL2Y=; b=MEQhfzdmrSA32tp8CqfPdLEdkLjvwr3QuD3QqTK4Hw7wTz7Zv1b7FpxCMyMSbZNepo vXXl0BI9WYb/mxZPoVOXKM51uUhKtRMeu3CKJdbL95i5tTJDSJ+ygPPrCmDrmiRP82mC yPueWbCvvCtH/UO9UDcMRUl6R1Avp5RoO33TvrSIDtzyt/Vl0MJgPB/dfyJIDfSlPnEy rYco+Yr2JU4l7Eaq+SLt03jooWwcexzUV63kQCfdWDVHMC/Wfo8Krq1EEsLus5OTuTfM nsJqXOAKaEf3hV3BAyWhrBxoF+voOFuCrmCgeii4P6hiQfLSGlx0HXxcKRwpW5F5WME/ 8s4A== X-Gm-Message-State: AOAM530xO6CqMAAQ7Ir1SHpvmK6IBh9RmKt1AtXVfApiBZfs2UOJ614g 4sTzAsCoiQMy55nkrsq6ppzMFw== X-Google-Smtp-Source: ABdhPJy1Hfs3WCk1tNDDRBB108LnSHEMkiQWQrCzfTBIswhUfzDcCcfAA0yjxRQniPbRDHSo0ZL6TQ== X-Received: by 2002:a17:902:8f82:b029:d4:bf4f:13da with SMTP id z2-20020a1709028f82b02900d4bf4f13damr16441277plo.40.1602535412935; Mon, 12 Oct 2020 13:43:32 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w5sm21123501pgf.61.2020.10.12.13.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 13:43:32 -0700 (PDT) Date: Mon, 12 Oct 2020 13:43:31 -0700 From: Kees Cook To: Christopher Lameter Cc: Andrew Morton , stable@vger.kernel.org, Marco Elver , Jonathan Corbet , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 2/3] mm/slub: Fix redzoning for small allocations Message-ID: <202010121342.836D3C26CF@keescook> References: <20201009195411.4018141-1-keescook@chromium.org> <20201009195411.4018141-3-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 12, 2020 at 08:01:04AM +0000, Christopher Lameter wrote: > On Fri, 9 Oct 2020, Kees Cook wrote: > > > Store the freelist pointer out of line when object_size is smaller than > > sizeof(void *) and redzoning is enabled. > > > > (Note that no caches with such a size are known to exist in the kernel > > currently.) > > Ummm... The smallest allowable cache size is sizeof(void *) as I recall. > > > mm/slab_common.c::kmem_sanity_check() checks the sizes when caches are > created. Ah thank you! Yes, I really thought there was a place where that happened, but I missed it. This patch can be dropped. -- Kees Cook