mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
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:
parent
7d7214b39b
commit
9dd8b9a337
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user