Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp440279pxj; Thu, 17 Jun 2021 06:19:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4GhThYShVM3dKF5f8PSeUtdRyCMm7/hgWYdUIFmyVtrs/2pH7bTprsuY5AEvyMhqgkxab X-Received: by 2002:a17:906:16cb:: with SMTP id t11mr5146537ejd.112.1623935976648; Thu, 17 Jun 2021 06:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623935976; cv=none; d=google.com; s=arc-20160816; b=hLjj9uRs3M+ko5YdStx15xmSvD1ojXKRcTSu01Tg0nctUTEJNCZ9ZrLzFu4XaOz6an 28zBMNNfYtomWBD2uF8kzGYOtGXzdVv19OwXTAtzAy2+5d4u2EJuQFveZxi+UV50th48 z26Np18IrTm2fWrb6/ZT2dyuGJemDQ6moUpXXTn/jBlzGjBfOLlCwusbzUsPupWJXXdG FYmHwvRprOMGvv8ETKD2zYk95P4pXAG+7b6r2Q6kh398LngiLW+X1DUDNVjwKzkse4RB ROFRrDlSzD8+yvGrJtv1ZPprhRM9+SpBU3B6HQffLknkY9QDkrsg5bENrGaJ8cLIBBb+ cc6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=qIh7qtqYLoeDHxm1Q2maf8EAaSOvbUfxWMPX5UiTUQc=; b=TkoaCaDQLsrAS0qaL1LOAJjCcwvQ2eWJUsyj1gvEyTenn38tIBxMEMNSfPYMvqL4/3 TqDyUid9MmpKVTfnPkfhqVB0iOKvs7VS/CyXQntgJaQQXYM15ZlW92Im7BPpr0kwL4uJ /+pWGewl9pw2hcdb//fq60BsTx9qqh6IvmvaflRZfxZvu5a+8YOlkRDrxPMctuCMYsi5 BzhlYqdVqIyayVs+X7kqHxitpVAYVvMA3seEL7QSd8+w+e20R5ibsvs8ojMMbL7Zwzao QAowO7uZDokl79cJcqeoEuVtNSRQTOUE67L5KeFdnGYG0khYSy5DP4luHam+bvWgGHnW 961w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o26si5402901edv.354.2021.06.17.06.19.10; Thu, 17 Jun 2021 06:19:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231796AbhFQLFv convert rfc822-to-8bit (ORCPT + 99 others); Thu, 17 Jun 2021 07:05:51 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5024 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231704AbhFQLFu (ORCPT ); Thu, 17 Jun 2021 07:05:50 -0400 Received: from dggeme766-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G5JvK686qzXglH; Thu, 17 Jun 2021 18:58:37 +0800 (CST) Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggeme766-chm.china.huawei.com (10.3.19.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 17 Jun 2021 19:03:40 +0800 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.2176.012; Thu, 17 Jun 2021 19:03:40 +0800 From: "Song Bao Hua (Barry Song)" To: Greg KH CC: "andriy.shevchenko@linux.intel.com" , "linux-kernel@vger.kernel.org" , "linux@rasmusvillemoes.dk" , "rafael@kernel.org" , "akpm@linux-foundation.org" , "rdunlap@infradead.org" , "agordeev@linux.ibm.com" , "sbrivio@redhat.com" , "jianpeng.ma@intel.com" , "yury.norov@gmail.com" , "valentin.schneider@arm.com" , "peterz@infradead.org" , "bristot@redhat.com" , "guodong.xu@linaro.org" , tangchengchang , "Zengtao (B)" , yangyicong , "tim.c.chen@linux.intel.com" , "tiantao (H)" , Jonathan Cameron , Linuxarm Subject: RE: [PATCH v4 2/4] topology: use bin_attribute to avoid buff overflow Thread-Topic: [PATCH v4 2/4] topology: use bin_attribute to avoid buff overflow Thread-Index: AQHXY2JrYee8elXzC0+JGLwcUOk3AasXgdSAgACGfnA= Date: Thu, 17 Jun 2021 11:03:40 +0000 Message-ID: References: <20210617101910.13228-1-song.bao.hua@hisilicon.com> <20210617101910.13228-3-song.bao.hua@hisilicon.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.201.234] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Greg KH [mailto:gregkh@linuxfoundation.org] > Sent: Thursday, June 17, 2021 10:56 PM > To: Song Bao Hua (Barry Song) > Cc: andriy.shevchenko@linux.intel.com; linux-kernel@vger.kernel.org; > linux@rasmusvillemoes.dk; rafael@kernel.org; akpm@linux-foundation.org; > rdunlap@infradead.org; agordeev@linux.ibm.com; sbrivio@redhat.com; > jianpeng.ma@intel.com; yury.norov@gmail.com; valentin.schneider@arm.com; > peterz@infradead.org; bristot@redhat.com; guodong.xu@linaro.org; > tangchengchang ; Zengtao (B) > ; yangyicong ; > tim.c.chen@linux.intel.com; tiantao (H) ; Jonathan > Cameron ; Linuxarm > Subject: Re: [PATCH v4 2/4] topology: use bin_attribute to avoid buff overflow > > On Thu, Jun 17, 2021 at 10:19:08PM +1200, Barry Song wrote: > > From: Tian Tao > > > > Reading sys/devices/system/cpu/cpuX/topology/ returns cpu topology. > > However, the size of this file is limited to PAGE_SIZE because of the > > limitation for sysfs attribute. so we use bin_attribute instead of > > attribute to avoid NR_CPUS too big to cause buff overflow. > > > > Link: > https://lore.kernel.org/lkml/20210319041618.14316-2-song.bao.hua@hisilicon > .com/ > > Signed-off-by: Tian Tao > > Reviewed-by: Jonathan Cameron > > Cc: Greg Kroah-Hartman > > Cc: "Rafael J. Wysocki" > > As with the other patch, you have to also sign off on this as well. > Ok. Will add my s-o-b for patch 1-3. > The link is pointing to a v5 of a different patch series, why put that > here? This patchset originated from the discussion of that one in the link tag. Jonathan and me were trying to add a cluster topology level. And that one exposed the problem this patchset is addressing. > > thanks, > > greg k-h Thanks Barry