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 X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A33FC07E9D for ; Mon, 19 Jul 2021 14:55:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80F3C61002 for ; Mon, 19 Jul 2021 14:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239467AbhGSOO0 (ORCPT ); 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