mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
aio: Return EINVAL if the number of events is negative.
PiperOrigin-RevId: 202671065 Change-Id: I248b74544d47ddde9cd59d89aa6ccb7dad2b6f89
This commit is contained in:
committed by
Shentubot
parent
f93bd2cbe6
commit
1b5e09f968
@@ -132,7 +132,7 @@ func IoGetevents(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.S
|
||||
timespecAddr := args[4].Pointer()
|
||||
|
||||
// Sanity check arguments.
|
||||
if minEvents > events {
|
||||
if minEvents < 0 || minEvents > events {
|
||||
return 0, nil, syserror.EINVAL
|
||||
}
|
||||
|
||||
@@ -359,6 +359,10 @@ func IoSubmit(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysc
|
||||
nrEvents := args[1].Int()
|
||||
addr := args[2].Pointer()
|
||||
|
||||
if nrEvents < 0 {
|
||||
return 0, nil, syserror.EINVAL
|
||||
}
|
||||
|
||||
for i := int32(0); i < nrEvents; i++ {
|
||||
// Copy in the address.
|
||||
cbAddrNative := t.Arch().Native(0)
|
||||
|
||||
Reference in New Issue
Block a user