Source-Changes-HG archive

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

[src/trunk]: src/sys/kern prevent sa_setconcurrency before sa_enable, rather ...



details:   https://anonhg.NetBSD.org/src/rev/e1c0506fbc83
branches:  trunk
changeset: 584032:e1c0506fbc83
user:      yamt <yamt%NetBSD.org@localhost>
date:      Mon Sep 05 21:52:38 2005 +0000

description:
prevent sa_setconcurrency before sa_enable, rather than crashing.
(savp_lwp is still null at that point.)

noted by skrueger at meinberlikomm.de.

diffstat:

 sys/kern/kern_sa.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 0a32db52b266 -r e1c0506fbc83 sys/kern/kern_sa.c
--- a/sys/kern/kern_sa.c        Mon Sep 05 21:16:24 2005 +0000
+++ b/sys/kern/kern_sa.c        Mon Sep 05 21:52:38 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sa.c,v 1.63 2005/08/19 02:04:03 christos Exp $    */
+/*     $NetBSD: kern_sa.c,v 1.64 2005/09/05 21:52:38 yamt Exp $        */
 
 /*-
  * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.63 2005/08/19 02:04:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.64 2005/09/05 21:52:38 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -553,6 +553,9 @@
        if (sa == NULL)
                return (EINVAL);
 
+       if ((l->l_proc->p_flag & P_SA) == 0)
+               return (EINVAL);
+
        if (SCARG(uap, concurrency) < 1)
                return (EINVAL);
 



Home | Main Index | Thread Index | Old Index