1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Fix mq_notify socket, recv namespace (bug 18546).

mq_notify (in the 1996 edition of POSIX) brings in references to recv
and socket (not in POSIX until the 2001 edition).  This patch fixes
this by using __recv and __socket, exporting them from libc at version
GLIBC_PRIVATE.

Tested for x86_64 and x86 (testsuite and comparison of installed
stripped shared libraries; PLT / dynamic symbol table changes render
the comparison not particularly useful for libc).

	[BZ #18546]
	* socket/recv.c (__recv): Use libc_hidden_def.
	* socket/socket.c (__socket): Likewise.
	* sysdeps/mach/hurd/recv.c (__recv): Likewise.
	* sysdeps/mach/hurd/socket.c (__socket): Likewise.
	* sysdeps/unix/sysv/linux/generic/recv.c (__recv): Likewise.
	* sysdeps/unix/sysv/linux/recv.c (__recv): Use libc_hidden_weak.
	* sysdeps/unix/sysv/linux/socket.c (__socket): Use
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/x86_64/recv.c (__recv): Use
	libc_hidden_weak.
	* include/sys/socket.h (__socket): Do not use attribute_hidden.
	Use libc_hidden_proto.
	(__recv): Likewise.
	* socket/Versions (libc): Export __recv and __socket at version
	GLIBC_PRIVATE.
	* sysdeps/unix/sysv/linux/mq_notify.c (helper_thread): Call __recv
	instead of recv.
	(init_mq_netlink): Call __socket instead of socket.
	* conform/Makefile (test-xfail-POSIX/mqueue.h/linknamespace):
	Remove variable.
This commit is contained in:
Joseph Myers
2015-06-17 20:20:08 +00:00
parent dfa2d21450
commit 0595c98494
14 changed files with 39 additions and 8 deletions

View File

@ -117,8 +117,8 @@ helper_thread (void *arg)
{
union notify_data data;
ssize_t n = recv (netlink_socket, &data, sizeof (data),
MSG_NOSIGNAL | MSG_WAITALL);
ssize_t n = __recv (netlink_socket, &data, sizeof (data),
MSG_NOSIGNAL | MSG_WAITALL);
if (n < NOTIFY_COOKIE_LEN)
continue;
@ -157,7 +157,7 @@ init_mq_netlink (void)
if (netlink_socket == -1)
{
/* Just a normal netlink socket, not bound. */
netlink_socket = socket (AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, 0);
netlink_socket = __socket (AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, 0);
/* No need to do more if we have no socket. */
if (netlink_socket == -1)
return;