xref: /csrg-svn/sys/kern/kern_sig.c (revision 17153)
1 /*	kern_sig.c	6.7	84/09/04	*/
2 
3 #include "../machine/reg.h"
4 #include "../machine/pte.h"
5 #include "../machine/psl.h"
6 
7 #include "param.h"
8 #include "systm.h"
9 #include "dir.h"
10 #include "user.h"
11 #include "inode.h"
12 #include "proc.h"
13 #include "timeb.h"
14 #include "times.h"
15 #include "conf.h"
16 #include "buf.h"
17 #include "mount.h"
18 #include "text.h"
19 #include "seg.h"
20 #include "vm.h"
21 #include "acct.h"
22 #include "uio.h"
23 #include "kernel.h"
24 
25 #define	cantmask	(sigmask(SIGKILL)|sigmask(SIGCONT)|sigmask(SIGSTOP))
26 
27 /*
28  * Quick interface to signal handler.
29  */
30 signal()
31 {
32 	register struct a {
33 		int	signo;
34 		int	(*handler)();	/* signal handler */
35 	} *uap = (struct a  *)u.u_ap;
36 	struct sigvec vec;
37 	register struct sigvec *sv = &vec;
38 	register int sig;
39 
40 	sig = uap->signo;
41 	if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP ||
42 	    (sig == SIGCONT && uap->handler == SIG_IGN)) {
43 		u.u_error = EINVAL;
44 		return;
45 	}
46 	sv->sv_handler = uap->handler;
47 	sv->sv_mask = 0;
48 	sv->sv_onstack = 0;
49 	u.u_r.r_val1 = (int)u.u_signal[sig];
50 	setsigvec(sig, sv);
51 }
52 
53 /*
54  * Generalized interface signal handler.
55  */
56 sigvec()
57 {
58 	register struct a {
59 		int	signo;
60 		struct	sigvec *nsv;
61 		struct	sigvec *osv;
62 	} *uap = (struct a  *)u.u_ap;
63 	struct sigvec vec;
64 	register struct sigvec *sv;
65 	register int sig;
66 
67 	sig = uap->signo;
68 	if (sig <= 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP) {
69 		u.u_error = EINVAL;
70 		return;
71 	}
72 	sv = &vec;
73 	if (uap->osv) {
74 		sv->sv_handler = u.u_signal[sig];
75 		sv->sv_mask = u.u_sigmask[sig];
76 		sv->sv_onstack = (u.u_sigonstack & sigmask(sig)) != 0;
77 		u.u_error =
78 		    copyout((caddr_t)sv, (caddr_t)uap->osv, sizeof (vec));
79 		if (u.u_error)
80 			return;
81 	}
82 	if (uap->nsv) {
83 		u.u_error =
84 		    copyin((caddr_t)uap->nsv, (caddr_t)sv, sizeof (vec));
85 		if (u.u_error)
86 			return;
87 		if (sig == SIGCONT && sv->sv_handler == SIG_IGN) {
88 			u.u_error = EINVAL;
89 			return;
90 		}
91 		setsigvec(sig, sv);
92 	}
93 }
94 
95 setsigvec(sig, sv)
96 	int sig;
97 	register struct sigvec *sv;
98 {
99 	register struct proc *p;
100 	register int bit;
101 
102 	bit = sigmask(sig);
103 	p = u.u_procp;
104 	/*
105 	 * Change setting atomically.
106 	 */
107 	(void) splhigh();
108 	u.u_signal[sig] = sv->sv_handler;
109 	u.u_sigmask[sig] = sv->sv_mask &~ cantmask;
110 	if (sv->sv_onstack)
111 		u.u_sigonstack |= bit;
112 	else
113 		u.u_sigonstack &= ~bit;
114 	if (sv->sv_handler == SIG_IGN) {
115 		p->p_sig &= ~bit;		/* never to be seen again */
116 		p->p_sigignore |= bit;
117 		p->p_sigcatch &= ~bit;
118 	} else {
119 		p->p_sigignore &= ~bit;
120 		if (sv->sv_handler == SIG_DFL)
121 			p->p_sigcatch &= ~bit;
122 		else
123 			p->p_sigcatch |= bit;
124 	}
125 	(void) spl0();
126 }
127 
128 sigblock()
129 {
130 	struct a {
131 		int	mask;
132 	} *uap = (struct a *)u.u_ap;
133 	register struct proc *p = u.u_procp;
134 
135 	(void) splhigh();
136 	u.u_r.r_val1 = p->p_sigmask;
137 	p->p_sigmask |= uap->mask &~ cantmask;
138 	(void) spl0();
139 }
140 
141 sigsetmask()
142 {
143 	struct a {
144 		int	mask;
145 	} *uap = (struct a *)u.u_ap;
146 	register struct proc *p = u.u_procp;
147 
148 	(void) splhigh();
149 	u.u_r.r_val1 = p->p_sigmask;
150 	p->p_sigmask = uap->mask &~ cantmask;
151 	(void) spl0();
152 }
153 
154 sigpause()
155 {
156 	struct a {
157 		int	mask;
158 	} *uap = (struct a *)u.u_ap;
159 	register struct proc *p = u.u_procp;
160 
161 	/*
162 	 * When returning from sigpause, we want
163 	 * the old mask to be restored after the
164 	 * signal handler has finished.  Thus, we
165 	 * save it here and mark the proc structure
166 	 * to indicate this (should be in u.).
167 	 */
168 	u.u_oldmask = p->p_sigmask;
169 	p->p_flag |= SOMASK;
170 	p->p_sigmask = uap->mask &~ cantmask;
171 	for (;;)
172 		sleep((caddr_t)&u, PSLEP);
173 	/*NOTREACHED*/
174 }
175 #undef cantmask
176 
177 sigstack()
178 {
179 	register struct a {
180 		struct	sigstack *nss;
181 		struct	sigstack *oss;
182 	} *uap = (struct a *)u.u_ap;
183 	struct sigstack ss;
184 
185 	if (uap->oss) {
186 		u.u_error = copyout((caddr_t)&u.u_sigstack, (caddr_t)uap->oss,
187 		    sizeof (struct sigstack));
188 		if (u.u_error)
189 			return;
190 	}
191 	if (uap->nss) {
192 		u.u_error =
193 		    copyin((caddr_t)uap->nss, (caddr_t)&ss, sizeof (ss));
194 		if (u.u_error == 0)
195 			u.u_sigstack = ss;
196 	}
197 }
198 
199 /* KILL SHOULD BE UPDATED */
200 
201 kill()
202 {
203 	register struct a {
204 		int	pid;
205 		int	signo;
206 	} *uap = (struct a *)u.u_ap;
207 
208 	u.u_error = kill1(uap->signo < 0,
209 		uap->signo < 0 ? -uap->signo : uap->signo, uap->pid);
210 }
211 
212 killpg()
213 {
214 	register struct a {
215 		int	pgrp;
216 		int	signo;
217 	} *uap = (struct a *)u.u_ap;
218 
219 	u.u_error = kill1(1, uap->signo, uap->pgrp);
220 }
221 
222 /* KILL CODE SHOULDNT KNOW ABOUT PROCESS INTERNALS !?! */
223 
224 kill1(ispgrp, signo, who)
225 	int ispgrp, signo, who;
226 {
227 	register struct proc *p;
228 	int f, priv = 0;
229 
230 	if (signo < 0 || signo > NSIG)
231 		return (EINVAL);
232 	if (who > 0 && !ispgrp) {
233 		p = pfind(who);
234 		if (p == 0)
235 			return (ESRCH);
236 		if (u.u_uid && u.u_uid != p->p_uid)
237 			return (EPERM);
238 		if (signo)
239 			psignal(p, signo);
240 		return (0);
241 	}
242 	if (who == -1 && u.u_uid == 0)
243 		priv++, who = 0, ispgrp = 1;	/* like sending to pgrp */
244 	else if (who == 0) {
245 		/*
246 		 * Zero process id means send to my process group.
247 		 */
248 		ispgrp = 1;
249 		who = u.u_procp->p_pgrp;
250 		if (who == 0)
251 			return (EINVAL);
252 	}
253 	for (f = 0, p = allproc; p != NULL; p = p->p_nxt) {
254 		if (!ispgrp) {
255 			if (p->p_pid != who)
256 				continue;
257 		} else if (p->p_pgrp != who && priv == 0 || p->p_ppid == 0 ||
258 		    (p->p_flag&SSYS) || (priv && p == u.u_procp))
259 			continue;
260 		if (u.u_uid != 0 && u.u_uid != p->p_uid &&
261 		    (signo != SIGCONT || !inferior(p)))
262 			continue;
263 		f++;
264 		if (signo)
265 			psignal(p, signo);
266 	}
267 	return (f == 0 ? ESRCH : 0);
268 }
269 
270 /*
271  * Send the specified signal to
272  * all processes with 'pgrp' as
273  * process group.
274  */
275 gsignal(pgrp, sig)
276 	register int pgrp;
277 {
278 	register struct proc *p;
279 
280 	if (pgrp == 0)
281 		return;
282 	for (p = allproc; p != NULL; p = p->p_nxt)
283 		if (p->p_pgrp == pgrp)
284 			psignal(p, sig);
285 }
286 
287 /*
288  * Send the specified signal to
289  * the specified process.
290  */
291 psignal(p, sig)
292 	register struct proc *p;
293 	register int sig;
294 {
295 	register int s;
296 	register int (*action)();
297 	int mask;
298 
299 	if ((unsigned)sig >= NSIG)
300 		return;
301 	mask = sigmask(sig);
302 
303 	/*
304 	 * If proc is traced, always give parent a chance.
305 	 */
306 	if (p->p_flag & STRC)
307 		action = SIG_DFL;
308 	else {
309 		/*
310 		 * If the signal is being ignored,
311 		 * then we forget about it immediately.
312 		 */
313 		if (p->p_sigignore & mask)
314 			return;
315 		if (p->p_sigmask & mask)
316 			action = SIG_HOLD;
317 		else if (p->p_sigcatch & mask)
318 			action = SIG_CATCH;
319 		else
320 			action = SIG_DFL;
321 	}
322 #define	stops	(sigmask(SIGSTOP)|sigmask(SIGTSTP)| \
323 			sigmask(SIGTTIN)|sigmask(SIGTTOU))
324 	if (sig) {
325 		p->p_sig |= mask;
326 		switch (sig) {
327 
328 		case SIGTERM:
329 			if ((p->p_flag&STRC) || action != SIG_DFL)
330 				break;
331 			/* fall into ... */
332 
333 		case SIGKILL:
334 			if (p->p_nice > NZERO)
335 				p->p_nice = NZERO;
336 			break;
337 
338 		case SIGCONT:
339 			p->p_sig &= ~stops;
340 			break;
341 
342 		case SIGSTOP:
343 		case SIGTSTP:
344 		case SIGTTIN:
345 		case SIGTTOU:
346 			p->p_sig &= ~sigmask(SIGCONT);
347 			break;
348 		}
349 	}
350 #undef stops
351 	/*
352 	 * Defer further processing for signals which are held.
353 	 */
354 	if (action == SIG_HOLD)
355 		return;
356 	s = splhigh();
357 	switch (p->p_stat) {
358 
359 	case SSLEEP:
360 		/*
361 		 * If process is sleeping at negative priority
362 		 * we can't interrupt the sleep... the signal will
363 		 * be noticed when the process returns through
364 		 * trap() or syscall().
365 		 */
366 		if (p->p_pri <= PZERO)
367 			goto out;
368 		/*
369 		 * Process is sleeping and traced... make it runnable
370 		 * so it can discover the signal in issig() and stop
371 		 * for the parent.
372 		 */
373 		if (p->p_flag&STRC)
374 			goto run;
375 		switch (sig) {
376 
377 		case SIGSTOP:
378 		case SIGTSTP:
379 		case SIGTTIN:
380 		case SIGTTOU:
381 			/*
382 			 * These are the signals which by default
383 			 * stop a process.
384 			 */
385 			if (action != SIG_DFL)
386 				goto run;
387 			/*
388 			 * Don't clog system with children of init
389 			 * stopped from the keyboard.
390 			 */
391 			if (sig != SIGSTOP && p->p_pptr == &proc[1]) {
392 				psignal(p, SIGKILL);
393 				p->p_sig &= ~mask;
394 				splx(s);
395 				return;
396 			}
397 			/*
398 			 * If a child in vfork(), stopping could
399 			 * cause deadlock.
400 			 */
401 			if (p->p_flag&SVFORK)
402 				goto out;
403 			p->p_sig &= ~mask;
404 			p->p_cursig = sig;
405 			stop(p);
406 			goto out;
407 
408 		case SIGIO:
409 		case SIGURG:
410 		case SIGCHLD:
411 			/*
412 			 * These signals are special in that they
413 			 * don't get propogated... if the process
414 			 * isn't interested, forget it.
415 			 */
416 			if (action != SIG_DFL)
417 				goto run;
418 			p->p_sig &= ~mask;		/* take it away */
419 			goto out;
420 
421 		default:
422 			/*
423 			 * All other signals cause the process to run
424 			 */
425 			goto run;
426 		}
427 		/*NOTREACHED*/
428 
429 	case SSTOP:
430 		/*
431 		 * If traced process is already stopped,
432 		 * then no further action is necessary.
433 		 */
434 		if (p->p_flag&STRC)
435 			goto out;
436 		switch (sig) {
437 
438 		case SIGKILL:
439 			/*
440 			 * Kill signal always sets processes running.
441 			 */
442 			goto run;
443 
444 		case SIGCONT:
445 			/*
446 			 * If the process catches SIGCONT, let it handle
447 			 * the signal itself.  If it isn't waiting on
448 			 * an event, then it goes back to run state.
449 			 * Otherwise, process goes back to sleep state.
450 			 */
451 			if (action != SIG_DFL || p->p_wchan == 0)
452 				goto run;
453 			p->p_stat = SSLEEP;
454 			goto out;
455 
456 		case SIGSTOP:
457 		case SIGTSTP:
458 		case SIGTTIN:
459 		case SIGTTOU:
460 			/*
461 			 * Already stopped, don't need to stop again.
462 			 * (If we did the shell could get confused.)
463 			 */
464 			p->p_sig &= ~mask;		/* take it away */
465 			goto out;
466 
467 		default:
468 			/*
469 			 * If process is sleeping interruptibly, then
470 			 * unstick it so that when it is continued
471 			 * it can look at the signal.
472 			 * But don't setrun the process as its not to
473 			 * be unstopped by the signal alone.
474 			 */
475 			if (p->p_wchan && p->p_pri > PZERO)
476 				unsleep(p);
477 			goto out;
478 		}
479 		/*NOTREACHED*/
480 
481 	default:
482 		/*
483 		 * SRUN, SIDL, SZOMB do nothing with the signal,
484 		 * other than kicking ourselves if we are running.
485 		 * It will either never be noticed, or noticed very soon.
486 		 */
487 		if (p == u.u_procp && !noproc)
488 #include "../vax/mtpr.h"
489 			aston();
490 		goto out;
491 	}
492 	/*NOTREACHED*/
493 run:
494 	/*
495 	 * Raise priority to at least PUSER.
496 	 */
497 	if (p->p_pri > PUSER)
498 		if ((p != u.u_procp || noproc) && p->p_stat == SRUN &&
499 		    (p->p_flag & SLOAD)) {
500 			remrq(p);
501 			p->p_pri = PUSER;
502 			setrq(p);
503 		} else
504 			p->p_pri = PUSER;
505 	setrun(p);
506 out:
507 	splx(s);
508 }
509 
510 /*
511  * Returns true if the current
512  * process has a signal to process.
513  * The signal to process is put in p_cursig.
514  * This is asked at least once each time a process enters the
515  * system (though this can usually be done without actually
516  * calling issig by checking the pending signal masks.)
517  * A signal does not do anything
518  * directly to a process; it sets
519  * a flag that asks the process to
520  * do something to itself.
521  */
522 issig()
523 {
524 	register struct proc *p;
525 	register int sig;
526 	int sigbits, mask;
527 
528 	p = u.u_procp;
529 	for (;;) {
530 		sigbits = p->p_sig &~ p->p_sigmask;
531 		if ((p->p_flag&STRC) == 0)
532 			sigbits &= ~p->p_sigignore;
533 		if (p->p_flag&SVFORK)
534 #define bit(a) (1<<(a-1))
535 			sigbits &= ~(bit(SIGSTOP)|bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU));
536 		if (sigbits == 0)
537 			break;
538 		sig = ffs(sigbits);
539 		mask = sigmask(sig);
540 		p->p_sig &= ~mask;		/* take the signal! */
541 		p->p_cursig = sig;
542 		if (p->p_flag&STRC && (p->p_flag&SVFORK) == 0) {
543 			/*
544 			 * If traced, always stop, and stay
545 			 * stopped until released by the parent.
546 			 */
547 			do {
548 				stop(p);
549 				swtch();
550 			} while (!procxmt() && p->p_flag&STRC);
551 
552 			/*
553 			 * If the traced bit got turned off,
554 			 * then put the signal taken above back into p_sig
555 			 * and go back up to the top to rescan signals.
556 			 * This ensures that p_sig* and u_signal are consistent.
557 			 */
558 			if ((p->p_flag&STRC) == 0) {
559 				p->p_sig |= mask;
560 				continue;
561 			}
562 
563 			/*
564 			 * If parent wants us to take the signal,
565 			 * then it will leave it in p->p_cursig;
566 			 * otherwise we just look for signals again.
567 			 */
568 			sig = p->p_cursig;
569 			if (sig == 0)
570 				continue;
571 
572 			/*
573 			 * If signal is being masked put it back
574 			 * into p_sig and look for other signals.
575 			 */
576 			mask = sigmask(sig);
577 			if (p->p_sigmask & mask) {
578 				p->p_sig |= mask;
579 				continue;
580 			}
581 		}
582 		switch (u.u_signal[sig]) {
583 
584 		case SIG_DFL:
585 			/*
586 			 * Don't take default actions on system processes.
587 			 */
588 			if (p->p_ppid == 0)
589 				break;
590 			switch (sig) {
591 
592 			case SIGTSTP:
593 			case SIGTTIN:
594 			case SIGTTOU:
595 				/*
596 				 * Children of init aren't allowed to stop
597 				 * on signals from the keyboard.
598 				 */
599 				if (p->p_pptr == &proc[1]) {
600 					psignal(p, SIGKILL);
601 					continue;
602 				}
603 				/* fall into ... */
604 
605 			case SIGSTOP:
606 				if (p->p_flag&STRC)
607 					continue;
608 				stop(p);
609 				swtch();
610 				continue;
611 
612 			case SIGCONT:
613 			case SIGCHLD:
614 			case SIGURG:
615 			case SIGIO:
616 				/*
617 				 * These signals are normally not
618 				 * sent if the action is the default.
619 				 */
620 				continue;		/* == ignore */
621 
622 			default:
623 				goto send;
624 			}
625 			/*NOTREACHED*/
626 
627 		case SIG_HOLD:
628 		case SIG_IGN:
629 			/*
630 			 * Masking above should prevent us
631 			 * ever trying to take action on a held
632 			 * or ignored signal, unless process is traced.
633 			 */
634 			if ((p->p_flag&STRC) == 0)
635 				printf("issig\n");
636 			continue;
637 
638 		default:
639 			/*
640 			 * This signal has an action, let
641 			 * psig process it.
642 			 */
643 			goto send;
644 		}
645 		/*NOTREACHED*/
646 	}
647 	/*
648 	 * Didn't find a signal to send.
649 	 */
650 	p->p_cursig = 0;
651 	return (0);
652 
653 send:
654 	/*
655 	 * Let psig process the signal.
656 	 */
657 	return (sig);
658 }
659 
660 /*
661  * Put the argument process into the stopped
662  * state and notify the parent via wakeup and/or signal.
663  */
664 stop(p)
665 	register struct proc *p;
666 {
667 
668 	p->p_stat = SSTOP;
669 	p->p_flag &= ~SWTED;
670 	wakeup((caddr_t)p->p_pptr);
671 	/*
672 	 * Avoid sending signal to parent if process is traced
673 	 */
674 	if (p->p_flag&STRC)
675 		return;
676 	psignal(p->p_pptr, SIGCHLD);
677 }
678 
679 /*
680  * Perform the action specified by
681  * the current signal.
682  * The usual sequence is:
683  *	if (issig())
684  *		psig();
685  * The signal bit has already been cleared by issig,
686  * and the current signal number stored in p->p_cursig.
687  */
688 psig()
689 {
690 	register struct proc *p = u.u_procp;
691 	register int sig = p->p_cursig;
692 	int mask = sigmask(sig), returnmask;
693 	register int (*action)();
694 
695 	if (sig == 0)
696 		panic("psig");
697 	action = u.u_signal[sig];
698 	if (action != SIG_DFL) {
699 		if (action == SIG_IGN || (p->p_sigmask & mask))
700 			panic("psig action");
701 		u.u_error = 0;
702 		/*
703 		 * Set the new mask value and also defer further
704 		 * occurences of this signal (unless we're simulating
705 		 * the old signal facilities).
706 		 *
707 		 * Special case: user has done a sigpause.  Here the
708 		 * current mask is not of interest, but rather the
709 		 * mask from before the sigpause is what we want restored
710 		 * after the signal processing is completed.
711 		 */
712 		(void) splhigh();
713 		if (p->p_flag & SOUSIG) {
714 			if (sig != SIGILL && sig != SIGTRAP) {
715 				u.u_signal[sig] = SIG_DFL;
716 				p->p_sigcatch &= ~mask;
717 			}
718 			mask = 0;
719 		}
720 		if (p->p_flag & SOMASK) {
721 			returnmask = u.u_oldmask;
722 			p->p_flag &= ~SOMASK;
723 		} else
724 			returnmask = p->p_sigmask;
725 		p->p_sigmask |= u.u_sigmask[sig] | mask;
726 		(void) spl0();
727 		u.u_ru.ru_nsignals++;
728 		sendsig(action, sig, returnmask);
729 		p->p_cursig = 0;
730 		return;
731 	}
732 	u.u_acflag |= AXSIG;
733 	switch (sig) {
734 
735 	case SIGILL:
736 	case SIGIOT:
737 	case SIGBUS:
738 	case SIGQUIT:
739 	case SIGTRAP:
740 	case SIGEMT:
741 	case SIGFPE:
742 	case SIGSEGV:
743 	case SIGSYS:
744 		u.u_arg[0] = sig;
745 		if (core())
746 			sig += 0200;
747 	}
748 	exit(sig);
749 }
750 
751 /*
752  * Create a core image on the file "core"
753  * If you are looking for protection glitches,
754  * there are probably a wealth of them here
755  * when this occurs to a suid command.
756  *
757  * It writes UPAGES block of the
758  * user.h area followed by the entire
759  * data+stack segments.
760  */
761 core()
762 {
763 	register struct inode *ip;
764 	register struct nameidata *ndp = &u.u_nd;
765 
766 	if (u.u_uid != u.u_ruid || u.u_gid != u.u_rgid)
767 		return (0);
768 	if (ctob(UPAGES+u.u_dsize+u.u_ssize) >=
769 	    u.u_rlimit[RLIMIT_CORE].rlim_cur)
770 		return (0);
771 	u.u_error = 0;
772 	ndp->ni_nameiop = CREATE | FOLLOW;
773 	ndp->ni_segflg = UIO_SYSSPACE;
774 	ndp->ni_dirp = "core";
775 	ip = namei(ndp);
776 	if (ip == NULL) {
777 		if (u.u_error)
778 			return (0);
779 		ip = maknode(0644, ndp);
780 		if (ip==NULL)
781 			return (0);
782 	}
783 	if (access(ip, IWRITE) ||
784 	   (ip->i_mode&IFMT) != IFREG ||
785 	   ip->i_nlink != 1) {
786 		u.u_error = EFAULT;
787 		goto out;
788 	}
789 	itrunc(ip, (u_long)0);
790 	u.u_acflag |= ACORE;
791 	u.u_error = rdwri(UIO_WRITE, ip,
792 	    (caddr_t)&u,
793 	    ctob(UPAGES),
794 	    0, 1, (int *)0);
795 	if (u.u_error == 0)
796 		u.u_error = rdwri(UIO_WRITE, ip,
797 		    (caddr_t)ctob(dptov(u.u_procp, 0)),
798 		    ctob(u.u_dsize),
799 		    ctob(UPAGES), 0, (int *)0);
800 	if (u.u_error == 0)
801 		u.u_error = rdwri(UIO_WRITE, ip,
802 		    (caddr_t)ctob(sptov(u.u_procp, u.u_ssize - 1)),
803 		    ctob(u.u_ssize),
804 		    ctob(UPAGES)+ctob(u.u_dsize), 0, (int *)0);
805 out:
806 	iput(ip);
807 	return (u.u_error == 0);
808 }
809