12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- --- a/src/linux/xt_coova.c
- +++ b/src/linux/xt_coova.c
- @@ -292,6 +292,8 @@ static int coova_mt_check(const struct x
- struct coova_table *t;
- #ifdef CONFIG_PROC_FS
- struct proc_dir_entry *pde;
- + kuid_t uid;
- + kgid_t gid;
- #endif
- unsigned i;
- int ret = 0;
- @@ -330,8 +332,9 @@ static int coova_mt_check(const struct x
- ret = -ENOMEM;
- goto out;
- }
- - pde->uid = ip_list_uid;
- - pde->gid = ip_list_gid;
- + uid = make_kuid(&init_user_ns, ip_list_uid);
- + gid = make_kgid(&init_user_ns, ip_list_gid);
- + proc_set_user(pde, uid, gid);
- #endif
- spin_lock_bh(&coova_lock);
- list_add_tail(&t->list, &tables);
- @@ -445,14 +448,13 @@ static const struct seq_operations coova
-
- static int coova_seq_open(struct inode *inode, struct file *file)
- {
- - struct proc_dir_entry *pde = PDE(inode);
- struct coova_iter_state *st;
-
- st = __seq_open_private(file, &coova_seq_ops, sizeof(*st));
- if (st == NULL)
- return -ENOMEM;
-
- - st->table = pde->data;
- + st->table = PDE_DATA(inode);
- return 0;
- }
-
- @@ -460,8 +462,7 @@ static ssize_t
- coova_mt_proc_write(struct file *file, const char __user *input,
- size_t size, loff_t *loff)
- {
- - const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
- - struct coova_table *t = pde->data;
- + struct coova_table *t = PDE_DATA(file->f_path.dentry->d_inode);
- struct coova_entry *e;
- char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
- const char *c = buf;
|