Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src Pull up following revision(s) (requested by joerg in tick...



details:   https://anonhg.NetBSD.org/src/rev/4615cb538ff7
branches:  netbsd-9
changeset: 843703:4615cb538ff7
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Dec 18 20:20:17 2019 +0000

description:
Pull up following revision(s) (requested by joerg in ticket #572):

        sys/kern/uipc_sem.c: revision 1.56
        lib/libc/gen/sysconf.c: revision 1.43

PR 54619: Remove semaphore limit introduce as part of GSoC 2016 with
_SC_SEM_NSEMS_MAX. Report no limit for getconf(3). The ressource is
naturally limited by the backing file descriptor, so no separate limit
is necessary. Keep the accounting for debugging as it is part of the
sysctl ABI exposed by the kernel.

diffstat:

 lib/libc/gen/sysconf.c |   6 +++---
 sys/kern/uipc_sem.c    |  14 +++-----------
 2 files changed, 6 insertions(+), 14 deletions(-)

diffs (69 lines):

diff -r 82f28f0ecdf2 -r 4615cb538ff7 lib/libc/gen/sysconf.c
--- a/lib/libc/gen/sysconf.c    Wed Dec 18 20:18:20 2019 +0000
+++ b/lib/libc/gen/sysconf.c    Wed Dec 18 20:20:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysconf.c,v 1.41 2016/08/04 06:43:43 christos Exp $    */
+/*     $NetBSD: sysconf.c,v 1.41.16.1 2019/12/18 20:20:17 martin Exp $ */
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)sysconf.c  8.2 (Berkeley) 3/20/94";
 #else
-__RCSID("$NetBSD: sysconf.c,v 1.41 2016/08/04 06:43:43 christos Exp $");
+__RCSID("$NetBSD: sysconf.c,v 1.41.16.1 2019/12/18 20:20:17 martin Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -422,7 +422,7 @@
        case _SC_TIMER_MAX:
                return _POSIX_TIMER_MAX;
        case _SC_SEM_NSEMS_MAX:
-               return _POSIX_SEM_NSEMS_MAX;
+               return LONG_MAX;
        case _SC_CPUTIME:
                return _POSIX_CPUTIME;
        case _SC_THREAD_CPUTIME:
diff -r 82f28f0ecdf2 -r 4615cb538ff7 sys/kern/uipc_sem.c
--- a/sys/kern/uipc_sem.c       Wed Dec 18 20:18:20 2019 +0000
+++ b/sys/kern/uipc_sem.c       Wed Dec 18 20:20:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_sem.c,v 1.55 2019/03/01 03:03:19 christos Exp $   */
+/*     $NetBSD: uipc_sem.c,v 1.55.4.1 2019/12/18 20:20:17 martin Exp $ */
 
 /*-
  * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_sem.c,v 1.55 2019/03/01 03:03:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_sem.c,v 1.55.4.1 2019/12/18 20:20:17 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -92,7 +92,6 @@
 
 #define        SEM_MAX_NAMELEN         NAME_MAX
 
-#define        SEM_NSEMS_MAX           256
 #define        KS_UNLINKED             0x01
 
 static kmutex_t                ksem_lock       __cacheline_aligned;
@@ -468,14 +467,7 @@
                len = 0;
        }
 
-       u_int cnt;
-       uid_t uid = kauth_cred_getuid(l->l_cred);
-       if ((cnt = chgsemcnt(uid, 1)) > SEM_NSEMS_MAX) {
-               chgsemcnt(uid, -1);
-               if (kname != NULL)
-                       kmem_free(kname, len);
-               return ENOSPC;
-       }
+       chgsemcnt(kauth_cred_getuid(l->l_cred), 1);
 
        ks = kmem_zalloc(sizeof(ksem_t), KM_SLEEP);
        mutex_init(&ks->ks_lock, MUTEX_DEFAULT, IPL_NONE);



Home | Main Index | Thread Index | Old Index