An error occurred fetching the project authors.
- 27 Jun, 2004 1 commit
-
-
Rusty Russell authored
store_stackinfo() does an unlocked module list walk during normal runtime which opens up a race with the module load/unload code. This can be triggered by simply unloading and loading a module in a loop with CONFIG_DEBUG_PAGEALLOC resulting in store_stackinfo() tripping over bad list pointers. kernel_text_address doesn't take any locks, because during an OOPS we don't want to deadlock. Rename that to __kernel_text_address, and make kernel_text_address take the lock. Signed-off-by: Zwane Mwaikambo <zwane@fsmlabs.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified) Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
- 18 Jun, 2004 2 commits
-
-
Randy Dunlap authored
Add __user annotation for !CONFIG_MODULE_UNLOAD case. From: Mika Kukkonen <mika@osdl.org> Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
-
Russell King authored
This patch cleans up needless includes of asm/pgalloc.h from the fs/ kernel/ and mm/ subtrees. Compile tested on multiple ARM platforms, and x86, this patch appears safe. This patch is part of a larger patch aiming towards getting the include of asm/pgtable.h out of linux/mm.h, so that asm/pgtable.h can sanely get at things like mm_struct and friends. I suggest testing in -mm for a while to ensure there aren't any hidden arch issues. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-
- 04 Jun, 2004 1 commit
-
-
Jonathan Corbet authored
So here I am trying to write about how one can apply gdb to a running kernel, and I'd like to tell people how to debug loadable modules. Only with the 2.6 module loader, there's no way to find out where the various sections in the module image ended up, so you can't do much. This patch attempts to fix that by adding a "sections" subdirectory to every module's entry in /sys/module; each attribute in that directory associates a beginning address with the section name. Those attributes can be used by a a simple script to generate an add-symbol-file command for gdb, something like: #!/bin/bash # # gdbline module image # # Outputs an add-symbol-file line suitable for pasting into gdb to examine # a loaded module. # cd /sys/module/$1/sections echo -n add-symbol-file $2 `/bin/cat .text` for section in .[a-z]* *; do if [ $section != ".text" ]; then echo " \\" echo -n " -s" $section `/bin/cat $section` fi done echo Currently, this feature is absent if CONFIG_KALLSYMS is not set. I do wonder if CONFIG_DEBUG_INFO might not be a better choice, now that I think about it. Section names are unmunged, so "ls -a" is needed to see most of them. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
- 15 May, 2004 1 commit
-
-
Andrew Morton authored
From: Arjan van de Ven <arjanv@redhat.com>, Rusty Russell <rusty@rustcorp.com.au> The patch below resolves the "Not Yet Implemented" print_modules() thing. This is a really useful feature for distros; it allows us to do statistical analysis on which modules are present how often in oopses compared to how often they are used normally. In addition it helps to spot candidates for certain bugs without having to go back to the customer asking for this information.
-
- 11 May, 2004 1 commit
-
-
Greg Kroah-Hartman authored
Thanks to Andrew Morton for pointing this out to me.
-
- 10 May, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> Only print the tainted message the first time. Its purpose is to warn users that we can't support them, not to fill their logs.
-
- 07 May, 2004 1 commit
-
-
Greg Kroah-Hartman authored
This patch adds basic kobject support to struct module, and it creates a /sys/module directory which contains all of the individual modules. Each module currently exports the refcount (if they are unloadable) and any module paramaters that are marked exportable in sysfs. Was written by me and Rusty over and over many times during the past 6 months.
-
- 19 Apr, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> From: Pavel Roskin <proski@gnu.org> If you use both module_param (new) and MODULE_PARM (obsolete) in a module, only the second gets recognised. Warn.
-
- 18 Apr, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> People still build modules wrong, particularly without -fno-common. The resulting modules don't load, but we should at least warn about it.
-
- 12 Apr, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> mod->waiter needs to be set before we try to stop the module: setting it in __try_stop_module means it gets set to the kthread, not rmmod.
-
- 15 Mar, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> Fix a problem with kallsyms being unable to look up symbols which are in modules. add_kallsyms should be above module_finalize, which means you can just use the mod->symtab and mod->strtab members.
-
- 14 Mar, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> From: Andrea Arcangeli <andrea@suse.de> We should drop module sem before calling mod->exit, for practical reasons: too many module exit functions oops or hang, resulting in a permenantly held module sem, which blocks all module ops including lsmod.
-
- 08 Mar, 2004 1 commit
-
-
Rusty Russell authored
Now we've moved the bogolock code out to stop_machine.c and generalized it a little, use it in module.c and delete the duplicate code there.
-
- 26 Feb, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@au1.ibm.com> Attached patch adds a kallsyms_lookupname() function for lookups of a symbol name to an address. Debuggers such as ppc[64] xmon can use this. It's intentionally not exported as a symbol for module use, since it can be used to circumvent other symbol export restrictions.
-
- 25 Feb, 2004 1 commit
-
-
Andrew Morton authored
From: "Randy.Dunlap" <rddunlap@osdl.org> Add syscalls.h, which contains prototypes for the kernel's system calls. Replace open-coded declarations all over the place. This patch found a couple of prior bugs. It appears to be more important with -mregparm=3 as we discover more asmlinkage mismatches. Some syscalls have arch-dependent arguments, so their prototypes are in the arch-specific unistd.h. Maybe it should have been asm/syscalls.h, but there were already arch-specific syscall prototypes in asm/unistd.h... Tested on x86, ia64, x86_64, ppc64, s390 and sparc64. May cause trivial-to-fix build breakage on other architectures.
-
- 18 Feb, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> These two patches provide the framework for stopping kernel threads to allow hotplug CPU. This one just adds kthread.c and kthread.h, next one uses it. Most importantly, adds a Monty Python quote to the kernel. Details: The hotplug CPU code introduces two major problems: 1) Threads which previously never stopped (migration thread, ksoftirqd, keventd) have to be stopped cleanly as CPUs go offline. 2) Threads which previously never had to be created now have to be created when a CPU goes online. Unfortunately, stopping a thread is fairly baroque, involving memory barriers, a completion and spinning until the task is actually dead (for example, complete_and_exit() must be used if inside a module). There are also three problems in starting a thread: 1) Doing it from a random process context risks environment contamination: better to do it from keventd to guarantee a clean environment, a-la call_usermodehelper. 2) Getting the task struct without races is a hard: see kernel/sched.c migration_call(), kernel/workqueue.c create_workqueue_thread(). 3) There are races in starting a thread for a CPU which is not yet online: migration thread does a complex dance at the moment for a similar reason (there may be no migration thread to migrate us). Place all this logic in some primitives to make life easier: kthread_create() and kthread_stop(). These primitives require no extra data-structures in the caller: they operate on normal "struct task_struct"s. Other changes: - Expose keventd_up(), as keventd and migration threads will use kthread to launch, and kthread normally uses workqueues and must recognize this case. - Kthreads created at boot before "keventd" are spawned directly. However, this means that they don't have all signals blocked, and hence can be killed. The simplest solution is to always explicitly block all signals in the kthread. - Change over the migration threads, the workqueue threads and the ksoftirqd threads to use kthread. - module.c currently spawns threads directly to stop the machine, so a module can be atomically tested for removal. - Unfortunately, this means that the current task is manipulated (which races with set_cpus_allowed, for example), and it can't set its priority artificially high. Using a kernel thread can solve this cleanly, and with kthread_run, it's simple. - kthreads use keventd, so they inherit its cpus_allowed mask. Unset it. All current users set it explicity anyway, but it's nice to fix. - call_usermode_helper uses keventd, so the process created inherits its cpus_allowed mask. Unset it. - Prevent errors in boot when cpus_possible() contains a cpu which is not online (ie. a cpu didn't come up). This doesn't happen on x86, since a boot failure makes that CPU no longer possible (hacky, but it works). - When the cpu fails to come up, some callbacks do kthread_stop(), which doesn't work without keventd (which hasn't started yet). Call it directly, and take care that it restores signal state (note: do_sigaction does a flush on blocked signals, so we don't need to repeat it).
-
- 04 Feb, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> The cpucontrol mutex is not required when no cpus can go up and down. Andrew wrote a wrapper for it to avoid #ifdefs, this expands that to only be defined for CONFIG_HOTPLUG_CPU, and uses it everywhere. The only downside is that the cpucontrol lock was overloaded by my recent patch to net/core/flow.c to protect it from reentrance, so this reintroduces the local flow_flush_sem. This code isn't speed critical, so taking two locks when CONFIG_HOTPLUG_CPU=y is not really an issue.
-
- 20 Jan, 2004 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> I *do* want to add a check for a truncated module, since that's probably the most common case (^C on "make modules_install"). But I don't want to double the size of module.c with every check I can think of. tested with: # bs=0; while [ $bs -lt 3764 ]; do dd if=dummy.ko bs=$bs count=1 2>/dev/null | insmod -; bs=`expr $bs + 1`; done
-
- 19 Jan, 2004 2 commits
-
-
Paul Mackerras authored
This patch arranges for the exception tables to be sorted on most architectures. It sorts the main kernel exception table on startup and the module exception tables when they get loaded. The main table is sorted reasonably early - just after kmem_cache_init - but that could be moved even earlier if necessary. There is now a lib/extable.c which includes the sort_extable() function from arch/ppc/mm/extable.c and the search_extable() function from arch/i386/mm/extable.c, which had been copied to many architectures. On many architectures, arch/$(ARCH)/mm/extable.c became empty and so I have removed it. There are four architectures which do things differently from i386: alpha, ia64, sparc and sparc64. Alpha and ia64 store the offset from the offset from the exception table entry to the instruction, and sparc and sparc64 have range entries in the table. For those architectures I have added empty sort_extable functions. The maintainers for those architectures can implement something better if they care to. As it is they are no worse off than before. Although it is a moderately sizable patch, it ends up with a net reduction of 377 lines in the size of the kernel source. :) I have tested this on x86 and ppc with a module that uses __get_user in an init function, deliberately laid out to get the exception table out of order, and it works (whereas it oopsed without this patch).
-
Andrew Morton authored
From: Rusty Russell <rusty@au1.ibm.com> Vatsa spotted this: you can remove a module while it's being initialized, and that will be bad. Hole was opened when I dropped the sem around the init routine (which can probe for other modules).
-
- 07 Jan, 2004 1 commit
-
-
Linus Torvalds authored
This fixes loading of modules compiled with debugging on some platforms. From Rusty.
-
- 29 Oct, 2003 1 commit
-
-
Rusty Russell authored
Bug reported by Paul Mackerras: if a module parameter fails, we didn't call module_arch_cleanup(). On x86 this was harmless (module_arch_cleanup() is a no-op), but on other architectures like PPC this causes inconsistent data structures and subsequent oopses.
-
- 09 Oct, 2003 1 commit
-
-
Rusty Russell authored
Paul McKenney convinced me that there's no *guarantee* that all archs will refuse the speculate the atomic ops above the state test, eg: CPU0 (stopref_set_state) CPU1 (stopref) atomic_set(&ack, 0); if (state == XXX) wmb(); atomic_inc(&ack); state = XXX; Certainly Alpha needs a rmb() inside stopref to guarantee it sees the same ordering.
-
- 01 Oct, 2003 1 commit
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> Found this while converting netfilter modules to use the new parameters. Also fixes an out-by-one error in maximum elements you can put in array. The current "intarray" module params were never tested, and um, suck. Only one person uses them, and it looks painful. Since noone uses them, replace them with tested versions.
-
- 07 Sep, 2003 1 commit
-
-
Rusty Russell authored
Someone pointed out that -ffunction-sections can cause a function called "init<something>" to be put in the init section, and discarded. This hurts PARISC badly. Get more fussy with identifying them.
-
- 18 Aug, 2003 1 commit
-
-
Andrew Morton authored
From: William Lee Irwin III <wli@holomorphy.com> Contributions from: Jan Dittmer <jdittmer@sfhq.hn.org> Arnd Bergmann <arnd@arndb.de> "Bryan O'Sullivan" <bos@serpentine.com> "David S. Miller" <davem@redhat.com> Badari Pulavarty <pbadari@us.ibm.com> "Martin J. Bligh" <mbligh@aracnet.com> Zwane Mwaikambo <zwane@linuxpower.ca> It has ben tested on x86, sparc64, x86_64, ia64 (I think), ppc and ppc64. cpumask_t enables systems with NR_CPUS > BITS_PER_LONG to utilize all their cpus by creating an abstract data type dedicated to representing cpu bitmasks, similar to fd sets from userspace, and sweeping the appropriate code to update callers to the access API. The fd set-like structure is according to Linus' own suggestion; the macro calling convention to ambiguate representations with minimal code impact is my own invention. Specifically, a new set of inline functions for manipulating arbitrary-width bitmaps is introduced with a relatively simple implementation, in tandem with a new data type representing bitmaps of width NR_CPUS, cpumask_t, whose accessor functions are defined in terms of the bitmap manipulation inlines. This bitmap ADT found an additional use in i386 arch code handling sparse physical APIC ID's, which was convenient to use in this case as the accounting structure was required to be wider to accommodate the physids consumed by larger numbers of cpus. For the sake of simplicity and low code impact, these cpu bitmasks are passed primarily by value; however, an additional set of accessors along with an auxiliary data type with const call-by-reference semantics is provided to address performance concerns raised in connection with very large systems, such as SGI's larger models, where copying and call-by-value overhead would be prohibitive. Few (if any) users of the call-by-reference API are immediately introduced. Also, in order to avoid calling convention overhead on architectures where structures are required to be passed by value, NR_CPUS <= BITS_PER_LONG is special-cased so that cpumask_t falls back to an unsigned long and the accessors perform the usual bit twiddling on unsigned longs as opposed to arrays thereof. Audits were done with the structure overhead in-place, restoring this special-casing only afterward so as to ensure a more complete API conversion while undergoing the majority of its end-user exposure in -mm. More -mm's were shipped after its restoration to be sure that was tested, too. The immediate users of this functionality are Sun sparc64 systems, SGI mips64 and ia64 systems, and IBM ia32, ppc64, and s390 systems. Of these, only the ppc64 machines needing the functionality have yet to be released; all others have had systems requiring it for full functionality for at least 6 months, and in some cases, since the initial Linux port to the affected architecture.
-
- 18 Jul, 2003 3 commits
-
-
Rusty Russell authored
Author: Neil Brown Define module_put_and_exit() and use it for nfsd/lockd Both nfsd and lockd have threads which expect to hold a reference to the module while the thread is running. In order for the thread to be able to put_module() the module before exiting, the put_module code must be call from outside the module. This patch provides module_put_and_exit in non-modular code which a thread-in-a-module can call. It also gets nfsd and lockd to use it as appropriate. Note that in lockd, we can __get_module in the thread itself as the creator of the thread is waiting for the thread to startup. In nfsd and for the 'reclaimer' threaded started by locked, we __get_module first and put_module if the thread failed to start.
-
Rusty Russell authored
Somehow, the code which taints the kernel when rmmod -f is used got lost. Restore it.
-
Rusty Russell authored
Uses local_t for module reference counts.
-
- 01 Jul, 2003 1 commit
-
-
Rusty Russell authored
Remember the size of the SHF_EXECINSTR sections, which are conveniently at the start of the modules, and use that to more reliably implement module_text_address().
-
- 10 Jun, 2003 1 commit
-
-
Rusty Russell authored
Milton Miller noticed a free-after-use problem in the cleanup path of a failed module load. The problem is that mod is moved to point from the sucked-in file (always freed last) to the module core, after which time the "free(mod->core), reference mod->percpu" sequence is bogus, eg. when the module_init function fails. This is fixed by keeping the pointer in a local variable, which solves the problem. We no longer need to reference the free'd data structure.
-
- 07 Jun, 2003 1 commit
-
-
Andrew Morton authored
From: "David S. Miller" <davem@redhat.com> add_kallsyms() doesn't exist if !CONFIG_KALLSYMS.
-
- 06 Jun, 2003 2 commits
-
-
Rusty Russell authored
This adds a /proc/kallsyms if you have CONFIG_KALLSYMS in your kernel. The output is nm-like, with symbols in caps (global) if exported using EXPORT_SYMBOL, rather than the normal static vs. non-static differentiation. This is useful for things like performance monitoring tools (profiling etc) that want to match addresses to names in user space.
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> OK, this does the *minimum* required to support DEFINE_PER_CPU inside modules. If we decide to change kmalloc_percpu later, great, we can turf this out. Basically, overallocates the amount of per-cpu data at boot to at least PERCPU_ENOUGH_ROOM if CONFIG_MODULES=y (arch-specific by default 32k: I have only 7744 bytes of percpu data in my kernel here, so makes sense), and a special allocator in module.c dishes it out.
-
- 12 May, 2003 2 commits
-
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au> __module_get is theoretically allowed on module inside init, since we already hold an implicit reference. Currently this BUG()s: make the reference count explicit, which also simplifies delete path. Also cleans up unload path, such that it only drops semaphore when it's actually sleeping for rmmod --wait.
-
Andrew Morton authored
From: Rusty Russell <rusty@rustcorp.com.au>, David Mosberger The patch below updates the other platforms with module_arch_cleanup(). Also, I added more debug output to kernel/module.c since I found it useful to be able to see the final section layout.
-
- 30 Apr, 2003 2 commits
-
-
Rusty Russell authored
Introduces __module_get for places where we know we already hold a reference and ignoring the fact that the module is being "rmmod --wait"ed is simpler.
-
Rusty Russell authored
Restores .modinfo section, and uses it to store license and vermagic.
-
- 15 Apr, 2003 1 commit
-
-
David Mosberger authored
Fix for trivial typo. Without it, you can't insert anything on top of agpgart.ko because the agp_register_driver() will erroneously pick up the symbol version from agp_backend_acquire().
-