summary refs log tree commit diff stats
path: root/linux-user/sparc/cpu_loop.c
diff options
context:
space:
mode:
authorFrédéric Fortier <frf@ghgsat.com>2021-03-28 14:01:35 -0400
committerLaurent Vivier <laurent@vivier.eu>2021-03-29 21:56:18 +0200
commit13e340c886679fb17df02a35e7d82cb8beb6e9f4 (patch)
tree8ed216ec42b40f3aeeb7fdb2d5f7bc24909ecfde /linux-user/sparc/cpu_loop.c
parentec2e6e016d24bd429792d08cf607e4c5350dcdaa (diff)
downloadfocaccia-qemu-13e340c886679fb17df02a35e7d82cb8beb6e9f4.tar.gz
focaccia-qemu-13e340c886679fb17df02a35e7d82cb8beb6e9f4.zip
linux-user: NETLINK_LIST_MEMBERSHIPS: Allow bad ptr if its length is 0
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-calling getsockopt with proper optval/optlen arguments.

Notable users of this pattern include systemd-networkd, which in the
(albeit old) version 237 tested, cannot start without this fix.

Signed-off-by: Frédéric Fortier <frf@ghgsat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210328180135.88449-1-frf@ghgsat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/sparc/cpu_loop.c')
0 files changed, 0 insertions, 0 deletions