RDMA/usnic: Bound buffer size to sizeof(buf) in flowinfo_read()

In flowinfo_read(), 'left' tracks the remaining space in the 512-byte
stack buffer 'buf', but it is initialized to 'count'.

Initialize 'left' to sizeof(buf) instead of 'count'.

Fixes: 9f637f7936 ("IB/usnic: Expose flows via debugfs")
Signed-off-by: Serhat Kumral <serhatkumral1@gmail.com>
Link: https://patch.msgid.link/20261017185028.1019445-1-serhatkumral1@gmail.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
Serhat Kumral 2026-10-17 21:50:28 +03:00 committed by Leon Romanovsky
parent 7d7214b39b
commit 9dd8b9a337

View File

@ -76,7 +76,7 @@ static ssize_t flowinfo_read(struct file *f, char __user *data,
qp_flow = f->private_data;
ptr = buf;
left = count;
left = sizeof(buf);
if (*ppos > 0)
return 0;