aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-04-08 20:28:00 +0000
committerUlrich Drepper <drepper@redhat.com>2006-04-08 20:28:00 +0000
commit7960f2a7040874c63196657fa25d6ddda778cc67 (patch)
tree7acbee73ed0428e433ee26dfd78ca5d6aa1512ee /nptl
parent0a21e40021389dd9beccafae597fd931e355f7cd (diff)
downloadglibc-7960f2a7040874c63196657fa25d6ddda778cc67.tar
glibc-7960f2a7040874c63196657fa25d6ddda778cc67.tar.gz
glibc-7960f2a7040874c63196657fa25d6ddda778cc67.tar.bz2
glibc-7960f2a7040874c63196657fa25d6ddda778cc67.zip
* nis/nis_ping.c: Remove unnecessary conditionals before
nis_freeresult calls. * nis/nis_ismember.c: Likewise.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog7
-rw-r--r--nptl/init.c20
2 files changed, 25 insertions, 2 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index b48319201e..f8dcc0ac33 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-08 Ulrich Drepper <drepper@redhat.com>
+
+ * init.c (sigcancel_handler): Compare with correct PID even if the
+ thread is in the middle of a fork call.
+ (sighandler_setxid): Likewise.
+ Reported by Suzuki K P <suzuki@in.ibm.com> .
+
2006-04-07 Jakub Jelinek <jakub@redhat.com>
* pthreadP.h (FUTEX_TID_MASK): Sync with kernel.
diff --git a/nptl/init.c b/nptl/init.c
index 4db3e0c828..7cfe803c42 100644
--- a/nptl/init.c
+++ b/nptl/init.c
@@ -148,6 +148,14 @@ static const struct pthread_functions pthread_functions =
static void
sigcancel_handler (int sig, siginfo_t *si, void *ctx)
{
+#ifdef __ASSUME_CORRECT_SI_PID
+ /* Determine the process ID. It might be negative if the thread is
+ in the middle of a fork() call. */
+ pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
+ if (__builtin_expect (pid < 0, 0))
+ pid = -pid;
+#endif
+
/* Safety check. It would be possible to call this function for
other signals and send a signal from another process. This is not
correct and might even be a security problem. Try to catch as
@@ -156,7 +164,7 @@ sigcancel_handler (int sig, siginfo_t *si, void *ctx)
#ifdef __ASSUME_CORRECT_SI_PID
/* Kernels before 2.5.75 stored the thread ID and not the process
ID in si_pid so we skip this test. */
- || si->si_pid != THREAD_GETMEM (THREAD_SELF, pid)
+ || si->si_pid != pid
#endif
|| si->si_code != SI_TKILL)
return;
@@ -201,6 +209,14 @@ struct xid_command *__xidcmd attribute_hidden;
static void
sighandler_setxid (int sig, siginfo_t *si, void *ctx)
{
+#ifdef __ASSUME_CORRECT_SI_PID
+ /* Determine the process ID. It might be negative if the thread is
+ in the middle of a fork() call. */
+ pid_t pid = THREAD_GETMEM (THREAD_SELF, pid);
+ if (__builtin_expect (pid < 0, 0))
+ pid = -pid;
+#endif
+
/* Safety check. It would be possible to call this function for
other signals and send a signal from another process. This is not
correct and might even be a security problem. Try to catch as
@@ -209,7 +225,7 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
#ifdef __ASSUME_CORRECT_SI_PID
/* Kernels before 2.5.75 stored the thread ID and not the process
ID in si_pid so we skip this test. */
- || si->si_pid != THREAD_GETMEM (THREAD_SELF, pid)
+ || si->si_pid != pid
#endif
|| si->si_code != SI_TKILL)
return;