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.27.9000-247-gd39c0a4


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  d39c0a459ef32a41daac4840859bf304d931adab (commit)
       via  cc8a1620eb97ccddd337d157263c13c57b39ab71 (commit)
      from  8bfd94d0dc9a3e0140f084ef301749846ac6d5d3 (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=d39c0a459ef32a41daac4840859bf304d931adab

commit d39c0a459ef32a41daac4840859bf304d931adab
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Mar 27 21:23:52 2018 -0300

    sparc: Fix arch_fork definition
    
    This patch fixes 3dc214977 for sparc.  Different than other architectures
    SPARC kernel Kconfig does not define CONFIG_CLONE_BACKWARDS, however it
    has the same ABI as if it did, implemented by sparc-specific code
    (sparc_do_fork).
    
    It also has a unique return value convention for clone:
    
       Parent -->  %o0 == child's  pid, %o1 == 0
       Child  -->  %o0 == parent's pid, %o1 == 1
    
    Which required a special macro to correct issue the syscall
    (INLINE_CLONE_SYSCALL).
    
    Checked on sparc64-linux-gnu and sparcv9-linux-gnu.
    
    	* sysdeps/unix/sysv/linux/arch-fork.h [__ASSUME_CLONE_BACKWARDS]
    	(arch_fork): Issue INLINE_CLONE_SYSCALL if defined.
    	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
    	(__ASSUME_CLONE_BACKWARDS): Define.

diff --git a/ChangeLog b/ChangeLog
index 7f2044d..6412367 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-03-27  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+	* sysdeps/unix/sysv/linux/arch-fork.h [__ASSUME_CLONE_BACKWARDS]
+	(arch_fork): Issue INLINE_CLONE_SYSCALL if defined.
+	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
+	(__ASSUME_CLONE_BACKWARDS): Define.
+
 2018-03-27  Jesse Hathaway  <jesse@mbuki-mvuki.org>
 
 	* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Return
diff --git a/sysdeps/unix/sysv/linux/arch-fork.h b/sysdeps/unix/sysv/linux/arch-fork.h
index 3daa965..046d9fc 100644
--- a/sysdeps/unix/sysv/linux/arch-fork.h
+++ b/sysdeps/unix/sysv/linux/arch-fork.h
@@ -34,7 +34,11 @@ arch_fork (void *ctid)
   const int flags = CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD;
   long int ret;
 #ifdef __ASSUME_CLONE_BACKWARDS
+# ifdef INLINE_CLONE_SYSCALL
+  ret = INLINE_CLONE_SYSCALL (flags, 0, NULL, 0, ctid);
+# else
   ret = INLINE_SYSCALL_CALL (clone, flags, 0, NULL, 0, ctid);
+# endif
 #elif defined(__ASSUME_CLONE_BACKWARDS2)
   ret = INLINE_SYSCALL_CALL (clone, 0, flags, NULL, ctid, 0);
 #elif defined(__ASSUME_CLONE_BACKWARDS3)
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index 2fd12cb..64d7140 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -40,3 +40,17 @@
 
 /* sparc only supports ipc syscall.  */
 #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+
+/* SPARC kernel Kconfig does not define CONFIG_CLONE_BACKWARDS, however it
+   has the same ABI as if it did, implemented by sparc-specific code
+   (sparc_do_fork).
+
+   It also has a unique return value convention:
+
+     Parent -->  %o0 == child's  pid, %o1 == 0
+     Child  -->  %o0 == parent's pid, %o1 == 1
+
+   Which required a special macro to correct issue the syscall
+   (INLINE_CLONE_SYSCALL).  */
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS	1

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cc8a1620eb97ccddd337d157263c13c57b39ab71

commit cc8a1620eb97ccddd337d157263c13c57b39ab71
Author: Jesse Hathaway <jesse@mbuki-mvuki.org>
Date:   Tue Mar 27 21:17:59 2018 +0000

    getlogin_r: return early when linux sentinel value is set
    
    When there is no login uid Linux sets /proc/self/loginid to the sentinel
    value of, (uid_t) -1. If this is set we can return early and avoid
    needlessly looking up the sentinel value in any configured nss
    databases.
    
    Checked on aarch64-linux-gnu.
    
    	* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Return
    	early when linux sentinel value is set.
    
    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

diff --git a/ChangeLog b/ChangeLog
index e6fe2aa..7f2044d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-27  Jesse Hathaway  <jesse@mbuki-mvuki.org>
+
+	* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Return
+	early when linux sentinel value is set.
+
 2018-03-27  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* sysdeps/mach/hurd/bits/posix_opt.h (_POSIX_MEMLOCK): Define.
diff --git a/sysdeps/unix/sysv/linux/getlogin_r.c b/sysdeps/unix/sysv/linux/getlogin_r.c
index 73ea14c..1458771 100644
--- a/sysdeps/unix/sysv/linux/getlogin_r.c
+++ b/sysdeps/unix/sysv/linux/getlogin_r.c
@@ -55,6 +55,15 @@ __getlogin_r_loginuid (char *name, size_t namesize)
 	  endp == uidbuf || *endp != '\0'))
     return -1;
 
+  /* If there is no login uid, linux sets /proc/self/loginid to the sentinel
+     value of, (uid_t) -1, so check if that value is set and return early to
+     avoid making unneeded nss lookups. */
+  if (uid == (uid_t) -1)
+    {
+      __set_errno (ENXIO);
+      return ENXIO;
+    }
+
   struct passwd pwd;
   struct passwd *tpwd;
   int result = 0;

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

Summary of changes:
 ChangeLog                                       |   12 ++++++++++++
 sysdeps/unix/sysv/linux/arch-fork.h             |    4 ++++
 sysdeps/unix/sysv/linux/getlogin_r.c            |    9 +++++++++
 sysdeps/unix/sysv/linux/sparc/kernel-features.h |   14 ++++++++++++++
 4 files changed, 39 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]