23 Aug, 2007
1 commit
-
sysfs internals were changed to not pin module in question.
Signed-off-by: Alexey Dobriyan
Acked-by: Kay Sievers
Acked-by: Tejun Heo
Signed-off-by: Greg Kroah-Hartman
18 Jul, 2007
1 commit
-
KSYM_NAME_LEN is peculiar in that it does not include the space for the
trailing '\0', forcing all users to use KSYM_NAME_LEN + 1 when allocating
buffer. This is nonsense and error-prone. Moreover, when the caller
forgets that it's very likely to subtly bite back by corrupting the stack
because the last position of the buffer is always cleared to zero.This patch increments KSYM_NAME_LEN by one and updates code accordingly.
* off-by-one bug in asm-powerpc/kprobes.h::kprobe_lookup_name() macro
is fixed.* Where MODULE_NAME_LEN and KSYM_NAME_LEN were used together,
MODULE_NAME_LEN was treated as if it didn't include space for the
trailing '\0'. Fix it.Signed-off-by: Tejun Heo
Acked-by: Paulo Marques
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Jul, 2007
2 commits
-
Now we always use stop_machine for module insertion or deletion, we no
longer need the modlist_lock: merely disabling preemption is sufficient to
block against list manipulation. This avoids deadlock on OOPSen where we
can potentially grab the lock twice.Bug: 8695
Signed-off-by: Rusty Russell
Cc: Ingo Molnar
Cc: Tobias Oed
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Here there is not need even in .show callback altering. The original code
passes list_head in *v.Signed-off-by: Pavel Emelianov
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Jul, 2007
1 commit
-
sysfs is now completely out of driver/module lifetime game. After
deletion, a sysfs node doesn't access anything outside sysfs proper,
so there's no reason to hold onto the attribute owners. Note that
often the wrong modules were accounted for as owners leading to
accessing removed modules.This patch kills now unnecessary attribute->owner. Note that with
this change, userland holding a sysfs node does not prevent the
backing module from being unloaded.For more info regarding lifetime rule cleanup, please read the
following message.http://article.gmane.org/gmane.linux.kernel/510293
(tweaked by Greg to not delete the field just yet, to make it easier to
merge things properly.)Signed-off-by: Tejun Heo
Cc: Cornelia Huck
Cc: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
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