]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
kern_select(9) copies fd_set in and out of userspace in quantities of
authorkib <kib@FreeBSD.org>
Wed, 9 Sep 2009 20:59:01 +0000 (20:59 +0000)
committerkib <kib@FreeBSD.org>
Wed, 9 Sep 2009 20:59:01 +0000 (20:59 +0000)
commit91e6a5b3cc44fe15d5746c5b0f8d4b970182c656
treeecdcb4c945cc32ab7a293d1290a48abdaff024e2
parent2f0e817202fd1926d9261102d1576c28d138e982
kern_select(9) copies fd_set in and out of userspace in quantities of
longs. Since 32bit processes longs are 4 bytes, 64bit kernel may copy in
or out 4 bytes more then the process expected.

Calculate the amount of bytes to copy taking into account size of fd_set
for the current process ABI.

Diagnosed and tested by: Peter Jeremy <peterjeremy acm org>
Reviewed by: jhb
MFC after: 1 week
sys/compat/freebsd32/freebsd32_misc.c
sys/compat/linux/linux_misc.c
sys/kern/sys_generic.c
sys/sys/syscallsubr.h