summaryrefslogtreecommitdiff
path: root/scripts/sbom/git@git.tavy.me:linux-stable.git
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-05-20 15:07:01 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-05-20 17:15:20 +0200
commit454257f6d124a92342dcbb7710c03dd6ef96c731 (patch)
treeb10e4ed325dcc991736bf3f30e8553f07913c0cc /scripts/sbom/git@git.tavy.me:linux-stable.git
parent8d3bea93f483cb8f92b9f85d1528268a6469af28 (diff)
sysfs: clamp show() return value in sysfs_kf_read()
sysfs_kf_seq_show() defends against buggy show() callbacks that return larger than PAGE_SIZE by clamping the value and printing a warning. sysfs_kf_read(), the prealloc variant, has no such defense. The only current in-tree user of __ATTR_PREALLOC is drivers/md/md.c, whose show() callbacks are well-behaved, so this is hardening against future drivers doing foolish things and out-of-tree code doing even more foolish things. Cc: NeilBrown <neil@brown.name> Cc: Tejun Heo <tj@kernel.org> Fixes: 2b75869bba67 ("sysfs/kernfs: allow attributes to request write buffer be pre-allocated.") Assisted-by: gregkh_clanker_t1000 Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/2026052000-drove-unicycle-d61b@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/sbom/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions