summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorChaitanya Kulkarni <kch@nvidia.com>2022-02-15 13:33:07 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-15 14:18:22 +0200
commit927649f3f379168703813cd32e14fcec5ef46b67 (patch)
tree4dda6edbb2a5d5a3104fa8df20ce6783f1f53fdf /security
parent799f22279e11b67023b0ce547e6518dbcb4508e7 (diff)
loop: use sysfs_emit() in the sysfs xxx show()
[ Upstream commit b27824d31f09ea7b4a6ba2c1b18bd328df3e8bed ] sprintf does not know the PAGE_SIZE maximum of the temporary buffer used for outputting sysfs content and it's possible to overrun the PAGE_SIZE buffer length. Use a generic sysfs_emit function that knows the size of the temporary buffer and ensures that no overrun is done for offset attribute in loop_attr_[offset|sizelimit|autoclear|partscan|dio]_show() callbacks. Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Link: https://lore.kernel.org/r/20220215213310.7264-2-kch@nvidia.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions