Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1394110rwb; Fri, 23 Sep 2022 12:01:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6olawg0u8e8rHKxH0nk4DXo7n3Blqq+4viOn+leO3kvkINn5v95JZfVbz7R+PFKMu2wM90 X-Received: by 2002:a05:6402:510f:b0:451:624f:2f02 with SMTP id m15-20020a056402510f00b00451624f2f02mr9900698edd.40.1663959679264; Fri, 23 Sep 2022 12:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663959679; cv=none; d=google.com; s=arc-20160816; b=K0qVWKrQsEriXqm71pck/dWDYTTzWXq73I6n8eiBxe8cH7qc8zL5CC5QmlXTQMoY6/ dzY/9+NhYmNFX0IbEY8XZh3WY0BceSyDISvaOSeNB2FSfmyfEKi39ZpHP+ZkNrhwN3Vx vp4Gtu9fr+iLsfwosaYysktjHG/W9j+EzSiJ7N6Nyte7TofAJsL5ZLMEbyf49MNb00We rLPdOeVbFoJ6CStIdhayAZxSM7JXMVN3vLVu2BA1phKd01IhqVLCE+bk65TAPxqZSBNw wFFRsTAQJJpHGIR21FAflE4b3tYvGcSSJgHEEW/GoTEqsjoH+Xu1CkNanJ8o1wnm2ktH 5YVg== 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=soz+B5vr0YawBrGLCJUIfst1rVPegj/kO945i6tNuu4=; b=Mgyelo4Vpxb/3E8m7ZGXuHpGlS/GPqIk8emZF+Lr/EU0CngLqkq84zWuVstlqqDCTz +rX9fG4hPZWjwOGF2w7NI1GUKmIsAwcY6gcA1voplveYuywkasCIIv5rZeCtf315MDId 7JVD7sPa8DYVNu44ZMqIyh0kjDMx6LLj6t5+3tqXJp/fjsWfgEwiQ1fUKVBHVz7oSpxI MZvzeUs3qRHmavBgupWFz9gJYADxL9CwveGlXTKYlvbRYnKLOBlZ9XazUo1+4Fa5jCoT 4Rw0CVXjv8VhfmKdakfLXto9X/ePSQdVhmbPIMT8EkwlMbahtK5DYOTdm/Ow4ZCf6Qwh qhMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OTfy5Nwp; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs38-20020a1709072d2600b0077fd6028710si8644751ejc.670.2022.09.23.12.00.57; Fri, 23 Sep 2022 12:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OTfy5Nwp; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S232226AbiIWSuo (ORCPT + 62 others); Fri, 23 Sep 2022 14:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232066AbiIWSum (ORCPT ); Fri, 23 Sep 2022 14:50:42 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81F08120BF9 for ; Fri, 23 Sep 2022 11:50:39 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id t70so1051261pgc.5 for ; Fri, 23 Sep 2022 11:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=soz+B5vr0YawBrGLCJUIfst1rVPegj/kO945i6tNuu4=; b=OTfy5Nwpn08IcUaVlU1KJ27X+N3yWZ/VpCrAZjSpjUbsjTe/slddbrLCSNWyrUEUf+ hKFo3f2nFf90BAG6jEHb+7lo8EJfEwNPirhgwBNLji96jC6KqEyl6t0+uMZVhfPqRt/6 nRku1i36Slqm6llnH2++9t4exlSoETdRFUkh0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=soz+B5vr0YawBrGLCJUIfst1rVPegj/kO945i6tNuu4=; b=Tl7p5X4YjNs+Ys6TWk+v8oxvo/3fj+iDcaR6iADGyj22GILRPrS7RX8LO1CAJZs6km 7RRbA9lBD2XXWjWtLNGYC5TtwpPrlfW2IzjpusJyiOI9WLEiqn2wI1K6m3RQGLddfNfv L6Z6rw/T1UBtBM92J9wZFSybV67imS+X22uyrz+7tIgrEGtkUQinny/IdZRLQFDeAPr5 YG+4Uy4rWShk7MNZIJjnB1vzjLyp6xUPfhfOVvb2ysIm5DJ8vJfYnt51yhuhEyPKWN9H ByvFO/ZK4UxpWs303HDXg/8ZNgOGucnK0IVyFpfIoLQqqGMUnM0Zh7wz25PzddBBmrM9 bfcg== X-Gm-Message-State: ACrzQf2SyVAMLg6X2mY8XRanyQnvIk1Lkl0y79oOsex8IDA4qoZRUPCM jl3tbdmfvszq3kZ1u9+JN+uYBA== X-Received: by 2002:a63:6a47:0:b0:439:be00:7607 with SMTP id f68-20020a636a47000000b00439be007607mr8719395pgc.301.1663959039042; Fri, 23 Sep 2022 11:50:39 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f13-20020a170902ce8d00b0016dc6279ab7sm6423837plg.149.2022.09.23.11.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 11:50:38 -0700 (PDT) Date: Fri, 23 Sep 2022 11:50:37 -0700 From: Kees Cook To: Feng Tang , Vlastimil Babka Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , "linux-mm@kvack.org" , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Greg Kroah-Hartman , Nick Desaulniers , Alex Elder , Josef Bacik , David Sterba , Sumit Semwal , Christian K??nig , "Brandeburg, Jesse" , Daniel Micay , Yonghong Song , Marco Elver , Miguel Ojeda , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-btrfs@vger.kernel.org" , "linux-media@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linaro-mm-sig@lists.linaro.org" , "linux-fsdevel@vger.kernel.org" , "intel-wired-lan@lists.osuosl.org" , "dev@openvswitch.org" , "x86@kernel.org" , "linux-wireless@vger.kernel.org" , "llvm@lists.linux.dev" , "linux-hardening@vger.kernel.org" Subject: Re: [PATCH 01/12] slab: Introduce kmalloc_size_roundup() Message-ID: <202209231145.7654767ED5@keescook> References: <20220922031013.2150682-1-keescook@chromium.org> <20220922031013.2150682-2-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, Sep 23, 2022 at 09:17:25AM +0800, Feng Tang wrote: > On Thu, Sep 22, 2022 at 07:12:21PM +0800, Hyeonggon Yoo wrote: > > On Wed, Sep 21, 2022 at 08:10:02PM -0700, Kees Cook wrote: > > > [...] > > > Introduce kmalloc_size_roundup(), to serve this function so we can start > > > replacing the "anticipatory resizing" uses of ksize(). > > [...] > > > > This looks okay. > > [...] > > Cc-ing Feng Tang who may welcome this series ;) > > Indeed! This will help our work of extending slub redzone check, > as we also ran into some trouble with ksize() users when extending > the redzone support to this extra allocated space than requested > size [1], and have to disable the redzone sanity for all ksize() > users [2]. > > [1]. https://lore.kernel.org/lkml/20220719134503.GA56558@shbuild999.sh.intel.com/ > [2]. https://lore.kernel.org/lkml/20220913065423.520159-5-feng.tang@intel.com/ Thanks for the feedback! I'll send my v2 series -- I'm hoping at least this patch can land in v6.1 so the various other patches would be clear to land via their separate trees, etc. -- Kees Cook