This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-427-g2028f49


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, master has been updated
       via  2028f49dabb94bd56a85a7be16141bee4853aae6 (commit)
      from  361468f226cb99fdebd8fabb3d9428a3632dc2d1 (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2028f49dabb94bd56a85a7be16141bee4853aae6

commit 2028f49dabb94bd56a85a7be16141bee4853aae6
Author: Geoffrey Thomas <geofft@ldpreload.com>
Date:   Mon Oct 19 19:33:28 2015 +0530

    pt_chown: Clear any signal mask inherited from the parent process.
    
    If grantpt() is called from a thread that is masking signals (for
    instance, from a program using signalfd or using a dedicated
    signal-handling thread), then that mask will get inherited to pt_chown.
    This means that signals like SIGINT will not interrup pt_chown, so if it
    hangs (e.g., because getgrnam("tty") hangs on a remote name service),
    Ctrl-C will terminate the parent process but leave pt_chown around. Since
    it's setuid, it's hard to kill any other way.
    
    It is safe for pt_chown to unmask all signals, because grantpt() can be
    (and usually is) called from an unprivileged process with all signals
    unmasked.

diff --git a/ChangeLog b/ChangeLog
index 6b787dc..554384a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-19  Geoffrey Thomas  <geofft@ldpreload.com>
+
+	* login/programs/pt_chown.c: Include signal.h
+	(main): Clear any signal mask from the parent process.
+
 2015-10-19  Joseph Myers  <joseph@codesourcery.com>
 
 	* configure.ac (libc_cv_gnu89_inline): Remove configure test.
diff --git a/login/programs/pt_chown.c b/login/programs/pt_chown.c
index e8d4716..4f67af7 100644
--- a/login/programs/pt_chown.c
+++ b/login/programs/pt_chown.c
@@ -23,6 +23,7 @@
 #include <grp.h>
 #include <libintl.h>
 #include <locale.h>
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -148,6 +149,11 @@ main (int argc, char *argv[])
   uid_t euid = geteuid ();
   uid_t uid = getuid ();
   int remaining;
+  sigset_t signalset;
+
+  /* Clear any signal mask from the parent process.  */
+  sigemptyset (&signalset);
+  sigprocmask (SIG_SETMASK, &signalset, NULL);
 
   if (argc == 1 && euid == 0)
     {

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |    5 +++++
 login/programs/pt_chown.c |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]