Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4893020rdb; Fri, 15 Sep 2023 16:07:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7ApHWGZO4DRRGPOGyWVwWeSD/6Q2ZKGarSYRr2Bz4THISD4EiCspspFH+ZZlXrH5gszio X-Received: by 2002:a05:6a00:b8e:b0:68f:fa41:4e92 with SMTP id g14-20020a056a000b8e00b0068ffa414e92mr3511986pfj.1.1694819261997; Fri, 15 Sep 2023 16:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694819261; cv=none; d=google.com; s=arc-20160816; b=B5h19nu2nZUJtY4L5DM/63RsLt0qGs56m3SPBahzYYWyQ/V398XDpMzaCpQRytAR+K puSM6aadNakjZ/MwwDPAud2V74oEWM459tCoE4R4PwhMUXhQcjgmDZRUJ32UWySN3baY rmCsLt9kH0PuMOorrsEo7z/UWjFYocEoK6EABq4samMDFgUBxXYHg1TDRniZNCvUITzT a4Nlgn+rlHIxU0loCA6680GQJcdIa8oB19txLTZ5F7sw7t3iKuLJwOZ4wMHzBa5Ry/fD 1nzjjhm1tU7LxSWFz0dCmydtn9jflfEtn34RZA++oxaSHlRK+USRDYkNEGi3+j1jmG+G USwg== 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=APHJKdyAi/Un1XPHZn1Z1pQZW4vCCHalitDLmyiouTQ=; fh=jqyVLh6bCUdwF76+d1nSsH9gan5yVpKFn6DRJJLnHtk=; b=WFddFh3vRL/LR2jb685Vj4zvGZCLPUbTZuIK3C1iF4Tw9aNXTtHX2A6zXZTV78UCgv 2/6oYF8UZH/1/9+UrIGJxZwn9LqoQ57RXzgBfYMIpQdW4MLduFFMXAGvSVuUZs64IRhM m1NnrcBnyJPrpsuehh9vOgZJJg8+A2KLn0QoMgEL5ouagB970lbIbJ+K2z9lM93SfFu4 GXvN6bKONxjuPCc/8YnTfEbcelGjt7c2d8T17usr+2JWqGA+vi+MD266sgH85dyqvUDh 6YBawvnDvgrFfa8F3stGaCiC14gmTSHmr1jq7jKoIU51wFluNr7Xf6lSPYwY1QI6Qc0W YyKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dx8DPTvb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ce7-20020a056a002a0700b0068e2d888713si3882526pfb.167.2023.09.15.16.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 16:07:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dx8DPTvb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A390D80B19B5; Fri, 15 Sep 2023 14:04:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237613AbjIOVEE (ORCPT + 99 others); Fri, 15 Sep 2023 17:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237753AbjIOVDj (ORCPT ); Fri, 15 Sep 2023 17:03:39 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBFFD1A5 for ; Fri, 15 Sep 2023 14:03:23 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68fc081cd46so2481526b3a.0 for ; Fri, 15 Sep 2023 14:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1694811803; x=1695416603; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=APHJKdyAi/Un1XPHZn1Z1pQZW4vCCHalitDLmyiouTQ=; b=dx8DPTvbuSlh9TpzZol3/Gyx4GRxRBcPwEjUuOrFdZrrcIkqYUyXgAfBmgY4WsF03M hPSwrZPbIXM6+8W2CTfEJ/r3EcWQ8DnB2VTdZ8+5HDZ62Fj5w4nHKOruLoJ9uNXREkya nkJnIDPHkznSwrax0w/JCkGyXb1kCiTaYYts4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694811803; x=1695416603; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=APHJKdyAi/Un1XPHZn1Z1pQZW4vCCHalitDLmyiouTQ=; b=q0HV7s4noxs4uXbyft7ph8Ci+YGSv5BwhGS9kLhHNtTvC/fSa4KO4VkJUd870oxYsU 7f2AxKVLZ+AKNaX2rQxp2Od7rw6vg+2wudVAX/w/b5uWIS/EA5em3ggYBvEXdzoTSguH sBXUvO1zEi3hQE9T+UbIXaHeSlTK7qv08lf8cKTuPUnvvUsfsHfFojxBFb4nAeryQVpF 8JgDB2pg9im1NFp+YRZ/wqONR1s+tBDfmCNHX1ngYH7i2lPrIryufEBQWEJX9gjgo3TQ x3S8buuIvqM79y/A3o5+PVZ80ewFQ8nX1j+gwthbymd01ojqxLy+tg71ylZUYNnlnAaQ Le8w== X-Gm-Message-State: AOJu0YyY1epgu2V9XAkiAtURGxRcJ6Cn/p7tMnUZOqU9Rg2PYf0R9Ntk SmrX8V/h4DXlcY7Fs/QS4f2vPGZNWe1/qLkaBSF74Q== X-Received: by 2002:a05:6a20:320d:b0:14b:8023:33c8 with SMTP id hl13-20020a056a20320d00b0014b802333c8mr2834160pzc.2.1694811803227; Fri, 15 Sep 2023 14:03:23 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id bv6-20020a632e06000000b0056001f43726sm3098867pgb.92.2023.09.15.14.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 14:03:22 -0700 (PDT) Date: Fri, 15 Sep 2023 14:03:22 -0700 From: Kees Cook To: Matteo Rizzo Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, corbet@lwn.net, luto@kernel.org, peterz@infradead.org, jannh@google.com, evn@google.com, poprdi@google.com, jordyzomer@google.com Subject: Re: [RFC PATCH 06/14] mm/slub: pass additional args to alloc_slab_page Message-ID: <202309151403.49D5C3CB@keescook> References: <20230915105933.495735-1-matteorizzo@google.com> <20230915105933.495735-7-matteorizzo@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230915105933.495735-7-matteorizzo@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 15 Sep 2023 14:04:35 -0700 (PDT) On Fri, Sep 15, 2023 at 10:59:25AM +0000, Matteo Rizzo wrote: > From: Jann Horn > > This is refactoring in preparation for SLAB_VIRTUAL. > > The implementation of SLAB_VIRTUAL needs access to struct kmem_cache in > alloc_slab_page in order to take unused slabs from the slab freelist, > which is per-cache. > > In addition to that it passes two different sets of GFP flags. > meta_gfp_flags is used for the memory backing the metadata region and > page tables, and gfp_flags for the data memory. > > Signed-off-by: Jann Horn Reviewed-by: Kees Cook -- Kees Cook