diff options
author | Don Lewis <truckman@FreeBSD.org> | 1998-11-11 10:04:13 +0000 |
---|---|---|
committer | Don Lewis <truckman@FreeBSD.org> | 1998-11-11 10:04:13 +0000 |
commit | 831d27a9f56da38cf007714c169d208e7b9739be (patch) | |
tree | 2bce7c99fd05ca07a117966c4c41f2f544ef20f3 /sys/sys/filedesc.h | |
parent | 21ffb6774a08602e1208977da6c5a652d85d32b6 (diff) | |
download | src-831d27a9f56da38cf007714c169d208e7b9739be.tar.gz src-831d27a9f56da38cf007714c169d208e7b9739be.zip |
Installed the second patch attached to kern/7899 with some changes suggested
by bde, a few other tweaks to get the patch to apply cleanly again and
some improvements to the comments.
This change closes some fairly minor security holes associated with
F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN
had on tty devices. For more details, see the description on the PR.
Because this patch increases the size of the proc and pgrp structures,
it is necessary to re-install the includes and recompile libkvm,
the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w.
PR: kern/7899
Reviewed by: bde, elvind
Notes
Notes:
svn path=/head/; revision=41086
Diffstat (limited to 'sys/sys/filedesc.h')
-rw-r--r-- | sys/sys/filedesc.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index 444c3ef139a7..6d3fb26c7e3e 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -31,12 +31,14 @@ * SUCH DAMAGE. * * @(#)filedesc.h 8.1 (Berkeley) 6/2/93 - * $Id: filedesc.h,v 1.12 1997/10/12 20:25:57 phk Exp $ + * $Id: filedesc.h,v 1.13 1997/12/05 18:58:10 bde Exp $ */ #ifndef _SYS_FILEDESC_H_ #define _SYS_FILEDESC_H_ +#include <sys/queue.h> + /* * This structure is used for the management of descriptors. It may be * shared by multiple processes. @@ -91,6 +93,30 @@ struct filedesc0 { */ #define OFILESIZE (sizeof(struct file *) + sizeof(char)) +/* + * This structure that holds the information needed to send a SIGIO or + * a SIGURG signal to a process or process group when new data arrives + * on a device or socket. The structure is placed on an SLIST belonging + * to the proc or pgrp so that the entire list may be revoked when the + * process exits or the process group disappears. + */ +struct sigio { + union { + struct proc *siu_proc; /* Process to receive SIGIO/SIGURG */ + struct pgrp *siu_pgrp; /* Process group to receive ... */ + } sio_u; + SLIST_ENTRY(sigio) sio_pgsigio; /* sigio's for process or group */ + struct sigio **sio_myref; /* location of the pointer that holds + * the reference to this structure */ + struct ucred *sio_ucred; /* Current credentials */ + uid_t sio_ruid; /* Real user id */ + pid_t sio_pgid; /* pgid for signals */ +}; +#define sio_proc sio_u.siu_proc +#define sio_pgrp sio_u.siu_pgrp + +SLIST_HEAD(sigiolst, sigio); + #ifdef KERNEL /* * Kernel global variables and routines. @@ -109,6 +135,10 @@ void fdcloseexec __P((struct proc *p)); int getvnode __P((struct filedesc *fdp, int fd, struct file **fpp)); int fdissequential __P((struct file *)); void fdsequential __P((struct file *, int)); +pid_t fgetown __P((struct sigio *)); +int fsetown __P((pid_t, struct sigio **)); +void funsetown __P((struct sigio *)); +void funsetownlst __P((struct sigiolst *)); #endif #endif |