12 Jun, 2014

1 commit

  • Pull module updates from Rusty Russell:
    "Most of this is cleaning up various driver sysfs permissions so we can
    re-add the perm check (we unified the module param and sysfs checks,
    but the module ones were stronger so we weakened them temporarily).

    Param parsing gets documented, and also "--" now forces args to be
    handed to init (and ignored by the kernel).

    Module NX/RO protections get tightened: we now set them before calling
    parse_args()"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    module: set nx before marking module MODULE_STATE_COMING.
    samples/kobject/: avoid world-writable sysfs files.
    drivers/hid/hid-picolcd_fb: avoid world-writable sysfs files.
    drivers/staging/speakup/: avoid world-writable sysfs files.
    drivers/regulator/virtual: avoid world-writable sysfs files.
    drivers/scsi/pm8001/pm8001_ctl.c: avoid world-writable sysfs files.
    drivers/hid/hid-lg4ff.c: avoid world-writable sysfs files.
    drivers/video/fbdev/sm501fb.c: avoid world-writable sysfs files.
    drivers/mtd/devices/docg3.c: avoid world-writable sysfs files.
    speakup: fix incorrect perms on speakup_acntsa.c
    cpumask.h: silence warning with -Wsign-compare
    Documentation: Update kernel-parameters.tx
    param: hand arguments after -- straight to init
    modpost: Fix resource leak in read_dump()

    Linus Torvalds
     

14 May, 2014

