From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A0D440DFB3 for ; Mon, 30 Mar 2026 00:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774832275; cv=none; b=mMYyRQErUpt6YQKZMde8ex1qhn88AMfGCbci77X/+oWrLQvB5BlBDOjkiJFsdIrNrv+sTtu/k16+QgEmtwVlcD673IIGMV+Smg5W+ey0db748v2V0SCz3kSR6nsmTlDUYZfnySK8iOqyH05CBIctJdbE0nxAAutUt77ACAlwLus= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774832275; c=relaxed/simple; bh=zA/J5T1P8mp2aqH0l5xBsaJPODeW2kMf1OJUoULf0vs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cpBv5fm4DapKuJwJCVCRRM76SCv+NVJ+hPtM/RYJw9s/jbYxFC792HtY450eohNjBIn5ZAm7km1838kKaTDPD8iWxWy06I1ck634MNbpQr2qkYbYCHn7qgGaupnXw2dizbiWzvCUFE9bcHOZn/2yc00SVkAfrHsQlVc6ZwLUlE8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=BAoKATqO; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=x2PsDnR2; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="BAoKATqO"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="x2PsDnR2" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id BEED1EC0096; Sun, 29 Mar 2026 20:57:51 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sun, 29 Mar 2026 20:57:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1774832271; x= 1774918671; bh=jmojO+KXhf6ANjb3kyM3+4AA8cWt+mkVS822IT4EINI=; b=B AoKATqOjm64qqcR1a8chiRSa/iYG2C3y8MP3icAlVJIEeJwNMcLbdbefB671WCDX snCYc2cRY4+JmR5KaH2fbMpz4peM5loE9wSB9Jc3uTap0BhlfjEQN8OlFtLaTo0Y 2ju5yISUJguhZZ9B3lStSl6jbkRY9RcrusYcFpPAapjsc0edwWw2u4Ic2qrSY+cx Q46vXCA1YemL6RlqrITnWQyy+tXXIlDCR8zxV/QMkkS9lL0WEk/o+YL5OSx1IC9t a7OA1Az3mm/HPte8c0YDIBUq1WpRq/asW01rwLomn4oJZyQdvjzCsDxz8AKUVzNd Z7+RPUIjn++Lno0aS2LFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1774832271; x=1774918671; bh=jmojO+KXhf6ANjb3kyM3+4AA8cWt+mkVS82 2IT4EINI=; b=x2PsDnR2zcvEg6TxW/d/M/JPc0aFiqtGvZpLEp3wTW0EhrXtXZE vVvuSt/xYh4kHo6IOnztFEBEc8afpl2cdX5zxfR1mLc4jaSdbFHPBbeiv1fI4fH7 R5ZloKD+FzcCeyVNC5d02jHZaZDDj0ncPT/4pRr18Kp6EDlQWPXQDGvABFnBl2mg yP5Cc8eNzjwxsPziqvHtUdxUrT1/0qPyJo9/F0H4AV1l7b3uyYivx//icnM/WF4y YS7E2ZFRmJgENGOW/tWNd3XDEQj9WYXfFrIlohNzaOeg2YJlVgP+RNEr9yABndWj 4Qn4fZ8ec9JM0WMNwdukUHlmB2C+slXxNOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeffeejheelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepvfgrkhgrshhh ihcuufgrkhgrmhhothhouceoohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhirdhjph eqnecuggftrfgrthhtvghrnhephefhhfettefgkedvieeuffevveeufedtlefhjeeiieet vdelfedtgfefuedukeeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhirdhjphdpnhgspghr tghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepthhhohhrshhtvg hnrdgslhhumheslhhinhhugidruggvvhdprhgtphhtthhopehlihhnuhigudefleegqdgu vghvvghlsehlihhsthhsrdhsohhurhgtvghfohhrghgvrdhnvghtpdhrtghpthhtoheplh hinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Mar 2026 20:57:50 -0400 (EDT) Date: Mon, 30 Mar 2026 09:57:48 +0900 From: Takashi Sakamoto To: Thorsten Blum Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] firewire: core: clean up modalias buffer handling Message-ID: <20260330005748.GA115569@sakamocchi.jp> Mail-Followup-To: Thorsten Blum , linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20260329211940.371395-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260329211940.371395-2-thorsten.blum@linux.dev> Hi, Thanks for sending your patch. On Sun, Mar 29, 2026 at 11:19:40PM +0200, Thorsten Blum wrote: > Use scnprintf() in get_modalias() to return the number of characters > actually written to the destination buffer. > > Also reserve space for the trailing newline in modalias_show() and > append it explicitly, instead of using strcpy() and relying on the > formatted modalias to fit within PAGE_SIZE. > > While the current code is safe, this makes the sysfs buffer handling > more explicit and consistent. > > Signed-off-by: Thorsten Blum > --- > drivers/firewire/core-device.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) I previously considered using sysfs_emit(_at)() in the code, but decided against it because the code is called in both sysfs and the workqueue context of firewire devices. The buffer size differs between these cases (either PAGE_SIZE or 64). In any case, as you already noted, the current code is enough safe. The total length of formatted string is fixed (= 41 + 1) by the format template, so it is unlikely to cause issues. I have little motivation to change it. Thanks Takashi Sakamoto