[PATCH] pselect.c: Pass a pointer to SYSCALL_CANCEL [BZ #26606]

H.J. Lu hjl.tools@gmail.com
Sat Sep 12 02:45:33 GMT 2020


commit a92f4e6299fe0e3cb6f77e79de00817aece501ce
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon Jul 6 13:27:12 2020 -0300

    linux: Add time64 pselect support

changed pselect.c to

     r = SYSCALL_CANCEL (pselect6_time64, nfds, readfds, writefds, exceptfds,
			  timeout,
			  ((__syscall_ulong_t[]){ (uintptr_t) sigmask,
						  __NSIG_BYTES }));

which doesn't work with x32's ARGIFY and data passed to syscall isn't
initialized with sigmask and __NSIG_BYTES.  Change to

     __syscall_ulong_t data[2] =
	{
	  (uintptr_t) sigmask, __NSIG_BYTES
	};
      r = SYSCALL_CANCEL (pselect6_time64, nfds, readfds, writefds, exceptfds,
			  timeout, data);

fixes the issue.
---
 sysdeps/unix/sysv/linux/pselect.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/pselect.c b/sysdeps/unix/sysv/linux/pselect.c
index ed36121023..aa5835ed0f 100644
--- a/sysdeps/unix/sysv/linux/pselect.c
+++ b/sysdeps/unix/sysv/linux/pselect.c
@@ -44,10 +44,12 @@ __pselect64 (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
   int r;
   if (supports_time64 ())
     {
+      __syscall_ulong_t data[2] =
+	{
+	  (uintptr_t) sigmask, __NSIG_BYTES
+	};
       r = SYSCALL_CANCEL (pselect6_time64, nfds, readfds, writefds, exceptfds,
-			  timeout,
-			  ((__syscall_ulong_t[]){ (uintptr_t) sigmask,
-						  __NSIG_BYTES }));
+			  timeout, data);
       if (r == 0 || errno != ENOSYS)
 	return r;
 
-- 
2.26.2



More information about the Libc-alpha mailing list