diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2023-06-09 17:29:15 +0100 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2023-06-10 00:00:24 +0300 |
commit | 8fbf89a9669520ac09b3ae0013ff3eb34f8cab23 (patch) | |
tree | 9d482f2d76b6275b50bc546a89bdaf3a8e126307 /ui | |
parent | 725160fe56eb9f6b9b13214b9adf519c25b9d527 (diff) | |
download | qemu-8fbf89a9669520ac09b3ae0013ff3eb34f8cab23.zip qemu-8fbf89a9669520ac09b3ae0013ff3eb34f8cab23.tar.gz qemu-8fbf89a9669520ac09b3ae0013ff3eb34f8cab23.tar.bz2 |
linux-user: Return EINVAL for getgroups() with negative gidsetsize
Coverity doesn't like the way we might end up calling getgroups()
with a NULL grouplist pointer. This is fine for the special case
of gidsetsize == 0, but we will also do it if the guest passes
us a negative gidsetsize. (CID 1512465)
Explicitly fail the negative gidsetsize with EINVAL, as the kernel
does. This means we definitely only call the libc getgroups()
with valid parameters. It also brings the getgroups() code in
to line with the setgroups() code.
Possibly Coverity may still complain about getgroups(0, NULL), but
that would be a false positive.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'ui')
0 files changed, 0 insertions, 0 deletions