Re: [PATCH] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0

2021-03-29 Thread Laurent Vivier
Le 28/03/2021 à 20:01, Frédéric Fortier via a écrit : > getsockopt(fd, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, *optval, *optlen) > syscall allows optval to be NULL/invalid if optlen points to a size of > zero. This allows userspace to query the length of the array they should > use to get the full m

Re: [PATCH] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0

2021-03-29 Thread Laurent Vivier
Le 28/03/2021 à 20:01, Frédéric Fortier via a écrit : > getsockopt(fd, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, *optval, *optlen) > syscall allows optval to be NULL/invalid if optlen points to a size of > zero. This allows userspace to query the length of the array they should > use to get the full m

Re: [PATCH] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0

2021-03-28 Thread no-reply
: Allow bad ptr if its length is 0 === TEST SCRIPT BEGIN === #!/bin/bash git rev-parse base > /dev/null || exit 0 git config --local diff.renamelimit 0 git config --local diff.renames True git config --local diff.algorithm histogram ./scripts/checkpatch.pl --mailback base.. === TEST SCRIPT

[PATCH] linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0

2021-03-28 Thread Frédéric Fortier via
getsockopt(fd, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, *optval, *optlen) syscall allows optval to be NULL/invalid if optlen points to a size of zero. This allows userspace to query the length of the array they should use to get the full membership list before allocating memory for said list, then re