Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp442612pxb; Fri, 15 Apr 2022 03:20:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdcQR0oM7nYeD7rHKGAWplyDQS16oTyyo3eq0wOXRf/Fxdkc9N0HtgM2hgBUtEBP2EKoqD X-Received: by 2002:a63:78f:0:b0:39e:11d0:daa4 with SMTP id 137-20020a63078f000000b0039e11d0daa4mr5926644pgh.36.1650018052815; Fri, 15 Apr 2022 03:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650018052; cv=none; d=google.com; s=arc-20160816; b=bZpqZYjM552AtK1n5+NdSTBejQH485UuuBgx8PX50AiHUbT5g3s/lGUSx8eHrGFbzQ bO8/A92BLbDX83mYOwhJ7ldbeTE4GQyf5tkFYBS6GwhwM5ruQN2ZH5ZQDQF7eoek7hrq FRGaHTY0IL1ImkJ0zqej/4wMku5XaWftgYFZ766ZIdcJDQuilqq9+boAiX3sJzPh1Bt9 zvJZ8T+WZrkINFMi3mnZ+3t75LqkWqveeATPwY0Wq7sYOuGJqXgVBCnO2KOuEVQybolH 4E3foS0FKuMpTy1xseVKMSx5/tOdB/yDHoqRCm/pL5k8Oe57PzGJBXACfZM4I9J7mlz/ oSLA== 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=I4Ax15jC8NnVZwecST708pDmHH3endbmV/A+QAcQDXk=; b=d+Ab1VDsIkPT7bOeuXNz6GVFBt0HYetAAjx+mt+YDKtjbNlOCnD+2McCFvdkEW53fM xIa3+nA6gWUEcurufPBpr+CHcXDWDyeaF55F5uaYroEjhWSRuxqC14MCRhRRR/TwSRBt M1hM2RCrqVxpSp0QPo5+SQJ/AAiY/bznGseT4Ez0KfnrhtJESFgdpDE4x4wwUlJvrjFw HkmYCJ0I19/qKWOfo8vBAE5nJybyQhRwXOqJVZ7kSPt34tOfYQ9sRe/wINzRhwFRArHv wMKbnnlx2EzXy11SRMGzSTGcjtfWATB/xhy+OWirh+u8Rv0Jk+Hbt/iKVgrcYcXvVP0E c2Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VTKGC4GU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l133-20020a633e8b000000b0039d678a64e2si1096050pga.232.2022.04.15.03.20.39; Fri, 15 Apr 2022 03:20:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@gmail.com header.s=20210112 header.b=VTKGC4GU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242763AbiDNLt2 (ORCPT + 99 others); Thu, 14 Apr 2022 07:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbiDNLt0 (ORCPT ); Thu, 14 Apr 2022 07:49:26 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C4013CA55 for ; Thu, 14 Apr 2022 04:47:02 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id mm4-20020a17090b358400b001cb93d8b137so9077467pjb.2 for ; Thu, 14 Apr 2022 04:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=I4Ax15jC8NnVZwecST708pDmHH3endbmV/A+QAcQDXk=; b=VTKGC4GU/h3jcWzqni4siu6RzvhvBschAcPdHBRc9lvYS1SrLmAs6BsOib0sOOC9n9 mPAvQhcYfa/SaI3Vy2SUKGJTBOWljBuEvQuqxIAS+PIYLjY+DJBtcExbtVRxxottNg22 W2fZJthM/suuUQTulb1/oCvYpDRXsmSrysTzxtK9gwzlz3hSm10tb0AcvNa2lyCC6vpd diZX7L4Ti6YA0P9RvIPxXpfBaxn0uqV0MLAwtWvyWcvEA1ARVvCZKziZUsYALiZBo3Kz h8LarTqCDePq0UgHtwIQ1s/lLxD2pnWwf2JVUpGgDtIQ6XlQ0+TQDIyHXOdLc4Q+d9MB Uruw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=I4Ax15jC8NnVZwecST708pDmHH3endbmV/A+QAcQDXk=; b=Ufhx5t0ttipVf6RoEfZ23Qz/2jnvFQmBlCdxg/sdQVyzJ2GROIhTvbKWIjbRm6sFw0 Ik191hCIxVgE6UwqyG/Lhc2kQ1xPVltUaMjSKu314z1GYTvIcECZe+TUUNp0DfifpcTI qdewfod0HOxlqSV70YZOIpyRClMghIrpJZMGk3mJU4PTb/DmRT3pvPZdLXDdRiS/IXMw eIL+CA0ENT6vIA+4SUw5aS1vPPAQJeGSq0EB+2ANTsJfrvC6J933G7nF4cgZGqBidkTL FmFcaTUzUHWsBEAEXml5SfqsJbiT4mN7MB/gJKTI9YomnIJ/MdCb7bUZfw/F+I6HXb0U eJUg== X-Gm-Message-State: AOAM53240cnICQjjTryhu2I6DwfxXVVbZLPffn8eyY60lfoBO9Af1iHl tuxYWQo/RVFD7egbh4nkSTs= X-Received: by 2002:a17:90a:fac:b0:1ca:5eb8:f3b2 with SMTP id 41-20020a17090a0fac00b001ca5eb8f3b2mr3340533pjz.37.1649936822021; Thu, 14 Apr 2022 04:47:02 -0700 (PDT) Received: from hyeyoo ([114.29.24.243]) by smtp.gmail.com with ESMTPSA id g15-20020aa7818f000000b00505ce2e4640sm1959117pfi.100.2022.04.14.04.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 04:47:00 -0700 (PDT) Date: Thu, 14 Apr 2022 20:46:54 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Christoph Lameter Cc: Vlastimil Babka , Marco Elver , Matthew WilCox , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 23/23] mm/sl[au]b: check if large object is valid in __ksize() Message-ID: References: <20220414085727.643099-1-42.hyeyoo@gmail.com> <20220414085727.643099-24-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org On Thu, Apr 14, 2022 at 11:58:01AM +0200, Christoph Lameter wrote: > On Thu, 14 Apr 2022, Hyeonggon Yoo wrote: > > > If address of large object is not beginning of folio or size of > > the folio is too small, it must be invalid. Return zero in such cases. > > This looks like a slab usage error on the part of the caller that would > benefit from a kernel log entry. A warning or an error? I think a WARN_ON() would be sufficient. here, will do in v3. Thanks! -- Thanks, Hyeonggon