android_kernel_xiaomi_sm8350/arch/x86/kernel/cpu
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
..
cpufreq Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
mcheck x86: use smp_call_function_single() in arch/x86/kernel/cpu/mcheck/mce_amd_64.c 2009-03-18 07:03:12 +01:00
mtrr proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
.gitignore
addon_cpuid_features.c x86: move various CPU initialization objects into .cpuinit.rodata 2009-03-12 13:13:07 +01:00
amd.c x86: move various CPU initialization objects into .cpuinit.rodata 2009-03-12 13:13:07 +01:00
bugs_64.c
bugs.c
centaur.c x86/centaur: merge 32 & 64 bit version 2009-03-14 16:27:29 +01:00
cmpxchg.c
common.c Merge branches 'x86/apic', 'x86/asm', 'x86/cleanups', 'x86/debug', 'x86/kconfig', 'x86/mm', 'x86/ptrace', 'x86/setup' and 'x86/urgent'; commit 'v2.6.29-rc8' into x86/core 2009-03-14 16:25:40 +01:00
cpu_debug.c x86: cpu_debug add support for various AMD CPUs 2009-03-14 18:07:58 +01:00
cpu.h x86: cpu/cpu.h cleanup 2009-03-23 02:06:51 +05:30
cyrix.c x86: move various CPU initialization objects into .cpuinit.rodata 2009-03-12 13:13:07 +01:00
hypervisor.c
intel_cacheinfo.c x86: move various CPU initialization objects into .cpuinit.rodata 2009-03-12 13:13:07 +01:00
intel.c Merge branch 'linus' into x86/core 2009-03-28 22:27:45 +01:00
Makefile x86/centaur: merge 32 & 64 bit version 2009-03-14 16:27:29 +01:00
mkcapflags.pl
perfctr-watchdog.c x86: fold apic_ops into genapic 2009-02-17 12:22:20 +01:00
powerflags.c
proc.c x86: remove double copy of show_cpuinfo_core for 32 and 64 bit 2009-02-28 19:26:33 -08:00
transmeta.c x86: move various CPU initialization objects into .cpuinit.rodata 2009-03-12 13:13:07 +01:00
umc.c x86: move various CPU initialization objects into .cpuinit.rodata 2009-03-12 13:13:07 +01:00
vmware.c