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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45BD0C6FA86 for ; Fri, 23 Sep 2022 18:50:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232557AbiIWSum (ORCPT ); Fri, 23 Sep 2022 14:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbiIWSul (ORCPT ); Fri, 23 Sep 2022 14:50:41 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A33120BF7 for ; Fri, 23 Sep 2022 11:50:39 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id s26so1039592pgv.7 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=sIIgpoesvsLeoH7NPOx2wIPVPRzc0ha9CPZaRVoTwWNwpGtw1Nso0CuYcsgmPiCded mJH89Pq/SkKJLVyYHrpLU/5wdygWswbhdrPv3NIEGgB3UEFLasICgYzxLJKzmr1YUf3j RYqTNRxA4z9WWU92APWjznOUhlzsFcgxUgk/Q/dSw7dwPiTgxk+Kt0G6nouFPssnD6a0 /+rAJZmKj0u052aNIUqsCnv3zfmXPkN8jviksxP6+l2VcvuV3EYWvR2cNgAgxAl7G7ov QkEa0McOs3RyjfEJRfPPyFWax7o+ojXD2+3mH/B/tL/lreIExNNne7Z1gMA2+fltlq/C sEMw== X-Gm-Message-State: ACrzQf0+aubvngSGVGb+hmRsxZwRLmr0FTvzRb0PSMGn0OF96XxK7dAe eWQqritAnHs4k8uBJCrs72af2g== X-Google-Smtp-Source: AMsMyM5BOkxT7dmLhP+9f8RXqZTh1AjF61zhu3wqGKFHMmPuMGgEdboAX7cqSq5H5AVVbN7wJUrI2g== 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: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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