From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BBEF2F7F07 for ; Wed, 15 Jul 2026 21:31:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784151106; cv=none; b=QurVCRgJL2rPNclhpEZmJd9zxwrvQriYv+iYRVmdOCrlSl3fbABnW4WaDFG5ehPLyGBhnh9o9jF/VXkEDWBACU7RUrFLZI5PNKjTyIyqO92be96yxrIU/sXNIyUUd+FgjkKIpkR58+N3/lu5D8Mfg4dvEw2SsyYSNfEukyVskHc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784151106; c=relaxed/simple; bh=UQ9VAiVeCZWMZkBEOtn6RY19qayrGcPhQbdZi0ZSpHU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tQpTo/6nTPa6Z+kCufyM916ziuIX+UGZwTeEIb5rOkuVGxCU5D7m4qX2WNtY1mPB914GjMC7cHuEeT+0OXrMX7l0EEnMPSBB7YhdYN9MiWxMp99s+v7/M+lIVNYdtGcnmbvG48N1AW2IoYqdqhIr9UlJ9XmJnLL0UO6sBr8eYE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IJiaaDZd; arc=none smtp.client-ip=209.85.210.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IJiaaDZd" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-7eb4d8a21a8so1648773a34.2 for ; Wed, 15 Jul 2026 14:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784151104; x=1784755904; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=FH1G2p6pP1LRbcz11N5iQe1Ot4d6ncQZprgfJdvooEs=; b=IJiaaDZdFezFnmW/UtdSu4AtQFTfukuHDgMglQLZ6h8vxgbFmI8isgjjl7OKGV6IUH WzTnPB2mwRNWwhAUTtM82KX7eBTj0jonYZK6z9XEVyFk1owQwUKE+i4PS2mDd8xqZd4b itf6fIXaKUSHueKGQXpsP77T7AYmxDe+0u/CBBuqe6jw9j9tn5ODfGnrqxPhokrtT9Iv XETagTED3Go2zge25zvb2yxPNr7RXPwnrty2rHPhnUwj8ta368HYmlDUwq2sa8CQr/Pd 1yIj09PyRUizVj6V6ac4Wrza/OdeeVYf0P9AJ5TzmL5xYXrqs/eS7l1YTwJe+D/JGrsk SllA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784151104; x=1784755904; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=FH1G2p6pP1LRbcz11N5iQe1Ot4d6ncQZprgfJdvooEs=; b=pJwcrbNR1WH3dktiXH46WvPq+0hrZb0TwgjvY/fLnRT3BAqLUeDBSnqM3kBbyVSPxp 8nufVqOkcJdUyckDfMvA2qnntUU9beaj6nyWjZaAD7Iy7x3VGTUaofDvEbULRQMxj6qm HebhiXmz3cjWOi1omV5ZRPSFN2x+IzUBzS3E5ljIXiUSBfOi1cJdev66Qkz4mZP1rzRT WTQsCeRxfCGgAO0xtcEhxBsn0Xb4JFNNjZdvB3EitT1JPgjoOzQ9h8UGtg0MS65zjQ5N 9MCydnfAEVvMBQRM1/2PHUG5CmUDZM35q7Ltqy8YRRN/xxIiXz5ZsLI59xpRMRowRqPK gvAg== X-Forwarded-Encrypted: i=1; AHgh+RqhfGv0q+2cMtgizJbqYF+0094Q4KRVpVhTiRLbhso7UI+uGdM6ugp5alFqGdBH99ylPrgS1hyEdzCUztw=@vger.kernel.org X-Gm-Message-State: AOJu0YwYMJRFtdxt6vZnn7bpfbNbusmZI0nfejc6KOrB0MZJJ9G9aKI6 DrI6lxdiDCtplR5FO3GiLmo+9Ho3aIcam8HttmGExcoTcoYefxvyITuP X-Gm-Gg: AfdE7cnqcAgcFy+Djj5BEpIDPCw8yJdo1rXP1ycAqx77pXKOogey8ApmogZctR48OIW eSzvZyqX1y0vtRUnXUi8NLb0//9bXRq9OOparTfH7Wow7y+lttSwS6axgkugWmTwRrEMNJp2M1p EhEj84cFXvKUt1hujlhEWW9FYCml5DTfxiPBflMwmI/SuzDifgte90NKuDGRxba4HVj2D3DVR7I shS21sZ9E/rRzeGGcGAT7S0Zc9VlJ7PNTql2m562RUZvMwg+9xEEdF5wpxp1vzOGsQU8ARijd5l LNNMrz3eVBJFzf+gSXGf1hvlw8c6bxwNYmUASN4rPasciyQpKvbhlMw/x2bHfj8rrmRZnjzfQwH aNdJneZKooFSunSYq/SGHqfMS9/vh9D5vYe0V1X1YZD92n5xBrHHJloN2bRRl8u9e2j+mdA== X-Received: by 2002:a05:6830:680e:b0:7e9:f8e8:d905 with SMTP id 46e09a7af769-7ec097a243fmr12860663a34.16.1784151103942; Wed, 15 Jul 2026 14:31:43 -0700 (PDT) Received: from localhost ([74.80.182.90]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ebcab8efc3sm17586080a34.0.2026.07.15.14.31.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 14:31:42 -0700 (PDT) Date: Thu, 16 Jul 2026 00:31:35 +0300 From: Dan Carpenter To: Mohammad Davoudi Cc: johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org, rmfrfs@gmail.com, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: greybus: Replace sprintf with sysfs_emit Message-ID: References: <20260715172858.17658-1-MDavoudi2011@gmail.com> 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: <20260715172858.17658-1-MDavoudi2011@gmail.com> On Wed, Jul 15, 2026 at 05:28:58PM +0000, Mohammad Davoudi wrote: > Replace sprintf() with sysfs_emit() in sysfs show functions. > The sprintf() function is unaware of the PAGE_SIZE limit of the sysfs > buffer, which can potentially lead to buffer overruns. sysfs_emit() > is strictly designed for sysfs attributes and inherently protects > against buffer boundaries. > > Signed-off-by: Mohammad Davoudi We're not applying this kind of patch in cases where sprintf is fine. Really, I never like commit messages which talk about "potential buffer overruns". Is it a buffer overrun or not? If it's really hard to figure out then say that "This code is really hard to figure out and I suspect its fine but let's be safe." In this case the code is really simple and we can all see the original code is fine just from reading the diff... regards, dan carpenter