09 May, 2007
7 commits
-
Fix minor (comment) typoes in kernel/module.c.
Signed-off-by: Robert P. J. Day
Signed-off-by: Adrian Bunk -
Same story as with cat /proc/*/wchan race vs rmmod race, only
/proc/slab_allocators want more info than just symbol name.Signed-off-by: Alexey Dobriyan
Acked-by: Rusty Russell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
kallsyms_lookup() can go iterating over modules list unprotected which is OK
for emergency situations (oops), but not OK for regular stuff like
/proc/*/wchan.Introduce lookup_symbol_name()/lookup_module_symbol_name() which copy symbol
name into caller-supplied buffer or return -ERANGE. All copying is done with
module_mutex held, so...Signed-off-by: Alexey Dobriyan
Cc: Rusty Russell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Several kallsyms_lookup() pass dummy arguments but only need, say, module's
name. Make kallsyms_lookup() accept NULLs where possible.Also, makes picture clearer about what interfaces are needed for all symbol
resolving business.Signed-off-by: Alexey Dobriyan
Cc: Rusty Russell
Acked-by: Ingo Molnar
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
module_get_kallsym() leaks "struct module *" outside of module_mutex which is
no-no, because module can dissapear right after mutex unlock.Copy all needed information from inside module_mutex into caller-supplied
space.[bunk@stusta.de: is_exported() can now become static]
Signed-off-by: Alexey Dobriyan
Cc: Rusty Russell
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
module_get_kallsym() could in theory truncate module symbol name to fit in
buffer, but nobody does this. Always use KSYM_NAME_LEN + 1 bytes for name.Suggested by lg^WRusty.
Signed-off-by: Alexey Dobriyan
Acked-by: Rusty Russell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This converts an open-coded krealloc() to use the shiny new API.
Signed-off-by: Pekka Enberg
Acked-by: Rusty Russell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
06 May, 2007
1 commit
-
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: (231 commits)
[PATCH] i386: Don't delete cpu_devs data to identify different x86 types in late_initcall
[PATCH] i386: type may be unused
[PATCH] i386: Some additional chipset register values validation.
[PATCH] i386: Add missing !X86_PAE dependincy to the 2G/2G split.
[PATCH] x86-64: Don't exclude asm-offsets.c in Documentation/dontdiff
[PATCH] i386: avoid redundant preempt_disable in __unlazy_fpu
[PATCH] i386: white space fixes in i387.h
[PATCH] i386: Drop noisy e820 debugging printks
[PATCH] x86-64: Fix allnoconfig error in genapic_flat.c
[PATCH] x86-64: Shut up warnings for vfat compat ioctls on other file systems
[PATCH] x86-64: Share identical video.S between i386 and x86-64
[PATCH] x86-64: Remove CONFIG_REORDER
[PATCH] x86-64: Print type and size correctly for unknown compat ioctls
[PATCH] i386: Remove copy_*_user BUG_ONs for (size < 0)
[PATCH] i386: Little cleanups in smpboot.c
[PATCH] x86-64: Don't enable NUMA for a single node in K8 NUMA scanning
[PATCH] x86: Use RDTSCP for synchronous get_cycles if possible
[PATCH] i386: Add X86_FEATURE_RDTSCP
[PATCH] i386: Implement X86_FEATURE_SYNC_RDTSC on i386
[PATCH] i386: Implement alternative_io for i386
...Fix up trivial conflict in include/linux/highmem.h manually.
Signed-off-by: Linus Torvalds
03 May, 2007
3 commits
-
We need to work on cleaning up the relationship between kobjects, ksets and
ktypes. The removal of 'struct subsystem' is the first step of this,
especially as it is not really needed at all.Thanks to Kay for fixing the bugs in this patch.
Signed-off-by: Greg Kroah-Hartman
-
Let's allow page-alignment in general for per-cpu data (wanted by Xen, and
Ingo suggested KVM as well).Because larger alignments can use more room, we increase the max per-cpu
memory to 64k rather than 32k: it's getting a little tight.Signed-off-by: Rusty Russell
Signed-off-by: Jeremy Fitzhardinge
Signed-off-by: Andi Kleen
Acked-by: Ingo Molnar
Cc: Andi Kleen
Signed-off-by: Andrew Morton -
Rather than using a single constant PERCPU_ENOUGH_ROOM, compute it as
the sum of kernel_percpu + PERCPU_MODULE_RESERVE. This is now common
to all architectures; if an architecture wants to set
PERCPU_ENOUGH_ROOM to something special, then it may do so (ia64 is
the only one which does).Signed-off-by: Jeremy Fitzhardinge
Signed-off-by: Andi Kleen
Cc: Rusty Russell
Cc: Eric W. Biederman
Cc: Andi Kleen
28 Apr, 2007
1 commit
-
mod_sysfs_setup() doesn't return an errno when kobject_add_dir() for module
"holders" directory fails. So caller of mod_sysfs_setup() will keep going
and get oops.Signed-off-by: Akinobu Mita
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
03 Apr, 2007
1 commit
-
built-in drivers had broken sysfs links that caused bootup hangs for
certain driver unregistry sequences.Signed-off-by: Ingo Molnar
Acked-by: Kay Sievers
Signed-off-by: Greg KH
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
10 Mar, 2007
1 commit
-
This reverts commit 63ce18cfe685115ff8d341bae4c9204a79043cf0.
It was the incorrect fix and causes a reference counting bug whenever
any driver module is removed from the system. Mike Galbraith
is looking for the real fix for his problem.Signed-off-by: Greg Kroah-Hartman
24 Feb, 2007
2 commits
-
This reverts commit c353c3fb0700a3c17ea2b0237710a184232ccd7f.
It turns out that we end up with a loop trying to load the unix
module and calling netfilter to do that. Will redo the patch
later to not have this loop.Acked-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
Fix a reference counting bug exposed by commit
725522b5453dd680412f2b6463a988e4fd148757. If driver.mod_name exists, we
take a reference in module_add_driver(), and never release it. Undo that
reference in module_remove_driver().Signed-off-by: Mike Galbraith
Cc: Kay Sievers
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
17 Feb, 2007
3 commits
-
Fix source files to build with CONFIG_SYSFS=n.
module_subsys is not available.SYSFS=n, MODULES=y: T:y
SYSFS=n, MODULES=n: T:ySYSFS=y, MODULES=y: T:y
SYSFS=y, MODULES=n: T:ySigned-off-by: Randy Dunlap
Signed-off-by: Greg Kroah-Hartman -
Here is a patch that removes all redundant kobject_unregister argument checks.
Signed-off-by: Mariusz Kozlowski
Signed-off-by: Greg Kroah-Hartman -
On recent systems, calls to /sbin/modprobe are handled by udev depending
on the kind of device the kernel has discovered. This patch creates an
uevent for the kernels internal request_module(), to let udev take control
over the request, instead of forking the binary directly by the kernel.
The direct execution of /sbin/modprobe can be disabled by setting:
/sys/module/kmod/mod_request_helper (/proc/sys/kernel/modprobe)
to an empty string, the same way /proc/sys/kernel/hotplug is disabled on an
udev system.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
08 Feb, 2007
3 commits
-
/sys/module/usbcore/
|-- drivers
| |-- usb:hub -> ../../../subsystem/usb/drivers/hub
| |-- usb:usb -> ../../../subsystem/usb/drivers/usb
| `-- usb:usbfs -> ../../../subsystem/usb/drivers/usbfs
|-- holders
| |-- ehci_hcd -> ../../../module/ehci_hcd
| |-- uhci_hcd -> ../../../module/uhci_hcd
| |-- usb_storage -> ../../../module/usb_storage
| `-- usbhid -> ../../../module/usbhid
|-- initstateSigned-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This changes the module core to only create the drivers/ directory if we
are going to put something in it.Cc: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
06 Jan, 2007
1 commit
-
Modules may have drivers with the same name on different buses.
This patch fixes this problem.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
31 Dec, 2006
1 commit
-
mod_sysfs_setup() doesn't return error when kobject_add_dir() failed.
Signed-off-by: Akinobu Mita
Cc: Greg KH
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Dec, 2006
1 commit
-
Show the initialization state(live, coming, going) of the module:
$ cat /sys/module/usbcore/initstate
liveSigned-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
08 Dec, 2006
1 commit
-
- move some file_operations structs into the .rodata section
- move static strings from policy_types[] array into the .rodata section
- fix generic seq_operations usages, so that those structs may be defined
as "const" as well[akpm@osdl.org: couple of fixes]
Signed-off-by: Helge Deller
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Dec, 2006
1 commit
-
Signed-off-by: Al Viro
02 Dec, 2006
1 commit
-
Show the drivers, which belong to the module:
$ ls -l /sys/module/usbcore/drivers/
hub -> ../../../bus/usb/drivers/hub
usb -> ../../../bus/usb/drivers/usb
usbfs -> ../../../bus/usb/drivers/usbfsSigned-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
31 Oct, 2006
1 commit
-
For ndiswrapper, don't set the module->taints flags, just set the kernel
global tainted flag. This should allow ndiswrapper to continue to use GPL
symbols.Signed-off-by: Randy Dunlap
Cc: Florin Malita
Cc: Alan Cox
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 Oct, 2006
1 commit
-
Obvious fix.
Signed-off-by: Jan Dittmer
Acked-by: Florin Malita
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Oct, 2006
1 commit
-
Module taint flags listing in Oops/panic has a couple of issues:
* taint_flags() doesn't null-terminate the buffer after printing the flags
* per-module taints are only set if the kernel is not already tainted
(with that particular flag) => only the first offending module gets its
taint info correctly updatedSome additional changes:
* 'license_gplok' is no longer needed - equivalent to !(taints &
TAINT_PROPRIETARY_MODULE) - so we can drop it from struct module *
exporting module taint info via /proc/module:pwc 88576 0 - Live 0xf8c32000
evilmod 6784 1 pwc, Live 0xf8bbf000 (PF)Signed-off-by: Florin Malita
Cc: "Randy.Dunlap"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
03 Oct, 2006
1 commit
-
Some uses of kallsyms_lookup() do not need to find out the name of a symbol
and its module's name it belongs. This is specially true in arch specific
code, which needs to unwind the stack to show the back trace during oops
(mips is an example). In this specific case, we just need to retreive the
function's size and the offset of the active intruction inside it.Adds a new entry "kallsyms_lookup_size_offset()" This new entry does
exactly the same as kallsyms_lookup() but does not require any buffers to
store any names.It returns 0 if it fails otherwise 1.
Signed-off-by: Franck Bui-Huu
Cc: Rusty Russell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
02 Oct, 2006
1 commit
-
When listing loaded modules during an oops or panic, also list each
module's Tainted flags if non-zero (P: Proprietary or F: Forced load only).If a module is did not taint the kernel, it is just listed like
usbcore
but if it did taint the kernel, it is listed like
wizmodem(PF)Example:
[ 3260.121718] Unable to handle kernel NULL pointer dereference at 0000000000000000 RIP:
[ 3260.121729] [] :dump_test:proc_dump_test+0x99/0xc8
[ 3260.121742] PGD fe8d067 PUD 264a6067 PMD 0
[ 3260.121748] Oops: 0002 [1] SMP
[ 3260.121753] CPU 1
[ 3260.121756] Modules linked in: dump_test(P) snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device ide_cd generic ohci1394 snd_hda_intel snd_hda_codec snd_pcm snd_timer snd ieee1394 snd_page_alloc piix ide_core arcmsr aic79xx scsi_transport_spi usblp
[ 3260.121785] Pid: 5556, comm: bash Tainted: P 2.6.18-git10 #1[Alternatively, I can look into listing tainted flags with 'lsmod',
but that won't help in oopsen/panics so much.][akpm@osdl.org: cleanup]
Signed-off-by: Randy Dunlap
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
30 Sep, 2006
1 commit
-
I've been using systemtap for some debugging and I noticed that it can't
probe a lot of modules. Turns out it's kind of silly, the sections section
of /sys/module is limited to 32byte filenames and many of the actual
sections are a a bit longer than that.[akpm@osdl.org: rewrite to use dymanic allocation]
Cc: Rusty Russell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
26 Sep, 2006
1 commit
-
Invoking load_module() before param_sysfs_init() is called crashes in
mod_sysfs_setup(), since the kset in module_subsys is not initialized yet.In my case, net-pf-1 is getting modprobed as a result of hotplug trying to
create a UNIX socket. Calls to hotplug begin after the topology_init
initcall.Another patch for the same symptom (module_subsys-initialize-earlier.patch)
moves param_sysfs_init() to the subsys initcalls, but this is still not
early enough in the boot process in some cases. In particular,
topology_init() causes /sbin/hotplug to run, which requests net-pf-1 (the
UNIX socket protocol) which can be compiled as a module. Moving
param_sysfs_init() to the postcore initcalls fixes this particular race,
but there might well be other cases where a usermodehelper causes a module
to load earlier still.The patch makes load_module() return an error rather than crashing the
kernel if invoked before module_subsys is initialized.Cc: Mark Huang
Cc: Greg KH
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Jul, 2006
1 commit
-
Got a customer bug report (https://bugzilla.novell.com/190296) about kernel
symbols longer than 127 characters which end up in a string buffer that is
not NULL terminated, leading to garbage in /proc/kallsyms. Using strlcpy
prevents this from happening, even though such symbols still won't come out
right.A better fix would be to not use a fixed-size buffer, but it's probably not
worth the trouble. (Modversion'ed symbols even have a length limit of 60.)[bunk@stusta.de: build fix]
Signed-off-by: Andreas Gruenbacher
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jul, 2006
2 commits
-
Do 'make oldconfig' and accept all the defaults for new config options -
reboot into the kernel and if everything goes well it should boot up fine and
you should have /proc/lockdep and /proc/lockdep_stats files.Typically if the lock validator finds some problem it will print out
voluminous debug output that begins with "BUG: ..." and which syslog output
can be used by kernel developers to figure out the precise locking scenario.What does the lock validator do? It "observes" and maps all locking rules as
they occur dynamically (as triggered by the kernel's natural use of spinlocks,
rwlocks, mutexes and rwsems). Whenever the lock validator subsystem detects a
new locking scenario, it validates this new rule against the existing set of
rules. If this new rule is consistent with the existing set of rules then the
new rule is added transparently and the kernel continues as normal. If the
new rule could create a deadlock scenario then this condition is printed out.When determining validity of locking, all possible "deadlock scenarios" are
considered: assuming arbitrary number of CPUs, arbitrary irq context and task
context constellations, running arbitrary combinations of all the existing
locking scenarios. In a typical system this means millions of separate
scenarios. This is why we call it a "locking correctness" validator - for all
rules that are observed the lock validator proves it with mathematical
certainty that a deadlock could not occur (assuming that the lock validator
implementation itself is correct and its internal data structures are not
corrupted by some other kernel subsystem). [see more details and conditionals
of this statement in include/linux/lockdep.h and
Documentation/lockdep-design.txt]Furthermore, this "all possible scenarios" property of the validator also
enables the finding of complex, highly unlikely multi-CPU multi-context races
via single single-context rules, increasing the likelyhood of finding bugs
drastically. In practical terms: the lock validator already found a bug in
the upstream kernel that could only occur on systems with 3 or more CPUs, and
which needed 3 very unlikely code sequences to occur at once on the 3 CPUs.
That bug was found and reported on a single-CPU system (!). So in essence a
race will be found "piecemail-wise", triggering all the necessary components
for the race, without having to reproduce the race scenario itself! In its
short existence the lock validator found and reported many bugs before they
actually caused a real deadlock.To further increase the efficiency of the validator, the mapping is not per
"lock instance", but per "lock-class". For example, all struct inode objects
in the kernel have inode->inotify_mutex. If there are 10,000 inodes cached,
then there are 10,000 lock objects. But ->inotify_mutex is a single "lock
type", and all locking activities that occur against ->inotify_mutex are
"unified" into this single lock-class. The advantage of the lock-class
approach is that all historical ->inotify_mutex uses are mapped into a single
(and as narrow as possible) set of locking rules - regardless of how many
different tasks or inode structures it took to build this set of rules. The
set of rules persist during the lifetime of the kernel.To see the rough magnitude of checking that the lock validator does, here's a
portion of /proc/lockdep_stats, fresh after bootup:lock-classes: 694 [max: 2048]
direct dependencies: 1598 [max: 8192]
indirect dependencies: 17896
all direct dependencies: 16206
dependency chains: 1910 [max: 8192]
in-hardirq chains: 17
in-softirq chains: 105
in-process chains: 1065
stack-trace entries: 38761 [max: 131072]
combined max dependencies: 2033928
hardirq-safe locks: 24
hardirq-unsafe locks: 176
softirq-safe locks: 53
softirq-unsafe locks: 137
irq-safe locks: 59
irq-unsafe locks: 176The lock validator has observed 1598 actual single-thread locking patterns,
and has validated all possible 2033928 distinct locking scenarios.More details about the design of the lock validator can be found in
Documentation/lockdep-design.txt, which can also found at:http://redhat.com/~mingo/lockdep-patches/lockdep-design.txt
[bunk@stusta.de: cleanups]
Signed-off-by: Ingo Molnar
Signed-off-by: Arjan van de Ven
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add is_module_address() method - to be used by lockdep.
Signed-off-by: Ingo Molnar
Signed-off-by: Arjan van de Ven
Cc: Rusty Russell
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Jul, 2006
1 commit
-
Signed-off-by: Jörn Engel
Signed-off-by: Adrian Bunk
29 Jun, 2006
1 commit
-
Undo bizarre declaration in load_module().
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds