patch-kernel_exmap_c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- exmap-console-0.4.1.orig/kernel/exmap.c 2006-10-24 20:45:11.000000000 +0200
  3. +++ exmap-console-0.4.1/kernel/exmap.c 2009-06-11 12:31:45.000000000 +0200
  4. @@ -392,7 +392,11 @@ int setup_from_pid(pid_t pid)
  5. struct task_struct *tsk;
  6. int errcode = -EINVAL;
  7. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
  8. + tsk = find_task_by_vpid(pid);
  9. +#else
  10. tsk = find_task_by_pid(pid);
  11. +#endif
  12. if (tsk == NULL) {
  13. printk (KERN_ALERT
  14. "/proc/%s: can't find task for pid %d\n",
  15. @@ -507,7 +511,7 @@ int init_module ()
  16. NULL);
  17. if (exmap_proc_file == NULL) {
  18. - remove_proc_entry (PROCFS_NAME, &proc_root);
  19. + remove_proc_entry (PROCFS_NAME, NULL);
  20. printk (KERN_ALERT "/proc/%s: could not initialize\n",
  21. PROCFS_NAME);
  22. return -ENOMEM;
  23. @@ -515,7 +519,6 @@ int init_module ()
  24. exmap_proc_file->read_proc = procfile_read;
  25. exmap_proc_file->write_proc = procfile_write;
  26. - exmap_proc_file->owner = THIS_MODULE;
  27. /* exmap_proc_file->mode = S_IFREG | S_IRUGO; */
  28. /* TODO - this is quite probably a security problem */
  29. @@ -532,5 +535,5 @@ int init_module ()
  30. void cleanup_module ()
  31. {
  32. printk (KERN_INFO "/proc/%s: remove\n", PROCFS_NAME);
  33. - remove_proc_entry (PROCFS_NAME, &proc_root);
  34. + remove_proc_entry (PROCFS_NAME, NULL);
  35. }