Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3750549pxv; Mon, 19 Jul 2021 07:56:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP1ruVTweuPEuX0v8FbbZTf0nxYqhfqMrOkROul6g1mizMsXqFGyszgKLTNikuqxeiCgJv X-Received: by 2002:a05:6402:503:: with SMTP id m3mr34997962edv.183.1626706583098; Mon, 19 Jul 2021 07:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626706583; cv=none; d=google.com; s=arc-20160816; b=MnC+F8z6MuoQmwhAgF40zp2Y+Z2rxT5rkQp/LqlN3qLIExkQqRoAzisFnXCrjHqqIP qkEztf8zxdH518x19f/fgdJ3LgbgecUyhGhC8GACAn8moMATcsSHyXpP8N9WyBXQmFSP +7mi0NLYxj5TRYcrBJI+Dnk8jTIs7lAb3BLF6Zm/VtjBonbjNgElSrFi/xlBbsvt1Vs/ UsBwtrhLppNBDk+Sl/m2tEgdtpUm3AY9VER6lE1ma9A2cHy5geaNiwt1pwfsEFZncHsq g+1ygxVB92N6XsT4crwrBFy7Mn6T/Xb7JxB/WvipHvZakyXlFzQUBluBKfosVxtIOZGW ttqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=y6xezeTMD3uM9dWsmPafXCPZZUhKqeP8Z5G3cW2y8KE=; b=oXlENfrYFydsrZFNPpCNJ9l1EYUfk3rBEuktQvE+ncTpcyF2AC+yrT1sLAam56VbH6 wbPWOTaRbhiJ0ays1siISvB8tDg3BPg6VsUAIxRvhm9718jX4BnnsTMYCSchRRvLDrgB hA/E/ReliobOfjDJy6C+e7zd3SeZvO/7aQiBBBtR1DeLSlpvtCPWPPNBOA6hkM32K03E +ndBuLsKEb55uTdw+HOWmkQ2fp0fFnktCCIpGXxEV9guWadMhuL/8vythcS8sMSd9OcU IwN1ARjXEiqcJ69q2etjDJtqd7iehYnsuytB0ltCX6DJWZReT9jBHI6UEWa2rSegwWnx P2Bg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si21408908edv.295.2021.07.19.07.56.00; Mon, 19 Jul 2021 07:56:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239395AbhGSOO0 (ORCPT + 99 others); Mon, 19 Jul 2021 10:14:26 -0400 Received: from mx.socionext.com ([202.248.49.38]:2017 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232228AbhGSOOZ (ORCPT ); Mon, 19 Jul 2021 10:14:25 -0400 Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 19 Jul 2021 23:55:04 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id 62CCB2022041; Mon, 19 Jul 2021 23:55:04 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Mon, 19 Jul 2021 23:55:04 +0900 Received: from yuzu2.css.socionext.com (yuzu2 [172.31.9.57]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 310B4B631E; Mon, 19 Jul 2021 23:55:04 +0900 (JST) Received: from [10.212.31.132] (unknown [10.212.31.132]) by yuzu2.css.socionext.com (Postfix) with ESMTP id A64B0B1D52; Mon, 19 Jul 2021 23:54:55 +0900 (JST) Subject: Re: [PATCH] PCI: endpoint: Use sysfs_emit() in "show" functions To: =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= Cc: Kishon Vijay Abraham I , Lorenzo Pieralisi , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org References: <1626662666-15798-1-git-send-email-hayashi.kunihiko@socionext.com> <20210719034313.GA274232@rocinante> From: Kunihiko Hayashi Message-ID: Date: Mon, 19 Jul 2021 23:54:52 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210719034313.GA274232@rocinante> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, Thank you for reviewing. On 2021/07/19 12:43, Krzysztof Wilczyński wrote: > Hello Hayashi-san, > > Thank you for sending the patch over! > >> Convert sprintf() in sysfs "show" functions to sysfs_emit() in order to >> check for buffer overruns in sysfs outputs. > > Nice catch! I actually executed "cat" against configfs to meet the issue and found your solution in pci-sysfs. > > A small nitpick: what you are changing here are technically not sysfs > objects since all of these are related to configfs. Having said that, > configfs shares the same semantics for normal attributes with sysfs, so > a maximum size of PAGE_SIZE applies here too, and thus sysfs_emit() > would work fine. Thank you for helpful information. I understand that applying sysfs_emit() to configfs is no problem. > > Thank you for taking care of this! > > Reviewed-by: Krzysztof Wilczyński > > Krzysztof > Thank you, --- Best Regards Kunihiko Hayashi