Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4623261pxu; Tue, 13 Oct 2020 03:08:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvqzbYooYCtw25yCvXRLdN0ut1XKZAtaqSstM1LKkc1a2vkX4C7+U59ekIwaz/dh3ULD+W X-Received: by 2002:a50:ef0a:: with SMTP id m10mr19502299eds.116.1602583737304; Tue, 13 Oct 2020 03:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602583737; cv=none; d=google.com; s=arc-20160816; b=HtHDupiPW9nZhhUEtkJKl4VBguE7Zisa0a9FpPUr6wsHhMxwUX24ECk8ni1/laFZzo BjPC4eyL39mcz2h0PpLkGB45AkzXchgNJiroHGIo1/pNptlqDlL9dUo6S8+ln4qAV2hr RaYlQJDJ4zhwAxebvpf577CD3x2R/R758te0AzbFcsAYfvp54MOVHIkIwIGqsuoeOKdU UOQGX5K17/ReK5bDYlfXWaOZcM4M/56SzXKb3AN5/jealcK3AND0TTctpnCEHYJlCDe9 nNmFFtm9UVRfpAC7MR+xkiHw1fpJvypPLXQ3je0/fuHvY4V3nsXN/peTe8cvNDBjvM4U YU2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=A6mr2GZ0DBJINQQpjmdYC2+OXujmO1pjxp1POyMlL2Y=; b=vn1eJNh+pl40deB7ysVT56V1XQPBYKOmqciyfVcgphZwUUfczBfHD1lDOk2c09a5sO P/Xh3N+tvk7y9bBbH08dQdY7jZPFq5BfTIsZltfkl8bnWOiQL3Uz7vNIJsLXRAbEqX8Y TQG31pSjMvuxeexoD/3qx/zzji3DZCyCKsrL19gr0h2+5tY3uY4g5Qdol7bIegMuXA9f lTLA2a2SurPX6fLeRPugKK6+lE1s360IC3fSUhVV1qYn2dttI9S8yBFMXbhL0Sm4sZA6 PITPtVbmY6f0/SnJnLPqhvffSmeNFedVfsepkisrLuE6bKt/ka4IYtYtO9Ttg4GlCJ+C BA/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="nkPnEYk/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si6533532edx.602.2020.10.13.03.08.34; Tue, 13 Oct 2020 03:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="nkPnEYk/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729142AbgJLUnd (ORCPT + 99 others); Mon, 12 Oct 2020 16:43:33 -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-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