1
0

201-fix_dereferencing_pointers.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --- a/src/linux/xt_coova.c
  2. +++ b/src/linux/xt_coova.c
  3. @@ -292,6 +292,8 @@ static int coova_mt_check(const struct x
  4. struct coova_table *t;
  5. #ifdef CONFIG_PROC_FS
  6. struct proc_dir_entry *pde;
  7. + kuid_t uid;
  8. + kgid_t gid;
  9. #endif
  10. unsigned i;
  11. int ret = 0;
  12. @@ -330,8 +332,9 @@ static int coova_mt_check(const struct x
  13. ret = -ENOMEM;
  14. goto out;
  15. }
  16. - pde->uid = ip_list_uid;
  17. - pde->gid = ip_list_gid;
  18. + uid = make_kuid(&init_user_ns, ip_list_uid);
  19. + gid = make_kgid(&init_user_ns, ip_list_gid);
  20. + proc_set_user(pde, uid, gid);
  21. #endif
  22. spin_lock_bh(&coova_lock);
  23. list_add_tail(&t->list, &tables);
  24. @@ -445,14 +448,13 @@ static const struct seq_operations coova
  25. static int coova_seq_open(struct inode *inode, struct file *file)
  26. {
  27. - struct proc_dir_entry *pde = PDE(inode);
  28. struct coova_iter_state *st;
  29. st = __seq_open_private(file, &coova_seq_ops, sizeof(*st));
  30. if (st == NULL)
  31. return -ENOMEM;
  32. - st->table = pde->data;
  33. + st->table = PDE_DATA(inode);
  34. return 0;
  35. }
  36. @@ -460,8 +462,7 @@ static ssize_t
  37. coova_mt_proc_write(struct file *file, const char __user *input,
  38. size_t size, loff_t *loff)
  39. {
  40. - const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode);
  41. - struct coova_table *t = pde->data;
  42. + struct coova_table *t = PDE_DATA(file->f_path.dentry->d_inode);
  43. struct coova_entry *e;
  44. char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
  45. const char *c = buf;