mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Pavlu <petr.pavlu@suse.com>
To: Ren Wei <n05ec@lzu.edu.cn>
Cc: linux-kernel@vger.kernel.org, samitolvanen@google.com,
	da.gomez@samsung.com, atomlin@atomlin.com,
	thorsten.blum@linux.dev, kees@kernel.org, yuantan098@gmail.com,
	zcliangcn@gmail.com, bird@lzu.edu.cn,
	bronzed_45_vested@icloud.com
Subject: Re: [PATCH 1/1] params: array: stage element output before concatenation
Date: Thu, 28 May 2026 09:34:04 +0200	[thread overview]
Message-ID: <66675f58-a77d-4e66-99a1-40b7a6affbd8@suse.com> (raw)
In-Reply-To: <39ea219375e09c0d572083b9ef87e19bfcb04393.1779869681.git.bronzed_45_vested@icloud.com>

On 5/28/26 7:22 AM, Ren Wei wrote:
> From: Wyatt Feng <bronzed_45_vested@icloud.com>
> 
> param_array_get() builds one sysfs string from a parameter array, but
> the individual get callbacks are defined to format into a full PAGE_SIZE
> buffer. Passing buffer + off directly to those callbacks can overrun the
> remaining space once the concatenated output approaches PAGE_SIZE.
> 
> Fix this in the array helper by formatting each element into a temporary
> PAGE_SIZE buffer before copying only the bytes that still fit into the
> sysfs buffer. This keeps the existing callback interface unchanged and
> prevents both the element formatter and the final terminator write from
> stepping past the end of the page.

This issue was reported before, along with a similar fix [1].
Additionally, another series has been proposed to convert
kernel_param_ops::get() to seq_buf [2].

[1] https://lore.kernel.org/all/20260417075042.26632-1-pengpeng@iscas.ac.cn/
[2] https://lore.kernel.org/linux-modules/20260521133315.work.845-kees@kernel.org/

-- 
Thanks,
Petr

      reply	other threads:[~2026-05-28  7:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1779869681.git.bronzed_45_vested@icloud.com>
2026-05-28  5:22 ` Ren Wei
2026-05-28  7:34   ` Petr Pavlu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66675f58-a77d-4e66-99a1-40b7a6affbd8@suse.com \
    --to=petr.pavlu@suse.com \
    --cc=atomlin@atomlin.com \
    --cc=bird@lzu.edu.cn \
    --cc=bronzed_45_vested@icloud.com \
    --cc=da.gomez@samsung.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=n05ec@lzu.edu.cn \
    --cc=samitolvanen@google.com \
    --cc=thorsten.blum@linux.dev \
    --cc=yuantan098@gmail.com \
    --cc=zcliangcn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®