1 commit

  • We currently set RO & NX on modules very late: after we move them from
    MODULE_STATE_UNFORMED to MODULE_STATE_COMING, and after we call
    parse_args() (which can exec code in the module).

    Much better is to do it in complete_formation() and then call
    the notifier.

    This means that the notifiers will be called on a module which
    is already RO & NX, so that may cause problems (ftrace already
    changed so they're unaffected).

    Signed-off-by: Rusty Russell

    Rusty Russell
     

02 May, 2014

1 commit


28 Apr, 2014

3 commits

  • A race exists between module loading and enabling of function tracer.

    CPU 1 CPU 2
    ----- -----
    load_module()
    module->state = MODULE_STATE_COMING

    register_ftrace_function()
    mutex_lock(&ftrace_lock);
    ftrace_startup()
    update_ftrace_function();
    ftrace_arch_code_modify_prepare()
    set_all_module_text_rw();

    ftrace_arch_code_modify_post_process()
    set_all_module_text_ro();

    [ here all module text is set to RO,
    including the module that is
    loading!! ]

    blocking_notifier_call_chain(MODULE_STATE_COMING);
    ftrace_init_module()

    [ tries to modify code, but it's RO, and fails!
    ftrace_bug() is called]

    When this race happens, ftrace_bug() will produces a nasty warning and
    all of the function tracing features will be disabled until reboot.

    The simple solution is to treate module load the same way the core
    kernel is treated at boot. To hardcode the ftrace function modification
    of converting calls to mcount into nops. This is done in init/main.c
    there's no reason it could not be done in load_module(). This gives
    a better control of the changes and doesn't tie the state of the
    module to its notifiers as much. Ftrace is special, it needs to be
    treated as such.

    The reason this would work, is that the ftrace_module_init() would be
    called while the module is in MODULE_STATE_UNFORMED, which is ignored
    by the set_all_module_text_ro() call.

    Link: http://lkml.kernel.org/r/1395637826-3312-1-git-send-email-indou.takao@jp.fujitsu.com

    Reported-by: Takao Indoh
    Acked-by: Rusty Russell
    Cc: stable@vger.kernel.org # 2.6.38+
    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     
  • The kernel passes any args it doesn't need through to init, except it
    assumes anything containing '.' belongs to the kernel (for a module).
    This change means all users can clearly distinguish which arguments
    are for init.

    For example, the kernel uses debug ("dee-bug") to mean log everything to
    the console, where systemd uses the debug from the Scandinavian "day-boog"
    meaning "fail to boot". If a future versions uses argv[] instead of
    reading /proc/cmdline, this confusion will be avoided.

    eg: test 'FOO="this is --foo"' -- 'systemd.debug="true true true"'

    Gives:
    argv[0] = '/debug-init'
    argv[1] = 'test'
    argv[2] = 'systemd.debug=true true true'
    envp[0] = 'HOME=/'
    envp[1] = 'TERM=linux'
    envp[2] = 'FOO=this is --foo'

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • We remove the waiting module removal in commit 3f2b9c9cdf38 (September
    2013), but it turns out that modprobe in kmod (< version 16) was
    asking for waiting module removal. No one noticed since modprobe would
    check for 0 usage immediately before trying to remove the module, and
    the race is unlikely.

    However, it means that anyone running old (but not ancient) kmod
    versions is hitting the printk designed to see if anyone was running
    "rmmod -w". All reports so far have been false positives, so remove
    the warning.

    Fixes: 3f2b9c9cdf389e303b2273679af08aab5f153517
    Reported-by: Valerio Vanni
    Cc: Elliott, Robert (Server Storage)
    Cc: stable@kernel.org
    Acked-by: Lucas De Marchi
    Signed-off-by: Rusty Russell

    Rusty Russell
     

08 Apr, 2014

1 commit

  • The initialization of a structure is not subject to synchronization.
    The use of __this_cpu would trigger a false positive with the additional
    preemption checks for __this_cpu ops.

    So simply disable the check through the use of raw_cpu ops.

    Trace:

    __this_cpu_write operation in preemptible [00000000] code: modprobe/286
    caller is __this_cpu_preempt_check+0x38/0x60
    CPU: 3 PID: 286 Comm: modprobe Tainted: GF 3.12.0-rc4+ #187
    Call Trace:
    dump_stack+0x4e/0x82
    check_preemption_disabled+0xec/0x110
    __this_cpu_preempt_check+0x38/0x60
    load_module+0xcfd/0x2650
    SyS_init_module+0xa6/0xd0
    tracesys+0xe1/0xe6

    Signed-off-by: Christoph Lameter
    Acked-by: Ingo Molnar
    Acked-by: Rusty Russell
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

07 Apr, 2014

1 commit

  • Pull module updates from Rusty Russell:
    "Nothing major: the stricter permissions checking for sysfs broke a
    staging driver; fix included. Greg KH said he'd take the patch but
    hadn't as the merge window opened, so it's included here to avoid
    breaking build"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    staging: fix up speakup kobject mode
    Use 'E' instead of 'X' for unsigned module taint flag.
    VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.
    kallsyms: fix percpu vars on x86-64 with relocation.
    kallsyms: generalize address range checking
    module: LLVMLinux: Remove unused function warning from __param_check macro
    Fix: module signature vs tracepoints: add new TAINT_UNSIGNED_MODULE
    module: remove MODULE_GENERIC_TABLE
    module: allow multiple calls to MODULE_DEVICE_TABLE() per module
    module: use pr_cont

    Linus Torvalds
     

01 Apr, 2014

1 commit

  • Pull x86 LTO changes from Peter Anvin:
    "More infrastructure work in preparation for link-time optimization
    (LTO). Most of these changes is to make sure symbols accessed from
    assembly code are properly marked as visible so the linker doesn't
    remove them.

    My understanding is that the changes to support LTO are still not
    upstream in binutils, but are on the way there. This patchset should
    conclude the x86-specific changes, and remaining patches to actually
    enable LTO will be fed through the Kbuild tree (other than keeping up
    with changes to the x86 code base, of course), although not
    necessarily in this merge window"

    * 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits)
    Kbuild, lto: Handle basic LTO in modpost
    Kbuild, lto: Disable LTO for asm-offsets.c
    Kbuild, lto: Add a gcc-ld script to let run gcc as ld
    Kbuild, lto: add ld-version and ld-ifversion macros
    Kbuild, lto: Drop .number postfixes in modpost
    Kbuild, lto, workaround: Don't warn for initcall_reference in modpost
    lto: Disable LTO for sys_ni
    lto: Handle LTO common symbols in module loader
    lto, workaround: Add workaround for initcall reordering
    lto: Make asmlinkage __visible
    x86, lto: Disable LTO for the x86 VDSO
    initconst, x86: Fix initconst mistake in ts5500 code
    initconst: Fix initconst mistake in dcdbas
    asmlinkage: Make trace_hardirqs_on/off_caller visible
    asmlinkage, x86: Fix 32bit memcpy for LTO
    asmlinkage Make __stack_chk_failed and memcmp visible
    asmlinkage: Mark rwsem functions that can be called from assembler asmlinkage
    asmlinkage: Make main_extable_sort_needed visible
    asmlinkage, mutex: Mark __visible
    asmlinkage: Make trace_hardirq visible
    ...

    Linus Torvalds
     

