mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
scst_event: Fix check of recopied payload_len
We check the recopied payload_len with the length of
struct scst_event + payload.
if (event->payload_len != event_len)
This check will never succeed.
So check the recopied payload length with the passed
payload_len from user space.
Fixes: ffd85476 ("scst: Suppress a false positive Coverity memory corruption complaint")
This commit is contained in:
@@ -637,8 +637,9 @@ static int scst_event_get_event_from_user(struct scst_event_user __user *arg,
|
||||
}
|
||||
|
||||
/* payload_len has been recopied, so recheck it. */
|
||||
if (event->payload_len != event_len) {
|
||||
PRINT_ERROR("Payload len changed while being read");
|
||||
if (event->payload_len != payload_len) {
|
||||
PRINT_ERROR("Payload len %d changed while being read: %d",
|
||||
event->payload_len, payload_len);
|
||||
res = -EINVAL;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user