From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (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 4CB773438AF for ; Thu, 28 May 2026 07:34:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779953649; cv=none; b=LDT2mhjUbrdIeO+e3e5y4/ArOU2td2LCxPgj1311+tPzpbo7ayI+2ouxGs7j2KTxJGPAVumRcRrhkDSngWlNoZwe9414bRwA7L0pvh7iy08TJe0aXtRo9CMb/OQe4ovckjNBi940nYWoct3x3cWSk9p6MqgqZPQjHP+XFygJ4ZI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779953649; c=relaxed/simple; bh=K5/SOVQjGOnUDf8q8+OfAOX8Olm1PEMoTGPYI6ZBP7k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RAVcBOsGagZmA/TnDfZuKc+R8VJOcrQW0YhgXikK2CJsVsJKNT+0qQbL6VZziBJXx9yodllsuv96xOMaly45aZbID/Ncg8QdYatYr64mwnyt8WgN7uf7CcMJp+q81gW+SzOKW/R/KakdZTLIRCSjXN1LDDQoK4Wz1V3vjLR/RXU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=OVy5u2+W; arc=none smtp.client-ip=209.85.128.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="OVy5u2+W" Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-49039a8851fso68849205e9.2 for ; Thu, 28 May 2026 00:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1779953646; x=1780558446; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=uEopGxoNmG3iW/PS4Qm/q2RpgN11aOJO89Z6hnNE0BY=; b=OVy5u2+WdBKhvGN+Qsa75g1jqcNCSyadjwZDXu83GArLaCIwVmqMiAz23KrOhRm69e r94I3Zq9fi6rNW8GMCWOlULHTF7IbcFUDsSbBOqfITR6hT8il2gaLh9EK2l3ZXwNCpea 9g/09L4Lx3uBlXcobHQm95nwk8C9+XaoDAC8Chu/gsVxRzL0WXhitzFxqC+81HEp+uQg FP0ASARK/tZPIgdh9u4PToCj6vcMC60g1vINQ4Cd+dT+ELv5uZssPw55dwqcDDWZEyUc /HffPA/iTL2vGmlKJiX1afLKtiYsVh/V4P+Rcr5QJNsCU4CTl97/js/dM5s2/u8J1bGD GRkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779953646; x=1780558446; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uEopGxoNmG3iW/PS4Qm/q2RpgN11aOJO89Z6hnNE0BY=; b=Zip6wh0MVrTKkozsVQySdqCVbJ66rMMpXTbKig2pTvtCfmOEc2YznIZ4KTGDv4ILC5 o7E8Yo4QKJqcdAUFYCSPO2y9oU0oQSgI8r/YAOiTaT2pv910PkTOel3L6512YRWnDCxz CFImmC9hK0g350PXcJfxBgcINPtKyd1Gw11B32FLxOnEAf9x0H3CPUMj8DFNdBESFflO xad6iACbzmtRqYAJBB7fH7Bgwo0AEvnPMpX+GEgLDaE9+hI4t68dFXPXiiBz9KpVu6sB 9HQcX6SSr2bQkgzr6o861Mi9DB1a5dL7cmuehJTvWmR4tN1P7j2xVy1NLTqCbiyfULkA xmhQ== X-Gm-Message-State: AOJu0YyHNwNqjYptZr7U796nhvM2YnlQaMWa/LUQ4IWVqkHNOZKwgsDT frFuIsmB0hSb9Hei/ZOzfIeLYkmjVsaOvB1NVO3ZmU5a+XUQ5bFcfhoDxBf0+e7zyyY= X-Gm-Gg: Acq92OH4KmaQkYtisbol9VmMaXnHm8Ypj8XjYbZA6KFyN0mRvirEifyllBP2C57xk60 Wj+bYm5Cnsjz4BZvvGjr4o4MgXrPxxAQfGuQ2C2Z6CdU9+lNND0UU0Ty1EosmpBOH2yO+aDljPV sDJEfZlFUX8euFwr+8XoHVP4Zt3TLo4eUQMMr4lzXlwYWQqW0oxaTTVwn56sfPHHn7AKdg7/7m4 mwUBNKaYIIxfFJEuHjrOd85HEmpbiR1Y14Vt3pRJIWWStReAApDRIeg6saJ6ebnQTc93+uCKyt0 bIW0XKrhuAv9PJqzNgc2KpEjMRzImxr5edGC+H56K5mOEAwuCsRlItB7ckIPbD2SR/caG0uP9Wc 3Fqhi3WitSsJGVqG21Af577/lI81xQKIig2s+7ZCwthHvJg00CfhUH5yuaid4ug36FfCnc3/4k6 tXNgjoe9qk8vt8gnhyHbIsFcMgezt50j0FSZPlGP7HussLMJ1F+uHP24s= X-Received: by 2002:a05:600c:45ce:b0:490:5cd8:d20a with SMTP id 5b1f17b1804b1-4905cd8d2b2mr266284205e9.11.1779953645671; Thu, 28 May 2026 00:34:05 -0700 (PDT) Received: from [192.168.42.79] (nat2.prg.suse.com. [195.250.132.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49092a82ea2sm43390065e9.9.2026.05.28.00.34.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 May 2026 00:34:05 -0700 (PDT) Message-ID: <66675f58-a77d-4e66-99a1-40b7a6affbd8@suse.com> Date: Thu, 28 May 2026 09:34:04 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] params: array: stage element output before concatenation To: Ren Wei 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 References: <39ea219375e09c0d572083b9ef87e19bfcb04393.1779869681.git.bronzed_45_vested@icloud.com> Content-Language: en-US From: Petr Pavlu In-Reply-To: <39ea219375e09c0d572083b9ef87e19bfcb04393.1779869681.git.bronzed_45_vested@icloud.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 5/28/26 7:22 AM, Ren Wei wrote: > From: Wyatt Feng > > 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