qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] linux-user: fix getgroups/setgroups allocations


From: Michael Tokarev
Subject: Re: [PATCH v3] linux-user: fix getgroups/setgroups allocations
Date: Sun, 9 Apr 2023 13:54:13 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

09.04.2023 13:48, Michael Tokarev пишет:
..
v3:
  - fix a bug in getgroups(). In initial implementation I checked
    for ret>0 in order to convert returned list of groups to target
    byte order. But this clashes with unusual corner case for this
    syscall: getgroups(0,NULL) return current number of groups in
    the set, so this resulted in writing to *NULL. The right condition
    here is gidsetsize>0:
    -            if (!is_error(ret) && ret > 0) {
    +            if (!is_error(ret) && gidsetsize > 0) {

The same fix is needed for getgroups32. v4 sent.

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]