--- 2.4.19rc2aa1/arch/x86_64/ia32/sys_ia32.c.~1~ Wed Jul 17 23:14:39 2002 +++ 2.4.19rc2aa1/arch/x86_64/ia32/sys_ia32.c Wed Jul 17 23:43:34 2002 @@ -783,6 +783,33 @@ out: } /* + * We do a VERIFY_WRITE here even though we are only reading this time: + * we'll write to it eventually.. + * + * Use "unsigned long" accesses to let user-mode fd_set's be long-aligned. + */ +static inline +int get_fd_set(unsigned long nr, void *ufdset, unsigned long *fdset) +{ + nr = FDS_BYTES(nr); + if (ufdset) { + int error; + error = verify_area(VERIFY_WRITE, ufdset, nr); + if (!error && __copy_from_user(fdset, ufdset, nr)) + error = -EFAULT; + return error; + } + memset(fdset, 0, nr); + return 0; +} + +static inline +void zero_fd_set(unsigned long nr, unsigned long *fdset) +{ + memset(fdset, 0, FDS_BYTES(nr)); +} + +/* * We can actually return ERESTARTSYS instead of EINTR, but I'd * like to be certain this leads to no problems. So I return * EINTR just for safety.