Files
ubports_kernel_google_msm/include/linux
Alexey Dobriyan 786d7e1612 Fix rmmod/read/write races in /proc entries
Fix following races:
===========================================
1. Write via ->write_proc sleeps in copy_from_user(). Module disappears
   meanwhile. Or, more generically, system call done on /proc file, method
   supplied by module is called, module dissapeares meanwhile.

   pde = create_proc_entry()
   if (!pde)
	return -ENOMEM;
   pde->write_proc = ...
				open
				write
				copy_from_user
   pde = create_proc_entry();
   if (!pde) {
	remove_proc_entry();
	return -ENOMEM;
	/* module unloaded */
   }
				*boom*
==========================================
2. bogo-revoke aka proc_kill_inodes()

  remove_proc_entry		vfs_read
  proc_kill_inodes		[check ->f_op validness]
				[check ->f_op->read validness]
				[verify_area, security permissions checks]
	->f_op = NULL;
				if (file->f_op->read)
					/* ->f_op dereference, boom */

NOTE, NOTE, NOTE: file_operations are proxied for regular files only. Let's
see how this scheme behaves, then extend if needed for directories.
Directories creators in /proc only set ->owner for them, so proxying for
directories may be unneeded.

NOTE, NOTE, NOTE: methods being proxied are ->llseek, ->read, ->write,
->poll, ->unlocked_ioctl, ->ioctl, ->compat_ioctl, ->open, ->release.
If your in-tree module uses something else, yell on me. Full audit pending.

[akpm@linux-foundation.org: build fix]
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-16 09:05:39 -07:00
..
2007-07-12 15:41:24 -07:00
2007-06-16 13:16:16 -07:00
2007-07-13 08:06:14 -07:00
2007-05-11 05:38:26 -04:00
2007-05-23 20:14:12 -07:00
2007-05-21 09:56:57 -07:00
2007-07-09 08:22:54 +01:00
2007-07-09 08:23:17 +01:00
2007-07-11 16:09:00 -07:00
2007-07-12 10:55:56 -07:00
2007-06-01 08:18:29 -07:00
2007-05-31 16:20:15 -04:00
2007-05-31 16:20:14 -04:00
2007-06-18 09:48:41 -07:00
2007-07-10 00:35:17 -04:00
2007-07-09 18:51:58 +02:00
2007-05-11 16:56:02 +02:00
2007-07-09 23:17:58 +02:00
2007-07-16 09:05:34 -07:00
2007-07-10 22:15:03 -07:00
2007-07-14 18:55:06 -07:00
2007-05-11 08:29:36 -07:00
2007-05-11 08:29:34 -07:00
2007-05-15 08:54:00 -07:00
2007-07-10 22:16:44 -07:00
2007-06-08 17:23:34 -07:00
2007-07-10 22:15:26 -07:00
2007-07-10 21:30:33 -04:00
2007-05-18 20:46:30 -07:00
2007-07-16 09:05:34 -07:00
2007-07-16 09:05:37 -07:00
2007-07-10 17:33:05 +01:00
2007-07-14 18:55:06 -07:00
2007-06-07 13:39:34 -07:00
2007-05-17 05:23:06 -07:00
2007-07-09 18:52:01 +02:00
2007-05-11 08:29:36 -07:00
2007-05-11 08:29:36 -07:00
2007-07-16 09:05:36 -07:00
2007-07-16 09:05:36 -07:00
2007-07-16 09:05:36 -07:00
2007-07-16 09:05:36 -07:00
2007-05-21 21:47:27 -07:00
2007-05-11 08:29:34 -07:00
2007-05-11 08:29:36 -07:00
2007-05-11 08:29:35 -07:00
2007-05-11 08:29:35 -07:00
2007-07-12 16:34:40 -07:00
2007-07-09 18:52:01 +02:00
2007-05-21 09:18:19 -07:00