23 Aug, 2007

1 commit


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

    Tejun Heo
     

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

    Rusty Russell
     
  • 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

    Pavel Emelianov
     

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

    Tejun Heo
     

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

    Robert P. J. Day
     
  • 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

    Alexey Dobriyan
     
  • 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

    Alexey Dobriyan
     
  • 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

    Alexey Dobriyan
     
  • 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

    Alexey Dobriyan
     
  • 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

    Alexey Dobriyan
     
  • 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

    Pekka Enberg
     

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

    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

    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

    Jeremy Fitzhardinge
     
  • 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

    Jeremy Fitzhardinge
     

28 Apr, 2007

1 commit


03 Apr, 2007

1 commit


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

    Greg Kroah-Hartman
     

24 Feb, 2007

2 commits


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:y

    SYSFS=y, MODULES=y: T:y
    SYSFS=y, MODULES=n: T:y

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • Here is a patch that removes all redundant kobject_unregister argument checks.

    Signed-off-by: Mariusz Kozlowski
    Signed-off-by: Greg Kroah-Hartman

    Mariusz Kozlowski
     
  • 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

    Kay Sievers
     

08 Feb, 2007

3 commits


06 Jan, 2007

1 commit


31 Dec, 2006

1 commit


14 Dec, 2006

1 commit


08 Dec, 2006

1 commit


04 Dec, 2006

1 commit


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/usbfs

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

31 Oct, 2006

1 commit


29 Oct, 2006

1 commit


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 updated

    Some 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

    Florin Malita
     

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

    Franck Bui-Huu
     

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

    Randy Dunlap
     

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

    Ian S. Nelson
     

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

    Ed Swierk