From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93D002F23 for ; Fri, 23 Sep 2022 18:50:39 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id b5so1043689pgb.6 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=TFnpC1Nmt8JEQDSIRHgt0OZdjg6auX7wGb/QYZ6SqdjDXI9EWKHvj5Xmsx0IAkhSa8 +GEoWKS+SJXevixYWweU9lTfagVTWuwoMZXlOFpSyk4bytKZ9e3DYP6/0HxSM5WLwgoN 2o3pQ/+6NJRzATon327GxozpD2t1ZAUPEhUcMRk0gvQ4RqwF7K9AjuyN9y9RP5S/r0NJ AyPoHbx3B2zMlRBF3TeNA9QH1JEGfQ2/RiGbqPF9IpD48rzQiOBTrQCyxcPEQz2SgSO3 fpyjRCcnhCkL+2pv2+EoY/9s/Kx8Nv/DfBJVYhlEJeWQfhI9QwdJoEkucjpbaLFyhfxw pHyw== X-Gm-Message-State: ACrzQf3gmbvYoEbms2hukCu3qzwofrSdqf44ykCYWcHpgC75B04n+JXi Lg/VPhQH1tkcWfEg6j69rNyD5w== 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> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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