31 Mar, 2014

1 commit

  • Takashi Iwai says:
    > The letter 'X' has been already used for SUSE kernels for very long
    > time, to indicate the external supported modules. Can the new flag be
    > changed to another letter for avoiding conflict...?
    > (BTW, we also use 'N' for "no support", too.)

    Note: this code should be cleaned up, so we don't have such maps in
    three places!

    Signed-off-by: Rusty Russell

    Rusty Russell
     

21 Mar, 2014

1 commit


13 Mar, 2014

2 commits

  • Users have reported being unable to trace non-signed modules loaded
    within a kernel supporting module signature.

    This is caused by tracepoint.c:tracepoint_module_coming() refusing to
    take into account tracepoints sitting within force-loaded modules
    (TAINT_FORCED_MODULE). The reason for this check, in the first place, is
    that a force-loaded module may have a struct module incompatible with
    the layout expected by the kernel, and can thus cause a kernel crash
    upon forced load of that module on a kernel with CONFIG_TRACEPOINTS=y.

    Tracepoints, however, specifically accept TAINT_OOT_MODULE and
    TAINT_CRAP, since those modules do not lead to the "very likely system
    crash" issue cited above for force-loaded modules.

    With kernels having CONFIG_MODULE_SIG=y (signed modules), a non-signed
    module is tainted re-using the TAINT_FORCED_MODULE taint flag.
    Unfortunately, this means that Tracepoints treat that module as a
    force-loaded module, and thus silently refuse to consider any tracepoint
    within this module.

    Since an unsigned module does not fit within the "very likely system
    crash" category of tainting, add a new TAINT_UNSIGNED_MODULE taint flag
    to specifically address this taint behavior, and accept those modules
    within Tracepoints. We use the letter 'X' as a taint flag character for
    a module being loaded that doesn't know how to sign its name (proposed
    by Steven Rostedt).

    Also add the missing 'O' entry to trace event show_module_flags() list
    for the sake of completeness.

    Signed-off-by: Mathieu Desnoyers
    Acked-by: Steven Rostedt
    NAKed-by: Ingo Molnar
    CC: Thomas Gleixner
    CC: David Howells
    CC: Greg Kroah-Hartman
    Signed-off-by: Rusty Russell

    Mathieu Desnoyers
     
  • When dumping loaded modules, we print them one by one in separate
    printks. Let's use pr_cont as they are continuation prints.

    Signed-off-by: Jiri Slaby
    Cc: Rusty Russell
    Signed-off-by: Rusty Russell

    Jiri Slaby
     

14 Feb, 2014

1 commit

  • Here is the workaround I made for having the kernel not reject modules
    built with -flto. The clean solution would be to get the compiler to not
    emit the symbol. Or if it has to emit the symbol, then emit it as
    initialized data but put it into a comdat/linkonce section.

    Minor tweaks by AK over Joe's patch.

    Cc: Rusty Russell
    Signed-off-by: Andi Kleen
    Link: http://lkml.kernel.org/r/1391846481-31491-5-git-send-email-ak@linux.intel.com
    Signed-off-by: H. Peter Anvin

    Joe Mario
     

21 Jan, 2014

1 commit


15 Nov, 2013

1 commit

  • Pull module updates from Rusty Russell:
    "Mainly boring here, too. rmmod --wait finally removed, though"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    modpost: fix bogus 'exported twice' warnings.
    init: fix in-place parameter modification regression
    asmlinkage, module: Make ksymtab and kcrctab symbols and __this_module __visible
    kernel: add support for init_array constructors
    modpost: Optionally ignore secondary errors seen if a single module build fails
    module: remove rmmod --wait option.

    Linus Torvalds
     

13 Nov, 2013

1 commit

  • kernel/module.c uses a mix of printk(KERN_foo and pr_foo(). Convert it
    all to pr_foo and make the offered cleanups.

    Not sure what to do about the printk(KERN_DEFAULT). We don't have a
    pr_default().

    Cc: Rusty Russell
    Cc: Joe Perches
    Cc: Frantisek Hrbata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

17 Oct, 2013

1 commit

  • This adds the .init_array section as yet another section with constructors. This
    is needed because gcc could add __gcov_init calls to .init_array or .ctors
    section, depending on gcc (and binutils) version .

    v2: - reuse mod->ctors for .init_array section for modules, because gcc uses
    .ctors or .init_array, but not both at the same time
    v3: - fail to load if that does happen somehow.

    Signed-off-by: Frantisek Hrbata
    Signed-off-by: Rusty Russell

    Frantisek Hrbata
     

23 Sep, 2013

1 commit

  • The option to wait for a module reference count to reach zero was in
    the initial module implementation, but it was never supported in
    modprobe (you had to use rmmod --wait). After discussion with Lucas,
    It has been deprecated (with a 10 second sleep) in kmod for the last
    year.

    This finally removes it: the flag will evoke a printk warning and a
    normal (non-blocking) remove attempt.

    Cc: Lucas De Marchi
    Signed-off-by: Rusty Russell

    Rusty Russell
     

05 Sep, 2013

1 commit

  • Pull vfs pile 1 from Al Viro:
    "Unfortunately, this merge window it'll have a be a lot of small piles -
    my fault, actually, for not keeping #for-next in anything that would
    resemble a sane shape ;-/

    This pile: assorted fixes (the first 3 are -stable fodder, IMO) and
    cleanups + %pd/%pD formats (dentry/file pathname, up to 4 last
    components) + several long-standing patches from various folks.

    There definitely will be a lot more (starting with Miklos'
    check_submount_and_drop() series)"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
    direct-io: Handle O_(D)SYNC AIO
    direct-io: Implement generic deferred AIO completions
    add formats for dentry/file pathnames
    kvm eventfd: switch to fdget
    powerpc kvm: use fdget
    switch fchmod() to fdget
    switch epoll_ctl() to fdget
    switch copy_module_from_fd() to fdget
    git simplify nilfs check for busy subtree
    ibmasmfs: don't bother passing superblock when not needed
    don't pass superblock to hypfs_{mkdir,create*}
    don't pass superblock to hypfs_diag_create_files
    don't pass superblock to hypfs_vm_create_files()
    oprofile: get rid of pointless forward declarations of struct super_block
    oprofilefs_create_...() do not need superblock argument
    oprofilefs_mkdir() doesn't need superblock argument
    don't bother with passing superblock to oprofile_create_stats_files()
    oprofile: don't bother with passing superblock to ->create_files()
    don't bother passing sb to oprofile_create_files()
    coh901318: don't open-code simple_read_from_buffer()
    ...

    Linus Torvalds
     

04 Sep, 2013

1 commit


03 Sep, 2013

1 commit

  • DEBUG_KOBJECT_RELEASE helps to find the issue attached below.

    After some investigation, it seems the reason is:
    The mod->mkobj.kobj(ffffffffa01600d0 below) is freed together with mod
    itself in free_module(). However, its children still hold references to
    it, as the delay caused by DEBUG_KOBJECT_RELEASE. So when the
    child(holders below) tries to decrease the reference count to its parent
    in kobject_del(), BUG happens as it tries to access already freed memory.

    This patch tries to fix it by waiting for the mod->mkobj.kobj to be
    really released in the module removing process (and some error code
    paths).

    [ 1844.175287] kobject: 'holders' (ffff88007c1f1600): kobject_release, parent ffffffffa01600d0 (delayed)
    [ 1844.178991] kobject: 'notes' (ffff8800370b2a00): kobject_release, parent ffffffffa01600d0 (delayed)
    [ 1845.180118] kobject: 'holders' (ffff88007c1f1600): kobject_cleanup, parent ffffffffa01600d0
    [ 1845.182130] kobject: 'holders' (ffff88007c1f1600): auto cleanup kobject_del
    [ 1845.184120] BUG: unable to handle kernel paging request at ffffffffa01601d0
    [ 1845.185026] IP: [] kobject_put+0x11/0x60
    [ 1845.185026] PGD 1a13067 PUD 1a14063 PMD 7bd30067 PTE 0
    [ 1845.185026] Oops: 0000 [#1] PREEMPT
    [ 1845.185026] Modules linked in: xfs libcrc32c [last unloaded: kprobe_example]
    [ 1845.185026] CPU: 0 PID: 18 Comm: kworker/0:1 Tainted: G O 3.11.0-rc6-next-20130819+ #1
    [ 1845.185026] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
    [ 1845.185026] Workqueue: events kobject_delayed_cleanup
    [ 1845.185026] task: ffff88007ca51f00 ti: ffff88007ca5c000 task.ti: ffff88007ca5c000
    [ 1845.185026] RIP: 0010:[] [] kobject_put+0x11/0x60
    [ 1845.185026] RSP: 0018:ffff88007ca5dd08 EFLAGS: 00010282
    [ 1845.185026] RAX: 0000000000002000 RBX: ffffffffa01600d0 RCX: ffffffff8177d638
    [ 1845.185026] RDX: ffff88007ca5dc18 RSI: 0000000000000000 RDI: ffffffffa01600d0
    [ 1845.185026] RBP: ffff88007ca5dd18 R08: ffffffff824e9810 R09: ffffffffffffffff
    [ 1845.185026] R10: ffff8800ffffffff R11: dead4ead00000001 R12: ffffffff81a95040
    [ 1845.185026] R13: ffff88007b27a960 R14: ffff88007c1f1600 R15: 0000000000000000
    [ 1845.185026] FS: 0000000000000000(0000) GS:ffffffff81a23000(0000) knlGS:0000000000000000
    [ 1845.185026] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [ 1845.185026] CR2: ffffffffa01601d0 CR3: 0000000037207000 CR4: 00000000000006b0
    [ 1845.185026] Stack:
    [ 1845.185026] ffff88007c1f1600 ffff88007c1f1600 ffff88007ca5dd38 ffffffff812cdb7e
    [ 1845.185026] 0000000000000000 ffff88007c1f1640 ffff88007ca5dd68 ffffffff812cdbfe
    [ 1845.185026] ffff88007c974800 ffff88007c1f1640 ffff88007ff61a00 0000000000000000
    [ 1845.185026] Call Trace:
    [ 1845.185026] [] kobject_del+0x2e/0x40
    [ 1845.185026] [] kobject_delayed_cleanup+0x6e/0x1d0
    [ 1845.185026] [] process_one_work+0x1e5/0x670
    [ 1845.185026] [] ? process_one_work+0x183/0x670
    [ 1845.185026] [] worker_thread+0x113/0x370
    [ 1845.185026] [] ? rescuer_thread+0x290/0x290
    [ 1845.185026] [] kthread+0xda/0xe0
    [ 1845.185026] [] ? _raw_spin_unlock_irq+0x30/0x60
    [ 1845.185026] [] ? kthread_create_on_node+0x130/0x130
    [ 1845.185026] [] ret_from_fork+0x7a/0xb0
    [ 1845.185026] [] ? kthread_create_on_node+0x130/0x130
    [ 1845.185026] Code: 81 48 c7 c7 28 95 ad 81 31 c0 e8 9b da 01 00 e9 4f ff ff ff 66 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 83 ec 08 48 85 ff 74 1d 87 00 01 00 00 01 74 1e 48 8d 7b 38 83 6b 38 01 0f 94 c0 84
    [ 1845.185026] RIP [] kobject_put+0x11/0x60
    [ 1845.185026] RSP
    [ 1845.185026] CR2: ffffffffa01601d0
    [ 1845.185026] ---[ end trace 49a70afd109f5653 ]---

    Signed-off-by: Li Zhong
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Rusty Russell

    Li Zhong
     

20 Aug, 2013

2 commits


11 Jul, 2013

1 commit

  • Pull module updates from Rusty Russell:
    "Nothing interesting. Except the most embarrassing bugfix ever. But
    let's ignore that"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    module: cleanup call chain.
    module: do percpu allocation after uniqueness check. No, really!
    modules: don't fail to load on unknown parameters.
    ABI: Clarify when /sys/module/MODULENAME is created
    There is no /sys/parameters
    module: don't modify argument of module_kallsyms_lookup_name()

    Linus Torvalds
     

03 Jul, 2013

2 commits


02 Jul, 2013

2 commits

  • Although parameters are supposed to be part of the kernel API, experimental
    parameters are often removed. In addition, downgrading a kernel might cause
    previously-working modules to fail to load.

    On balance, it's probably better to warn, and load the module anyway.
    This may let through a typo, but at least the logs will show it.

    Reported-by: Andy Lutomirski
    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • If we pass a pointer to a const string in the form "module:symbol"
    module_kallsyms_lookup_name() will try to split the string at the colon,
    i.e., will try to modify r/o data. That will, in fact, fail on a kernel
    with enabled CONFIG_DEBUG_RODATA.

    Avoid modifying the passed string in module_kallsyms_lookup_name(),
    modify find_module_all() instead to pass it the module name length.

    Signed-off-by: Mathias Krause
    Signed-off-by: Rusty Russell

    Mathias Krause
     

17 May, 2013

2 commits


17 Apr, 2013

1 commit

  • Otherwise we get a race between unload and reload of the same module:
    the new module doesn't see the old one in the list, but then fails because
    it can't register over the still-extant entries in sysfs:

    [ 103.981925] ------------[ cut here ]------------
    [ 103.986902] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0xab/0xd0()
    [ 103.993606] Hardware name: CrownBay Platform
    [ 103.998075] sysfs: cannot create duplicate filename '/module/pch_gbe'
    [ 104.004784] Modules linked in: pch_gbe(+) [last unloaded: pch_gbe]
    [ 104.011362] Pid: 3021, comm: modprobe Tainted: G W 3.9.0-rc5+ #5
    [ 104.018662] Call Trace:
    [ 104.021286] [] warn_slowpath_common+0x6d/0xa0
    [ 104.026933] [] ? sysfs_add_one+0xab/0xd0
    [ 104.031986] [] ? sysfs_add_one+0xab/0xd0
    [ 104.037000] [] warn_slowpath_fmt+0x2e/0x30
    [ 104.042188] [] sysfs_add_one+0xab/0xd0
    [ 104.046982] [] create_dir+0x5e/0xa0
    [ 104.051633] [] sysfs_create_dir+0x78/0xd0
    [ 104.056774] [] kobject_add_internal+0x83/0x1f0
    [ 104.062351] [] ? kvasprintf+0x46/0x60
    [ 104.067231] [] kobject_add_varg+0x2d/0x50
    [ 104.072450] [] kobject_init_and_add+0x27/0x30
    [ 104.078075] [] mod_sysfs_setup+0x80/0x540
    [ 104.083207] [] ? module_bug_finalize+0x51/0xc0
    [ 104.088720] [] load_module+0x1429/0x18b0

    We can teardown sysfs first, then to be sure, put the state in
    MODULE_STATE_UNFORMED so it's ignored while we deconstruct it.

    Reported-by: Veaceslav Falico
    Tested-by: Veaceslav Falico
    Signed-off-by: Rusty Russell

    Rusty Russell
     

20 Mar, 2013

1 commit

  • Fix symbol versioning on architectures with symbol prefixes. Although
    the build was free from warnings the actual modules still wouldn't load
    as the ____versions table contained unprefixed symbol names, which were
    being compared against the prefixed symbol names when checking the
    symbol versions.

    This is fixed by modifying modpost to add the symbol prefix to the
    ____versions table it outputs (Modules.symvers still contains unprefixed
    symbol names). The check_modstruct_version() function is also fixed as
    it checks the version of the unprefixed "module_layout" symbol which
    would no longer work.

    Signed-off-by: James Hogan
    Cc: Michal Marek
    Cc: Sam Ravnborg
    Cc: Greg Kroah-Hartman
    Cc: Jonathan Kliegman
    Signed-off-by: Rusty Russell (use VMLINUX_SYMBOL_STR)

    James Hogan
     

15 Mar, 2013

1 commit

  • We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
    "_". But Al Viro broke this in "consolidate cond_syscall and
    SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
    do so.

    Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
    prefix it so something. So various places define helpers which are
    defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:

    1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
    2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
    3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
    4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
    5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
    6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
    7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
    CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
    for pasting.

    (arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).

    Let's solve this properly:
    1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
    2) Make linux/export.h usable from asm.
    3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
    4) Make everyone use them.

    Signed-off-by: Rusty Russell
    Reviewed-by: James Hogan
    Tested-by: James Hogan (metag)

    Rusty Russell
     

