[PATCH] file: modify struct fown_struct to use a struct pid
File handles can be requested to send sigio and sigurg to processes. By tracking the destination processes using struct pid instead of pid_t we make the interface safe from all potential pid wrap around problems. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
bde0d2c98b
commit
609d7fa956
8 changed files with 59 additions and 34 deletions
|
@ -684,7 +684,8 @@ extern struct block_device *I_BDEV(struct inode *inode);
|
|||
|
||||
struct fown_struct {
|
||||
rwlock_t lock; /* protects pid, uid, euid fields */
|
||||
int pid; /* pid or -pgrp where SIGIO should be sent */
|
||||
struct pid *pid; /* pid or -pgrp where SIGIO should be sent */
|
||||
enum pid_type pid_type; /* Kind of process group SIGIO should be sent to */
|
||||
uid_t uid, euid; /* uid/euid of process setting the owner */
|
||||
int signum; /* posix.1b rt signal to be delivered on IO */
|
||||
};
|
||||
|
@ -880,8 +881,10 @@ extern void kill_fasync(struct fasync_struct **, int, int);
|
|||
/* only for net: no internal synchronization */
|
||||
extern void __kill_fasync(struct fasync_struct *, int, int);
|
||||
|
||||
extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
|
||||
extern int f_setown(struct file *filp, unsigned long arg, int force);
|
||||
extern void f_delown(struct file *filp);
|
||||
extern pid_t f_getown(struct file *filp);
|
||||
extern int send_sigurg(struct fown_struct *fown);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue