android_kernel_xiaomi_sm8350/arch
Alexey Dobriyan 99b7623380 proc 2/2: remove struct proc_dir_entry::owner
Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
as correctly noted at bug #12454. Someone can lookup entry with NULL
->owner, thus not pinning enything, and release it later resulting
in module refcount underflow.

We can keep ->owner and supply it at registration time like ->proc_fops
and ->data.

But this leaves ->owner as easy-manipulative field (just one C assignment)
and somebody will forget to unpin previous/pin current module when
switching ->owner. ->proc_fops is declared as "const" which should give
some thoughts.

->read_proc/->write_proc were just fixed to not require ->owner for
protection.

rmmod'ed directories will be empty and return "." and ".." -- no harm.
And directories with tricky enough readdir and lookup shouldn't be modular.
We definitely don't want such modular code.

Removing ->owner will also make PDE smaller.

So, let's nuke it.

Kudos to Jeff Layton for reminding about this, let's say, oversight.

http://bugzilla.kernel.org/show_bug.cgi?id=12454

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
2009-03-31 01:14:44 +04:00
..
alpha proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
arm V4L/DVB (11034): soc-camera: remove now unused gpio member of struct soc_camera_link 2009-03-30 12:43:22 -03:00
avr32 Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
blackfin proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
cris Merge branch 'irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-03-26 16:06:50 -07:00
frv
h8300 Merge branch 'header-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-03-26 16:11:41 -07:00
ia64 proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
m32r
m68k ide: cleanup <asm-m68k/ide.h> 2009-03-27 12:46:23 +01:00
m68knommu Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2009-03-26 15:23:24 -07:00
mips MIPS: Alchemy: PB1200: use SMC91X platform data. 2009-03-30 14:49:46 +02:00
mn10300 Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
parisc Merge branch 'linus' into percpu-cpumask-x86-for-linus-2 2009-03-28 04:26:01 +01:00
powerpc proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-03-27 16:23:12 -07:00
sh V4L/DVB (10665): soc-camera: add data signal polarity flags to drivers 2009-03-30 12:42:52 -03:00
sparc proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
um uml: convert network device to netdevice ops 2009-03-27 00:46:40 -07:00
x86 proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
xtensa Merge branch 'header-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-03-26 16:11:41 -07:00
.gitignore
Kconfig