From patchwork Thu Mar 3 07:35:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 11172 Received: (qmail 116532 invoked by alias); 3 Mar 2016 07:35:30 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 116515 invoked by uid 89); 3 Mar 2016 07:35:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, KAM_LOTSOFHASH, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=98, 97, U*aurelien, sk:aurelie X-HELO: e06smtp09.uk.ibm.com X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: stli@linux.vnet.ibm.com X-IBM-RcptTo: libc-alpha@sourceware.org To: libc-alpha@sourceware.org From: Stefan Liebler Subject: [COMMITED 2.22 2.21 2.20][BZ #19682] S390: Do not use direct socket syscalls if build on kernels >= 4.3. Message-ID: <56D7E93A.6020708@linux.vnet.ibm.com> Date: Thu, 3 Mar 2016 08:35:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16030307-0037-0000-0000-000005EAE8AE Hi, Beginning with Linux 4.3, the kernel headers contain direct system call numbers __NR_socket etc. on s390x. On older kernels, the socket-multiplexer syscall __NR_socketcall was used. To enable these new syscalls, the patch "S390: Call direct system calls for socket operations." (https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5) was applied upstream. If glibc 2.23 is configured with --enable-kernel=4.3 and newer, the direct socket syscalls are used. For older kernels, the socket-multiplexer syscall is used instead. In glibc 2.22 and earlier, this patch is not applied. If you build glibc on a kernel < 4.3, the socket-multiplexer syscall is used. But if you build glibc on kernel >= 4.3, the direct socket-syscalls are used. If you install this glibc on a kernel < 4.3, all socket operations will fail. See "Bug 19682 - s390x: Incorrect syscall definitions cause breakage with Linux 4.3 headers" (https://sourceware.org/bugzilla/show_bug.cgi?id=19682) The configure switch --enable-kernel does not influence this behaviour on older glibc-releases. The solution is to remove the direct socket-syscalls in sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (this patch) on older glibc-releases as it was done by the upstream patch, too. These entries were never used on s390x, but the c-files in sysdeps/unix/sysv/linux/. After this removal, the behaviour of the socket functions are not changed compared to the original glibc release version and the socket-multiplexer-syscall is always used. After talking to the distribution maintainers, the decision is to backport it to glibc 2.22, 2.21, 2.20 as done with this commit. Bye Stefan commit 6f78924e17da075a9110b1d9dd3950ac63900843 Author: Stefan Liebler Date: Wed Mar 2 16:16:49 2016 +0100 S390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682] Beginning with Linux 4.3, the kernel headers contain direct system call numbers __NR_socket etc. on s390x. On older kernels, the socket-multiplexer syscall __NR_socketcall was used. To enable these new syscalls, the patch "S390: Call direct system calls for socket operations." (https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5) was applied upstream. If glibc 2.23 is configured with --enable-kernel=4.3 and newer, the direct socket syscalls are used. For older kernels, the socket-multiplexer syscall is used instead. In glibc 2.22 and earlier, this patch is not applied. If you build glibc on a kernel < 4.3, the socket-multiplexer syscall is used. But if you build glibc on kernel >= 4.3, the direct socket-syscalls are used. If you install this glibc on a kernel < 4.3, all socket operations will fail. See "Bug 19682 - s390x: Incorrect syscall definitions cause breakage with Linux 4.3 headers" (https://sourceware.org/bugzilla/show_bug.cgi?id=19682) The configure switch --enable-kernel does not influence this behaviour on older glibc-releases. The solution is to remove the direct socket-syscalls in sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (this patch) on older glibc-releases as it was done by the upstream patch, too. These entries were never used on s390x, but the c-files in sysdeps/unix/sysv/linux/. After this removal, the behaviour of the socket functions are not changed compared to the original glibc release version and the socket-multiplexer-syscall is always used. commit 21291f5a77921518b4f62636ec96ede8d8ca6529 Author: Stefan Liebler Date: Wed Mar 2 15:52:48 2016 +0100 S390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682] Beginning with Linux 4.3, the kernel headers contain direct system call numbers __NR_socket etc. on s390x. On older kernels, the socket-multiplexer syscall __NR_socketcall was used. To enable these new syscalls, the patch "S390: Call direct system calls for socket operations." (https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5) was applied upstream. If glibc 2.23 is configured with --enable-kernel=4.3 and newer, the direct socket syscalls are used. For older kernels, the socket-multiplexer syscall is used instead. In glibc 2.22 and earlier, this patch is not applied. If you build glibc on a kernel < 4.3, the socket-multiplexer syscall is used. But if you build glibc on kernel >= 4.3, the direct socket-syscalls are used. If you install this glibc on a kernel < 4.3, all socket operations will fail. See "Bug 19682 - s390x: Incorrect syscall definitions cause breakage with Linux 4.3 headers" (https://sourceware.org/bugzilla/show_bug.cgi?id=19682) The configure switch --enable-kernel does not influence this behaviour on older glibc-releases. The solution is to remove the direct socket-syscalls in sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (this patch) on older glibc-releases as it was done by the upstream patch, too. These entries were never used on s390x, but the c-files in sysdeps/unix/sysv/linux/. After this removal, the behaviour of the socket functions are not changed compared to the original glibc release version and the socket-multiplexer-syscall is always used. diff --git a/ChangeLog b/ChangeLog index 3578f2e..f15298a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-03-02 Stefan Liebler + + [BZ #19682] + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: + Remove socketcall syscalls. + 2016-02-15 Carlos O'Donell [BZ #18665] diff --git a/NEWS b/NEWS index f1abb66..dd78048 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,8 @@ Version 2.21.1 * The following bugs are resolved with this release: - 17269, 17905, 17949, 18007, 18032, 18240, 18287, 18694, 18887, 18985. + 17269, 17905, 17949, 18007, 18032, 18240, 18287, 18694, 18887, 18985, + 19682. * A stack-based buffer overflow was found in libresolv when invoked from libnss_dns, allowing specially crafted DNS responses to seize control diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list index 5b8c102..9f03d26 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list @@ -12,22 +12,3 @@ shmget - shmget i:iii __shmget shmget semop - semop i:ipi __semop semop semget - semget i:iii __semget semget semctl - semctl i:iiii __semctl semctl - -# proper socket implementations: -accept - accept Ci:iBN __libc_accept __accept accept -bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect -getpeername - getpeername i:ipp __getpeername getpeername -getsockname - getsockname i:ipp __getsockname getsockname -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt -listen - listen i:ii __listen listen -recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom -recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg -send - send Ci:ibni __libc_send __send send -sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto -setsockopt - setsockopt i:iiibn __setsockopt setsockopt -shutdown - shutdown i:ii __shutdown shutdown -socket - socket i:iii __socket socket -socketpair - socketpair i:iiif __socketpair socketpair commit 5acee335e6a546354a71df0b5265e021a40c4c16 Author: Stefan Liebler Date: Wed Mar 2 15:25:03 2016 +0100 S390: Do not use direct socket syscalls if build on kernels >= 4.3. [BZ #19682] Beginning with Linux 4.3, the kernel headers contain direct system call numbers __NR_socket etc. on s390x. On older kernels, the socket-multiplexer syscall __NR_socketcall was used. To enable these new syscalls, the patch "S390: Call direct system calls for socket operations." (https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5) was applied upstream. If glibc 2.23 is configured with --enable-kernel=4.3 and newer, the direct socket syscalls are used. For older kernels, the socket-multiplexer syscall is used instead. In glibc 2.22 and earlier, this patch is not applied. If you build glibc on a kernel < 4.3, the socket-multiplexer syscall is used. But if you build glibc on kernel >= 4.3, the direct socket-syscalls are used. If you install this glibc on a kernel < 4.3, all socket operations will fail. See "Bug 19682 - s390x: Incorrect syscall definitions cause breakage with Linux 4.3 headers" (https://sourceware.org/bugzilla/show_bug.cgi?id=19682) The configure switch --enable-kernel does not influence this behaviour on older glibc-releases. The solution is to remove the direct socket-syscalls in sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (this patch) on older glibc-releases as it was done by the upstream patch, too. These entries were never used on s390x, but the c-files in sysdeps/unix/sysv/linux/. After this removal, the behaviour of the socket functions are not changed compared to the original glibc release version and the socket-multiplexer-syscall is always used. diff --git a/ChangeLog b/ChangeLog index 2ed60d6..56642cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-03-02 Stefan Liebler + + [BZ #19682] + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: + Remove socketcall syscalls. + 2016-03-01 Aurelien Jarno * sysdeps/alpha/fpu/libm-test-ulps: Update ULPs. diff --git a/NEWS b/NEWS index 81ceeae..3d52bec 100644 --- a/NEWS +++ b/NEWS @@ -24,7 +24,8 @@ Version 2.22.1 * The following bugs are resolved with this release: 17905, 18420, 18421, 18480, 18589, 18743, 18778, 18781, 18787, 18796, - 18870, 18887, 18921, 18928, 18969, 18985, 19018, 19058, 19174, 19178. + 18870, 18887, 18921, 18928, 18969, 18985, 19018, 19058, 19174, 19178, + 19682. * The LD_POINTER_GUARD environment variable can no longer be used to disable the pointer guard feature. It is always enabled. diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list index 5b8c102..9f03d26 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list @@ -12,22 +12,3 @@ shmget - shmget i:iii __shmget shmget semop - semop i:ipi __semop semop semget - semget i:iii __semget semget semctl - semctl i:iiii __semctl semctl - -# proper socket implementations: -accept - accept Ci:iBN __libc_accept __accept accept -bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect -getpeername - getpeername i:ipp __getpeername getpeername -getsockname - getsockname i:ipp __getsockname getsockname -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt -listen - listen i:ii __listen listen -recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom -recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg -send - send Ci:ibni __libc_send __send send -sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto -setsockopt - setsockopt i:iiibn __setsockopt setsockopt -shutdown - shutdown i:ii __shutdown shutdown -socket - socket i:iii __socket socket -socketpair - socketpair i:iiif __socketpair socketpair diff --git a/ChangeLog b/ChangeLog index 4d4905b..13634d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-03-02 Stefan Liebler + + [BZ #19682] + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: + Remove socketcall syscalls. + 2016-02-25 Carlos O'Donell [BZ #18665] diff --git a/NEWS b/NEWS index 53cf5a4..4aed159 100644 --- a/NEWS +++ b/NEWS @@ -10,7 +10,7 @@ Version 2.20.1 * The following bugs are resolved with this release: 16009, 16617, 16618, 17266, 17269, 17370, 17371, 17460, 17485, 17555, - 17625, 17630, 17801, 18032, 18665, 18694, 18928, 19018. + 17625, 17630, 17801, 18032, 18665, 18694, 18928, 19018, 19682. * A stack-based buffer overflow was found in libresolv when invoked from libnss_dns, allowing specially crafted DNS responses to seize control diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list index 5b8c102..9f03d26 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list @@ -12,22 +12,3 @@ shmget - shmget i:iii __shmget shmget semop - semop i:ipi __semop semop semget - semget i:iii __semget semget semctl - semctl i:iiii __semctl semctl - -# proper socket implementations: -accept - accept Ci:iBN __libc_accept __accept accept -bind - bind i:ipi __bind bind -connect - connect Ci:ipi __libc_connect __connect connect -getpeername - getpeername i:ipp __getpeername getpeername -getsockname - getsockname i:ipp __getsockname getsockname -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt -listen - listen i:ii __listen listen -recv - recv Ci:ibni __libc_recv __recv recv -recvfrom - recvfrom Ci:ibniBN __libc_recvfrom __recvfrom recvfrom -recvmsg - recvmsg Ci:ipi __libc_recvmsg __recvmsg recvmsg -send - send Ci:ibni __libc_send __send send -sendmsg - sendmsg Ci:ipi __libc_sendmsg __sendmsg sendmsg -sendto - sendto Ci:ibnibn __libc_sendto __sendto sendto -setsockopt - setsockopt i:iiibn __setsockopt setsockopt -shutdown - shutdown i:ii __shutdown shutdown -socket - socket i:iii __socket socket -socketpair - socketpair i:iiif __socketpair socketpair