27 Feb, 2013

1 commit

  • Pull vfs pile (part one) from Al Viro:
    "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent
    locking violations, etc.

    The most visible changes here are death of FS_REVAL_DOT (replaced with
    "has ->d_weak_revalidate()") and a new helper getting from struct file
    to inode. Some bits of preparation to xattr method interface changes.

    Misc patches by various people sent this cycle *and* ocfs2 fixes from
    several cycles ago that should've been upstream right then.

    PS: the next vfs pile will be xattr stuff."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits)
    saner proc_get_inode() calling conventions
    proc: avoid extra pde_put() in proc_fill_super()
    fs: change return values from -EACCES to -EPERM
    fs/exec.c: make bprm_mm_init() static
    ocfs2/dlm: use GFP_ATOMIC inside a spin_lock
    ocfs2: fix possible use-after-free with AIO
    ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path
    get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero
    target: writev() on single-element vector is pointless
    export kernel_write(), convert open-coded instances
    fs: encode_fh: return FILEID_INVALID if invalid fid_type
    kill f_vfsmnt
    vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op
    nfsd: handle vfs_getattr errors in acl protocol
    switch vfs_getattr() to struct path
    default SET_PERSONALITY() in linux/elf.h
    ceph: prepopulate inodes only when request is aborted
    d_hash_and_lookup(): export, switch open-coded instances
    9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate()
    9p: split dropping the acls from v9fs_set_create_acl()
    ...

    Linus Torvalds
     

26 Feb, 2013

1 commit


21 Jan, 2013

4 commits