This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, fedora/2.11/master, updated. fedora/glibc-2.11-3-32-g1c3fd10
- From: schwab at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 30 Nov 2009 14:51:45 -0000
- Subject: GNU C Library master sources branch, fedora/2.11/master, updated. fedora/glibc-2.11-3-32-g1c3fd10
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, fedora/2.11/master has been updated
via 1c3fd1077a0aa1ec441d3ae8a0e0046c484cab47 (commit)
via 488fb43a499982e99915c78bb70f04357ac37463 (commit)
via 20af204581e1ba42738c1bfb69cc2f5350f4ffa4 (commit)
via eab709096f23a4511adfc547450a83008eae5fb2 (commit)
via 64d61e9dc302aaa22000f9b03cce86d11a5e910d (commit)
via f3a93a0820949f67c95eda882e4f4331ad26accd (commit)
via 8757dec424e2fc887623104565243bdd66cd609b (commit)
via 8d7c09b162cd1687e21549f9aaaa3d4a9b39735c (commit)
via 1bc1954c735788ae9e7f954e18cf39a22f964d06 (commit)
via 16b583ea7ec0b96c8908e6c5418836f74554329a (commit)
via 488e337a17866ebdb9ca6a07f91fc9fcf9f1c3db (commit)
via b12103e146512f80531ccced34ec8f106d3cec66 (commit)
via c35a44f325843a4b6fb3bc53526bcc1f741c8254 (commit)
via 1960ded78b85a1661d847c4b071c62915635a761 (commit)
via b39591e9c1c156a080563d60450d5fdb7971457c (commit)
via c086031db01cc10bafe55864b1185c111a30198e (commit)
via 22bdb3aa5b2cd760fd3bf1ee6c46c61e23457876 (commit)
via c0ca09284eedec057b9036eb319be7e30442df04 (commit)
via c78e33c312e16a4faccf07278d45538f0252058f (commit)
via 3e224a852a7109e2efa1f07f15962235d12b7e63 (commit)
via dc2d2c7e915b0add3755d41bcd0739ed0e69c5d3 (commit)
via 51e4196f16a2d98377e3c481a44e133369dc7669 (commit)
via 6515a01fc1d35d329886d5a45435537ee9115bc4 (commit)
via 639d6699e9943c393f5fb5a9b84ab24e20bb7a93 (commit)
via 868f7a4053502783ab0348736230f093a78f3d46 (commit)
via 685cb08356bb9408c50970711ba3f4726e95b638 (commit)
via 8608ae1f7ba31f2149f9620a1339020339eac00d (commit)
via 5b55d23611e939340d658f42212c474c8188053e (commit)
via 872873d48d5d96879a2dd8c249e688e73a5dd554 (commit)
via 34df851b3364e14133b865574dbc5f2a8b88874e (commit)
via 13f6812ffb5b8ad8c343d49e0be7e5ae0d31dc8e (commit)
via cc49a5a8837be1f9307b167d9bf4399798a847c9 (commit)
from 475180202607e851de60bc62cc25524c9d6c52ed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1c3fd1077a0aa1ec441d3ae8a0e0046c484cab47
commit 1c3fd1077a0aa1ec441d3ae8a0e0046c484cab47
Author: Andreas Schwab <schwab@redhat.com>
Date: Mon Nov 30 13:31:17 2009 +0100
2.11-4
diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index c099a40..76c0809 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -25,7 +25,7 @@
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
-Release: 3
+Release: 4
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
# Things that are linked directly into dynamically linked programs
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -1034,6 +1034,22 @@ rm -f *.filelist*
%endif
%changelog
+* Mon Nov 30 2009 Andreas Schwab <schwab@redhat.com> - 2.11-4
+- Update from 2.11 branch
+ - Fix sync_file_range on ppc/ppc64.
+ - Fix getwc* and putwc* on non-wide streams (BZ#10958).
+ - Avoid warnings in CPU_* macros when using const bitsets (BZ#10918).
+ - Fix ranges with multibyte characters as endpoints.
+ - Handle LC_GLOBAL_LOCALE in duplocale (BZ#10969).
+ - Fix _NC_LOCALE_NAME definition (BZ#10968).
+ - Add missing Linux MADV_* definitions (BZ#10972).
+ - Handle running out of buffer space with IPv6 mapping enabled.
+ - Avoid memset warning in one case (#532492).
+ - Restore locking in free_check (#504963).
+- Fix infloop in __pthread_disable_asynccancel on x86_64 (#537690).
+- Prevent unintended file desriptor leak in grantpt (#530558).
+- Fix startup to security-relevant statically linked binaries (#528631).
+
* Tue Nov 24 2009 Andreas Schwab <schwab@redhat.com> - 2.11-3
- Enable multi-arch support for ppc and ppc64 on RHEL-6
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=488fb43a499982e99915c78bb70f04357ac37463
commit 488fb43a499982e99915c78bb70f04357ac37463
Merge: eab7090 20af204
Author: Andreas Schwab <schwab@redhat.com>
Date: Mon Nov 30 14:53:29 2009 +0100
Merge branch 'release/2.11/master' into fedora/2.11/master
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=20af204581e1ba42738c1bfb69cc2f5350f4ffa4
commit 20af204581e1ba42738c1bfb69cc2f5350f4ffa4
Author: Andreas Schwab <schwab@redhat.com>
Date: Fri Nov 27 21:37:30 2009 -0800
Fix infloop in __pthread_disable_asynccancel on x86_64
(cherry picked from commit b55ec98c6490b944593243c7da54dda1796e3f84)
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 0aaaa3f..08a55ee 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-27 Andreas Schwab <schwab@redhat.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/cancellation.S: Reload
+ THREAD_SELF->cancelhandling after returning from futex call.
+
2009-11-03 Andreas Schwab <schwab@linux-m68k.org>
[BZ #4457]
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
index 0d48ec6..6806962 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S
@@ -96,8 +96,8 @@ ENTRY(__pthread_disable_asynccancel)
cmpxchgl %r11d, %fs:CANCELHANDLING
jnz 2b
-3: movl %r11d, %eax
- andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
+ movl %r11d, %eax
+3: andl $(TCB_CANCELING_BITMASK|TCB_CANCELED_BITMASK), %eax
cmpl $TCB_CANCELING_BITMASK, %eax
je 4f
1: ret
@@ -111,5 +111,6 @@ ENTRY(__pthread_disable_asynccancel)
addq $CANCELHANDLING, %rdi
LOAD_PRIVATE_FUTEX_WAIT (%esi)
syscall
+ movl %fs:CANCELHANDLING, %eax
jmp 3b
END(__pthread_disable_asynccancel)
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=eab709096f23a4511adfc547450a83008eae5fb2
commit eab709096f23a4511adfc547450a83008eae5fb2
Author: Andreas Schwab <schwab@redhat.com>
Date: Tue Nov 24 16:24:07 2009 +0100
Re-install F_[GS]ETOWN_EX changes
diff --git a/ChangeLog b/ChangeLog
index 19a8e2f..aaa01cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -233,6 +233,22 @@ d2009-10-30 Ulrich Drepper <drepper@redhat.com>
* sysdeps/generic/netinet/ip.h: Define IPTOS_ENC* and IPTOS_DSCP*
macros. Patch by Philip Prindeville <philipp@redfish-solutions.com>.
+ [BZ #10840]
+ * sysdeps/unix/sysv/linux/kernel-features.h: Define
+ __ASSUME_F_GETOWN_EX.
+ * sysdeps/unix/sysv/linux/fcntl.c: Implement F_GETOWN using F_GETOWN_EX
+ if possible.
+ * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
+
+ * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Define F_OWNER_*
+ and f_owner_ex.
+ * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+
[BZ #10847]
* sysdeps/gnu/getutmp.c: Allow compatibility code to play around with
getutmpx symbol.
@@ -320,6 +336,17 @@ d2009-10-30 Ulrich Drepper <drepper@redhat.com>
* locale/C-time.c: Revert week-1stday back to 19971130 and set
first_weekday to 1 and first_workday to 2.
+2009-10-01 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Define F_SETOWN_EX and
+ F_GETOWN_EX.
+ * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+
2009-09-28 Andreas Schwab <schwab@redhat.com>
* stdio-common/printf_fp.c: Check for and avoid integer overflows.
diff --git a/sysdeps/unix/sysv/linux/fcntl.c b/sysdeps/unix/sysv/linux/fcntl.c
index 1f5aca1..b19654c 100644
--- a/sysdeps/unix/sysv/linux/fcntl.c
+++ b/sysdeps/unix/sysv/linux/fcntl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,6 +23,40 @@
#include <stdarg.h>
#include <sys/syscall.h>
+#include <kernel-features.h>
+
+
+#ifdef __ASSUME_F_GETOWN_EX
+# define miss_F_GETOWN_EX 0
+#else
+static int miss_F_GETOWN_EX;
+#endif
+
+
+static int
+do_fcntl (int fd, int cmd, void *arg)
+{
+ if (cmd != F_GETOWN || miss_F_GETOWN_EX)
+ return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+
+ INTERNAL_SYSCALL_DECL (err);
+ struct f_owner_ex fex;
+ int res = INTERNAL_SYSCALL (fcntl, err, 3, fd, F_GETOWN_EX, &fex);
+ if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+ return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
+
+#ifndef __ASSUME_F_GETOWN_EX
+ if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
+ {
+ res = INLINE_SYSCALL (fcntl, 3, fd, F_GETOWN, arg);
+ miss_F_GETOWN_EX = 1;
+ return res;
+ }
+#endif
+
+ __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+ return -1;
+}
#ifndef NO_CANCELLATION
@@ -36,7 +70,7 @@ __fcntl_nocancel (int fd, int cmd, ...)
arg = va_arg (ap, void *);
va_end (ap);
- return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+ return do_fcntl (fd, cmd, arg);
}
#endif
@@ -52,11 +86,11 @@ __libc_fcntl (int fd, int cmd, ...)
va_end (ap);
if (SINGLE_THREAD_P || cmd != F_SETLKW)
- return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+ return do_fcntl (fd, cmd, arg);
int oldtype = LIBC_CANCEL_ASYNC ();
- int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+ int result = do_fcntl (fd, cmd, arg);
LIBC_CANCEL_RESET (oldtype);
diff --git a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
index 35dfb29..6a38dc0 100644
--- a/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/i386/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -85,13 +85,15 @@
#define F_SETLKW64 14 /* Set record locking info (blocking). */
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
-# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
+# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
@@ -166,6 +168,23 @@ struct flock64
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
diff --git a/sysdeps/unix/sysv/linux/i386/fcntl.c b/sysdeps/unix/sysv/linux/i386/fcntl.c
index b27373d..5544d6e 100644
--- a/sysdeps/unix/sysv/linux/i386/fcntl.c
+++ b/sysdeps/unix/sysv/linux/i386/fcntl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000,2002,2003,2004,2006,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,6 +30,13 @@
int __have_no_fcntl64;
#endif
+#ifdef __ASSUME_F_GETOWN_EX
+# define miss_F_GETOWN_EX 0
+#else
+static int miss_F_GETOWN_EX;
+#endif
+
+
#if defined NO_CANCELLATION && __ASSUME_FCNTL64 == 0
# define __fcntl_nocancel __libc_fcntl
#endif
@@ -119,6 +126,26 @@ __fcntl_nocancel (int fd, int cmd, ...)
assert (F_SETLK - F_SETLKW == F_SETLK64 - F_SETLKW64);
return INLINE_SYSCALL (fcntl, 3, fd, cmd + F_SETLK - F_SETLK64, &fl);
}
+ case F_GETOWN:
+ if (! miss_F_GETOWN_EX)
+ {
+ INTERNAL_SYSCALL_DECL (err);
+ struct f_owner_ex fex;
+ int res = INTERNAL_SYSCALL (fcntl, err, 3, fd, F_GETOWN_EX, &fex);
+ if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+ return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
+
+#ifndef __ASSUME_F_GETOWN_EX
+ if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
+ miss_F_GETOWN_EX = 1;
+ else
+#endif
+ {
+ __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+ return -1;
+ }
+ }
+ /* FALLTHROUGH */
default:
return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
}
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
index 92b96bd..9a0245a 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/IA64.
- Copyright (C) 1999, 2000, 2004, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999,2000,2004,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -81,13 +81,15 @@
#define F_SETLKW64 7 /* Set record locking info (blocking). */
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
-# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
+# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
@@ -159,6 +161,23 @@ struct flock64
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index ff065ef..f48e644 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -542,3 +542,8 @@
# define __ASSUME_PREADV 1
# define __ASSUME_PWRITEV 1
#endif
+
+/* Support for F_GETOWN_EX was introduced in 2.6.32. */
+#if __LINUX_KERNEL_VERSION >= 0x020620
+# define __ASSUME_F_GETOWN_EX 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
index 493d5cb..6c4b66b 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/PowerPC.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -85,13 +85,15 @@
#define F_SETLKW64 14 /* Set record locking info (blocking). */
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
-# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
+# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
@@ -166,6 +168,23 @@ struct flock64
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
index 54c4c52..d3dddbc 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 2000,2001,2002,2004,2006,2007 Free Software Foundation, Inc.
+ Copyright (C) 2000,2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -100,13 +100,15 @@
#endif
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
-# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
+# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
@@ -181,6 +183,23 @@ struct flock64
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
diff --git a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
index 35dfb29..d7a21ea 100644
--- a/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sh/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -85,13 +85,15 @@
#define F_SETLKW64 14 /* Set record locking info (blocking). */
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
-# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
+# define F_SETOWN_EX 12 /* Get owner (thread receiving of SIGIO). */
+# define F_GETOWN_EX 13 /* Set owner (thread receiving of SIGIO). */
#endif
#ifdef __USE_GNU
@@ -166,6 +168,23 @@ struct flock64
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index 56d9c00..dfa848a 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/SPARC.
- Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
+ Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -83,8 +83,8 @@
#define F_GETFL 3 /* Get file status flags. */
#define F_SETFL 4 /* Set file status flags. */
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_GETOWN 5 /* Get owner of socket (receiver of SIGIO). */
-# define F_SETOWN 6 /* Set owner of socket (receiver of SIGIO). */
+# define F_GETOWN 5 /* Get owner (process receiving SIGIO). */
+# define F_SETOWN 6 /* Set owner (process receiving SIGIO). */
#endif
#ifndef __USE_FILE_OFFSET64
# define F_GETLK 7 /* Get record locking info. */
@@ -99,6 +99,8 @@
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
+# define F_GETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
+# define F_SETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
@@ -185,6 +187,23 @@ struct flock64
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
index 1d68a20..c3eb859 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/x86-64.
- Copyright (C) 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -99,13 +99,15 @@
#endif
#if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
-# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+# define F_SETOWN 8 /* Get owner (process receiving of SIGIO). */
+# define F_GETOWN 9 /* Set owner (process receiving of SIGIO). */
#endif
#ifdef __USE_GNU
# define F_SETSIG 10 /* Set number of signal to be sent. */
# define F_GETSIG 11 /* Get number of signal to be sent. */
+# define F_SETOWN_EX 12 /* Get owner (thread receiving SIGIO). */
+# define F_GETOWN_EX 13 /* Set owner (thread receiving SIGIO). */
#endif
#ifdef __USE_GNU
@@ -180,6 +182,23 @@ struct flock64
};
#endif
+#ifdef __USE_GNU
+/* Owner types. */
+enum __pid_type
+ {
+ F_OWNER_TID = 0, /* Kernel thread. */
+ F_OWNER_PID, /* Process. */
+ F_OWNER_GID /* Process group. */
+ };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX. */
+struct f_owner_ex
+ {
+ enum __pid_type type; /* Owner type of ID. */
+ __pid_t pid; /* ID of owner. */
+ };
+#endif
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
#ifdef __USE_BSD
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=64d61e9dc302aaa22000f9b03cce86d11a5e910d
commit 64d61e9dc302aaa22000f9b03cce86d11a5e910d
Author: Ulrich Drepper <drepper@redhat.com>
Date: Tue Nov 24 18:47:26 2009 -0800
Avoid local PLTs.
(cherry picked from commit 0f622686af3ae5a8f03dae886b08c260b38bda16)
diff --git a/sysdeps/unix/sysv/linux/grantpt.c b/sysdeps/unix/sysv/linux/grantpt.c
index 6305ed4..f2fc60f 100644
--- a/sysdeps/unix/sysv/linux/grantpt.c
+++ b/sysdeps/unix/sysv/linux/grantpt.c
@@ -15,11 +15,11 @@
static void
close_all_fds (void)
{
- DIR *dir = opendir ("/proc/self/fd");
+ DIR *dir = __opendir ("/proc/self/fd");
if (dir != NULL)
{
struct dirent64 *d;
- while ((d = readdir64 (dir)) != NULL)
+ while ((d = __readdir64 (dir)) != NULL)
if (isdigit (d->d_name[0]))
{
char *endp;
@@ -28,7 +28,7 @@ close_all_fds (void)
close_not_cancel_no_status (fd);
}
- closedir (dir);
+ __closedir (dir);
int nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_RDONLY);
assert (nullfd == STDIN_FILENO);
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f3a93a0820949f67c95eda882e4f4331ad26accd
commit f3a93a0820949f67c95eda882e4f4331ad26accd
Author: Andreas Schwab <schwab@redhat.com>
Date: Wed Nov 25 14:04:18 2009 +0100
Prevent unintended file desriptor leak in grantpt.
The pt_chown program is completely transparently called. It might
not be able to live with the various file descriptors the program
has open at the time of the call (e.g., under SELinux). Close all
but the needed descriptor and connect stdin, stdout, and stderr
with /dev/null. pt_chown shouldn't print anything when called to
do real work.
(cherry picked from commit 139ee080b6b428240bf49f3e6361f3ac729f891a)
diff --git a/ChangeLog b/ChangeLog
index 3cae5d1..93c511c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-11-24 Ulrich Drepper <drepper@redhat.com>
+ * sysdeps/unix/grantpt.c (grantpt): Use CLOSE_ALL_FDS is available
+ before the exec.
+ * sysdeps/unix/sysv/linux/grantpt.c: New file.
+ * login/programs/pt_chown.c (main): Don't print message on errors
+ when doing real work.
+
* csu/elf-init.c (__libc_csu_irel): New function. Code to perform
irel relocations split out from...
(__libc_csu_init): ...here.
diff --git a/login/programs/pt_chown.c b/login/programs/pt_chown.c
index 7e279a5..4c36f2c 100644
--- a/login/programs/pt_chown.c
+++ b/login/programs/pt_chown.c
@@ -154,8 +154,7 @@ main (int argc, char *argv[])
# define ncap_list (sizeof (cap_list) / sizeof (cap_list[0]))
cap_t caps = cap_init ();
if (caps == NULL)
- error (FAIL_ENOMEM, errno,
- _("Failed to initialize drop of capabilities"));
+ return FAIL_ENOMEM;
/* There is no reason why these should not work. */
cap_set_flag (caps, CAP_PERMITTED, ncap_list, cap_list, CAP_SET);
@@ -166,7 +165,7 @@ main (int argc, char *argv[])
cap_free (caps);
if (__builtin_expect (res != 0, 0))
- error (FAIL_EXEC, errno, _("cap_set_proc failed"));
+ return FAIL_EXEC;
}
#endif
diff --git a/sysdeps/unix/grantpt.c b/sysdeps/unix/grantpt.c
index 8c299e9..b02bf7c 100644
--- a/sysdeps/unix/grantpt.c
+++ b/sysdeps/unix/grantpt.c
@@ -190,6 +190,10 @@ grantpt (int fd)
if (__dup2 (fd, PTY_FILENO) < 0)
_exit (FAIL_EBADF);
+#ifdef CLOSE_ALL_FDS
+ CLOSE_ALL_FDS ();
+#endif
+
execle (_PATH_PT_CHOWN, basename (_PATH_PT_CHOWN), NULL, NULL);
_exit (FAIL_EXEC);
}
diff --git a/sysdeps/unix/sysv/linux/grantpt.c b/sysdeps/unix/sysv/linux/grantpt.c
new file mode 100644
index 0000000..6305ed4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/grantpt.c
@@ -0,0 +1,42 @@
+#include <assert.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "not-cancel.h"
+#include "pty-private.h"
+
+
+/* Close all file descriptors except the one specified. */
+static void
+close_all_fds (void)
+{
+ DIR *dir = opendir ("/proc/self/fd");
+ if (dir != NULL)
+ {
+ struct dirent64 *d;
+ while ((d = readdir64 (dir)) != NULL)
+ if (isdigit (d->d_name[0]))
+ {
+ char *endp;
+ long int fd = strtol (d->d_name, &endp, 10);
+ if (*endp == '\0' && fd != PTY_FILENO && fd != dirfd (dir))
+ close_not_cancel_no_status (fd);
+ }
+
+ closedir (dir);
+
+ int nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_RDONLY);
+ assert (nullfd == STDIN_FILENO);
+ nullfd = open_not_cancel_2 (_PATH_DEVNULL, O_WRONLY);
+ assert (nullfd == STDOUT_FILENO);
+ __dup2 (STDOUT_FILENO, STDERR_FILENO);
+ }
+}
+#define CLOSE_ALL_FDS() close_all_fds()
+
+#include <sysdeps/unix/grantpt.c>
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8757dec424e2fc887623104565243bdd66cd609b
commit 8757dec424e2fc887623104565243bdd66cd609b
Author: Ulrich Drepper <drepper@redhat.com>
Date: Tue Nov 24 11:17:06 2009 -0800
Fix startup to security-relevant statically linked binaries.
Before the change they crash on startup. Perform IREL relocations
earlier to prevent this.
(cherry picked from commit 1c3c269b55c84c29ec1e2c70f122c5e33fef4257)
diff --git a/ChangeLog b/ChangeLog
index e0fd11c..3cae5d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-24 Ulrich Drepper <drepper@redhat.com>
+
+ * csu/elf-init.c (__libc_csu_irel): New function. Code to perform
+ irel relocations split out from...
+ (__libc_csu_init): ...here.
+ * csu/libc-start.c [!SHARED]: Call __libc_csu_irel early.
+
2009-11-18 H.J. Lu <hongjiu.lu@intel.com>
[BZ #10162]
diff --git a/csu/elf-init.c b/csu/elf-init.c
index 1d2df62..1e3d6d6 100644
--- a/csu/elf-init.c
+++ b/csu/elf-init.c
@@ -72,15 +72,14 @@ extern void _fini (void);
/* These functions are passed to __libc_start_main by the startup code.
These get statically linked into each program. For dynamically linked
programs, this module will come from libc_nonshared.a and differs from
- the libc.a module in that it doesn't call the preinit array. */
+ the libc.a module in that it doesn't call the preinit array and performs
+ explicit IREL{,A} relocations. */
-void
-__libc_csu_init (int argc, char **argv, char **envp)
-{
- /* For dynamically linked executables the preinit array is executed by
- the dynamic linker (before initializing any shared object. */
#ifndef LIBC_NONSHARED
+void
+__libc_csu_irel (void)
+{
# ifdef USE_MULTIARCH
# ifdef ELF_MACHINE_IRELA
{
@@ -98,7 +97,17 @@ __libc_csu_init (int argc, char **argv, char **envp)
}
# endif
# endif
+}
+#endif
+
+void
+__libc_csu_init (int argc, char **argv, char **envp)
+{
+ /* For dynamically linked executables the preinit array is executed by
+ the dynamic linker (before initializing any shared object. */
+
+#ifndef LIBC_NONSHARED
/* For static executables, preinit happens right before init. */
{
const size_t size = __preinit_array_end - __preinit_array_start;
diff --git a/csu/libc-start.c b/csu/libc-start.c
index 80b672f..dc7ca55 100644
--- a/csu/libc-start.c
+++ b/csu/libc-start.c
@@ -24,6 +24,9 @@
#include <bp-sym.h>
extern void __libc_init_first (int argc, char **argv, char **envp);
+#ifndef SHARED
+extern void __libc_csu_irel (void);
+#endif
extern int __libc_multiple_libcs;
@@ -134,6 +137,9 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
}
# endif
+ /* Performe IREL{,A} relocations. */
+ __libc_csu_irel ();
+
/* Initialize the thread library at least a bit since the libgcc
functions are using thread functions if these are available and
we need to setup errno. */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 169 +++++++++++++++++++-
csu/elf-init.c | 21 ++-
csu/libc-start.c | 6 +
elf/dl-sym.c | 9 +-
elf/ifuncmain3.c | 9 +
fedora/glibc.spec.in | 18 ++-
libio/libio.h | 14 +-
locale/Makefile | 6 +-
locale/duplocale.c | 6 +-
locale/langinfo.h | 3 +-
locale/tst-duplocale.c | 14 ++
locale/tst-locname.c | 20 +++
login/programs/pt_chown.c | 5 +-
malloc/hooks.c | 37 +++--
malloc/memusagestat.c | 2 +-
nptl/ChangeLog | 12 ++
nptl/sysdeps/pthread/unwind-forcedunwind.c | 5 +-
nptl/sysdeps/pthread/unwind-resume.c | 5 +-
nptl/sysdeps/unix/sysv/linux/x86_64/cancellation.S | 5 +-
posix/Makefile | 3 +-
posix/bug-regex29.c | 1 +
posix/bug-regex30.c | 103 ++++++++++++
posix/regcomp.c | 2 +-
resolv/mapv4v6hostent.h | 12 +-
resolv/nss_dns/dns-host.c | 6 +-
string/bits/string3.h | 5 +-
sysdeps/generic/framestate.c | 3 +-
sysdeps/generic/libgcc_s.h | 2 +
sysdeps/ia64/memchr.S | 11 ++-
sysdeps/powerpc/fpu/e_sqrt.c | 6 +-
sysdeps/powerpc/fpu/e_sqrtf.c | 6 +-
sysdeps/unix/grantpt.c | 4 +
sysdeps/unix/sysv/linux/bits/sched.h | 12 +-
sysdeps/unix/sysv/linux/fcntl.c | 42 +++++-
sysdeps/unix/sysv/linux/grantpt.c | 42 +++++
sysdeps/unix/sysv/linux/i386/bits/fcntl.h | 25 +++-
sysdeps/unix/sysv/linux/i386/bits/mman.h | 21 ++-
sysdeps/unix/sysv/linux/i386/fallocate.c | 6 +
sysdeps/unix/sysv/linux/i386/fallocate64.c | 6 +
sysdeps/unix/sysv/linux/i386/fcntl.c | 29 ++++-
sysdeps/unix/sysv/linux/ia64/bits/fcntl.h | 25 +++-
sysdeps/unix/sysv/linux/ia64/bits/mman.h | 22 ++-
sysdeps/unix/sysv/linux/kernel-features.h | 5 +
sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h | 25 +++-
sysdeps/unix/sysv/linux/powerpc/bits/mman.h | 22 ++-
.../sysv/linux/powerpc/powerpc64/sync_file_range.c | 44 +++++
sysdeps/unix/sysv/linux/s390/bits/fcntl.h | 25 +++-
sysdeps/unix/sysv/linux/s390/bits/mman.h | 21 ++-
sysdeps/unix/sysv/linux/sh/bits/fcntl.h | 25 +++-
sysdeps/unix/sysv/linux/sh/bits/mman.h | 22 ++-
sysdeps/unix/sysv/linux/sparc/bits/fcntl.h | 25 +++-
sysdeps/unix/sysv/linux/sparc/bits/mman.h | 24 ++--
sysdeps/unix/sysv/linux/sync_file_range.c | 10 +-
sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h | 25 +++-
sysdeps/unix/sysv/linux/x86_64/bits/mman.h | 21 ++-
55 files changed, 883 insertions(+), 171 deletions(-)
create mode 100644 locale/tst-duplocale.c
create mode 100644 locale/tst-locname.c
create mode 100644 posix/bug-regex30.c
create mode 100644 sysdeps/generic/libgcc_s.h
create mode 100644 sysdeps/unix/sysv/linux/grantpt.c
create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
hooks/post-receive
--
GNU C Library master sources