Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/sys Pull up revision 1.88 (via patch, requested by ...



details:   https://anonhg.NetBSD.org/src/rev/7bcb39e62a79
branches:  netbsd-1-4
changeset: 470526:7bcb39e62a79
user:      he <he%NetBSD.org@localhost>
date:      Sun Apr 30 12:07:06 2000 +0000

description:
Pull up revision 1.88 (via patch, requested by sommerfeld):
  Fix two bugs:
   o A malicious or erroneous program can hog the CPU in uiomove()
   o A ktrace of such a program can hog large amounts of kernel memory
  This increses the size of struct proc, so kernel-grovellers need
  rebuild after this.

diffstat:

 sys/sys/proc.h |  20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diffs (48 lines):

diff -r b54924ff4ce2 -r 7bcb39e62a79 sys/sys/proc.h
--- a/sys/sys/proc.h    Sun Apr 30 11:52:00 2000 +0000
+++ b/sys/sys/proc.h    Sun Apr 30 12:07:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.74 1999/03/25 04:45:56 sommerfe Exp $       */
+/*     $NetBSD: proc.h,v 1.74.2.1 2000/04/30 12:07:06 he Exp $ */
 
 /*-
  * Copyright (c) 1986, 1989, 1991, 1993
@@ -148,6 +148,7 @@
        const char *p_wmesg;     /* Reason for sleep. */
        u_int   p_swtime;        /* Time swapped in or out. */
        u_int   p_slptime;       /* Time since last blocked. */
+       int     p_schedflags;    /* PSCHED_* flags */
 
        struct  itimerval p_realtimer;  /* Alarm timer. */
        struct  timeval p_rtime;        /* Real time. */
@@ -230,6 +231,21 @@
 #define        P_NOCLDWAIT     0x20000 /* No zombies if child dies */
 
 /*
+ * These flags are kept in p_schedflags.  p_schedflags may be modified
+ * only at splstatclock().
+ */
+#define        PSCHED_SEENRR           0x0001  /* process has been in roundrobin() */
+#define        PSCHED_SHOULDYIELD      0x0002  /* process should yield */
+
+#define        PSCHED_SWITCHCLEAR      (PSCHED_SEENRR|PSCHED_SHOULDYIELD)
+
+/*
+ * Macro to compute the exit signal to be delivered.
+ */
+#define        P_EXITSIG(p)    (((p)->p_flag & (P_TRACED|P_FSTRACE)) ? SIGCHLD : \
+                        p->p_exitsig)
+
+/*
  * MOVE TO ucred.h?
  *
  * Shareable process credentials (always resident).  This includes a reference
@@ -330,6 +346,8 @@
 void   fixjobc __P((struct proc *p, struct pgrp *pgrp, int entering));
 int    inferior __P((struct proc *p));
 int    leavepgrp __P((struct proc *p));
+void   yield __P((void));
+void   preempt __P((struct proc *));
 void   mi_switch __P((void));
 void   pgdelete __P((struct pgrp *pgrp));
 void   procinit __P((void));



Home | Main Index | Thread Index | Old Index