01 Jan, 2006

1 commit

  • This is a slightly more complete fix for the previous minimal sysctl
    string fix. It always terminates the returned string with a NUL, even
    if the full result wouldn't fit in the user-supplied buffer.

    The returned length is the full untruncated length, so that you can
    tell when truncation has occurred.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

31 Dec, 2005

2 commits

  • For the sysctl syscall, if the user wants to get the old value of a
    sysctl entry and set a new value for it in the same syscall, the old
    value is always overwritten by the new value if the sysctl entry is of
    string type and if the user sets its strategy to sysctl_string. This
    issue lies in the strategy being run twice if the strategy is set to
    sysctl_string, the general strategy sysctl_string always returns 0 if
    success.

    Such strategy routines as sysctl_jiffies and sysctl_jiffies_ms return 1
    because they do read and write for the sysctl entry.

    The strategy routine sysctl_string return 0 although it actually read
    and write the sysctl entry.

    According to my analysis, if a strategy routine do read and write, it
    should return 1, if it just does some necessary check but not read and
    write, it should return 0, for example sysctl_intvec.

    Signed-off-by: Yi Yang
    Signed-off-by: Linus Torvalds

    Yi Yang
     
  • If the string was too long to fit in the user-supplied buffer,
    the sysctl layer would zero-terminate it by writing past the
    end of the buffer. Don't do that.

    Noticed by Yi Yang

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

25 Dec, 2005

1 commit


21 Dec, 2005

1 commit

  • All the work was done to setup the file and maintain the file handles but
    the access functions were zeroed out due to the #ifdef. Removing the
    #ifdef allows full access to all the parameters when CONFIG_MODULES=n.

    akpm: put it back again, but use CONFIG_SYSFS instead.

    Signed-off-by: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Adrian Bunk
    Signed-off-by: Linus Torvalds

    Jason Wessel
     

13 Dec, 2005

9 commits

  • When multiple probes are registered at the same address and if due to some
    recursion (probe getting triggered within a probe handler), we skip calling
    pre_handlers and just increment nmissed field.

    The below patch make sure it walks the list for multiple probes case.
    Without the below patch we get incorrect results of nmissed count for
    multiple probe case.

    Signed-off-by: Anil S Keshavamurthy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keshavamurthy Anil S
     
  • For Kprobes critical path is the path from debug break exception handler
    till the control reaches kprobes exception code. No probes can be
    supported in this path as we will end up in recursion.

    This patch prevents this by moving the below function to safe __kprobes
    section onto which no probes can be inserted.

    Signed-off-by: Anil S Keshavamurthy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keshavamurthy Anil S
     
  • kauditd was causing suspends to fail because it refused to freeze. Adding
    a try_to_freeze() to its sleep loop solves the issue.

    Signed-off-by: Pierre Ossman
    Acked-by: Pavel Machek
    Cc: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pierre Ossman
     
  • When registering multiple kprobes at the same address, we leave a small
    window where the kprobe hlist will not contain a reference to the
    registered kprobe, leading to potentially, a system crash if the breakpoint
    is hit on another processor.

    Patch below now automically relpace the old kprobe with the new
    kprobe from the hash list.

    Signed-off-by: Anil S Keshavamurthy
    Acked-by: Ananth N Mavinakayanahalli
    Cc: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Keshavamurthy Anil S
     
  • There are several functions that might seem appropriate for a timestamp:

    get_cycles()
    current_kernel_time()
    do_gettimeofday()

    Each has problems with combinations of SMP-safety, low resolution, and
    monotonicity. This patch adds a new function that returns a monotonic SMP-safe
    timestamp with nanosecond resolution where available.

    Changes:
    Split timestamp into separate patch
    Moved to kernel/time.c
    Renamed to getnstimestamp
    Fixed unintended-pointer-arithmetic bug

    Signed-off-by: Matt Helsley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Helsley
     
  • Accessing nohz_cpu_mask before incrementing rcp->cur is racy. It can cause
    tickless idle CPUs to be included in rsp->cpumask, which will extend
    graceperiods unnecessarily.

    Fix this race. It has been tested using extensions to RCU torture module
    that forces various CPUs to become idle.

    Signed-off-by: Srivatsa Vaddagiri
    Cc: Dipankar Sarma
    Cc: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Srivatsa Vaddagiri
     
  • While doing some test of RCU torture module, I hit a OOPS in rcu_do_batch,
    which was trying to processes callback of a module that was just removed.
    This is because we weren't waiting long enough for all callbacks to fire.

    Signed-off-by: Srivatsa Vaddagiri
    Cc: Dipankar Sarma
    Acked-by: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Srivatsa Vaddagiri
     
  • This introduces a new interface - rcu_barrier() which waits until all
    the RCUs queued until this call have been completed.

    Reiser4 needs this, because we do more than just freeing memory object
    in our RCU callback: we also remove it from the list hanging off
    super-block. This means, that before freeing reiser4-specific portion
    of super-block (during umount) we have to wait until all pending RCU
    callbacks are executed.

    The only change of reiser4 made to the original patch, is exporting of
    rcu_barrier().

    Cc: Hans Reiser
    Cc: Vladimir V. Saveliev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dipankar Sarma
     
  • When a Kprobes are inserted/removed on a modules, the modules must be ref
    counted so as not to allow to unload while probes are registered on that
    module.

    Without this patch, the probed module is free to unload, and when the
    probing module unregister the probe, the kpobes code while trying to
    replace the original instruction might crash.

    Signed-off-by: Anil S Keshavamurthy
    Signed-off-by: Mao Bibo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mao, Bibo
     

30 Nov, 2005

2 commits

  • Fix swsusp on machines not supporting S4. With recent changes, it is not
    possible to trigger it using /sys filesystem. Swsusp does not really need
    any support from low-level code, it is possible to reboot or halt at the
    end of suspend.

    Signed-off-by: Pavel Machek
    Cc: "Brown, Len"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Machek
     
  • set_page_dirty() will not cope with being handed a page * which is part of
    a compound page, but not the master page in that compound page. This case
    can occur via access_process_vm() if you attemp to write to another
    process's hugepage memory area using ptrace() (causing an oops or hang).

    This patch fixes the bug by only calling set_page_dirty() from
    access_process_vm() if the page is not a compound page. We already use a
    similar fix in bio_set_pages_dirty() for the case of direct io to
    hugepages.

    Signed-off-by: David Gibson
    Acked-by: William Irwin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Gibson
     

29 Nov, 2005

5 commits

  • Move the cpuset_fork() call below the write_unlock_irq call in
    kernel/fork.c copy_process().

    Since the cpuset-dual-semaphore-locking-overhaul.patch, the cpuset_fork()
    routine acquires task_lock(), so cannot be called while holding the
    tasklist_lock for write.

    Signed-off-by: Paul Jackson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Jackson
     
  • Tracked this down on an Ultra Enterprise 3000. It's a 6-way machine. Odd
    thing about this machine (and it's good for finding bugs like this) is that
    the CPU id's are not 0 based. For instance, on my machine the CPU's are
    6/7/10/11/14/15.

    This caused some NULL pointer dereference in kernel/workqueue.c because for
    single_threaded workqueue's, it hardcoded the cpu to 0.

    I changed the 0's to any_online_cpu(cpu_online_mask), which cpumask.h
    claims is "First cpu in mask". So this fits the same usage.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Collins
     
  • fix 32bit overflow in timespec_to_sample()

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Don't do that - it does GFP_KERNEL allocations, for a start.

    (Reported by Guillaume Thouvenin )

    Acked-by: Matt Helsley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • There are some callers in cpufreq hotplug notify path that the lowest
    function calls lock_cpu_hotplug(). The lock is already held during
    cpu_up() and cpu_down() calls when the notify calls are broadcast to
    registered clients.

    Ideally if possible, we could disable_preempt() at the highest caller and
    make sure we dont sleep in the path down in cpufreq->driver_target() calls
    but the calls are so intertwined and cumbersome to cleanup.

    Hence we consistently use lock_cpu_hotplug() and unlock_cpu_hotplug() in
    all places.

    - Removed export of cpucontrol semaphore and made it static.
    - removed explicit uses of up/down with lock_cpu_hotplug()
    so we can keep track of the the callers in same thread context and
    just keep refcounts without calling a down() that causes a deadlock.
    - Removed current_in_hotplug() uses
    - Removed PF_HOTPLUG_CPU in sched.h introduced for the current_in_hotplug()
    temporary workaround.

    Tested with insmod of cpufreq_stat.ko, and logical online/offline
    to make sure we dont have any hang situations.

    Signed-off-by: Ashok Raj
    Cc: Zwane Mwaikambo
    Cc: Shaohua Li
    Cc: "Siddha, Suresh B"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashok Raj
     

24 Nov, 2005

3 commits

  • If unregister_console() is inadvertently called while no consoles are
    registered, it will crash trying to dereference NULL pointer. It is
    necessary to fix that because register_console() provides no indication
    that it actually registered the console passed in. In fact, it may well
    decide not to register it based on various things...

    (akpm: It'd be better to make register_console() return something and fix the
    callers. All 106 of them...)

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     
  • The follow_page changes in get_futex_key have left it with two almost
    identical blocks, when handling the rare case of a futex in a nonlinear vma.
    get_user_pages will itself do that follow_page, and its additional
    find_extend_vma is hardly any overhead since the vma is already cached. Let's
    just delete the follow_page block and let get_user_pages do it.

    Signed-off-by: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     
  • Most of the functions already check. Do the ones that didn't.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     

23 Nov, 2005

1 commit


18 Nov, 2005

1 commit

  • One issue with the RCU torture test is that the current error flagging can
    be lost in dmesg. This patch adds a "SUCCESS"/"FAILURE" string to the line
    that flags the end of the test, where it can easily be seen with "dmesg |
    tail" at the end of the test. Also adds tests of architecture-specific
    memory barriers -- or, more likely, of the RCU torture test itself.

    Cc:
    Signed-off-by: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul E. McKenney
     

14 Nov, 2005

11 commits

  • Add printk documentation to kernel-api.

    Signed-off-by: Martin Waitz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Waitz
     
  • It would appear that the timespec normalize code has an off by one error.
    Found in three places. Thanks to Ben for spotting.

    Signed-off-by: George Anzinger
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    George Anzinger
     
  • Sync iocbs have a life cycle that don't need a kioctx. Their retrying, if
    any, is done in the context of their owner who has allocated them on the
    stack.

    The sole user of a sync iocb's ctx reference was aio_complete() checking for
    an elevated iocb ref count that could never happen. No path which grabs an
    iocb ref has access to sync iocbs.

    If we were to implement sync iocb cancelation it would be done by the owner of
    the iocb using its on-stack reference.

    Removing this chunk from aio_complete allows us to remove the entire kioctx
    instance from mm_struct, reducing its size by a third. On a i386 testing box
    the slab size went from 768 to 504 bytes and from 5 to 8 per page.

    Signed-off-by: Zach Brown
    Acked-by: Benjamin LaHaise
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zach Brown
     
  • This fixes deadlock of stop_machine() vs. synchronous IPI send. The
    problem is that stop_machine() disables interrupts before disabling
    preemption on other CPUs. So if another CPU is preempted and then calls
    something like flush_tlb_all() it will deadlock with CPU doing
    stop_machine() and which can't process IPI due to disabled IRQs.

    I changed stop_machine() to do the same things exactly as it does on other
    CPUs, i.e. it should disable preemption first on _all_ CPUs including
    itself and only after that disable IRQs.

    Signed-off-by: Kirill Korotaev
    Cc: Rusty Russell
    Cc: "Andrey Savochkin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill Korotaev
     
  • Make the box usable for interactive work when running the RCU torture test,
    by renicing the RCU torture-test threads to +19 by default. Kthreads run
    at nice -5 by default.

    Signed-off-by: Ingo Molnar
    Acked-by: Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     
  • This patch reverts commit c33880aaddbbab1ccf36f4457ed1090621f2e39a since
    it's not needed anymore. As pointed out by Roland McGrath the real fix
    is to deliver all signals before returning to user space.
    See http://www.ussg.iu.edu/hypermail/linux/kernel/0509.2/0683.html
    A fix for s390 has been merged.

    Signed-off-by: Heiko Carstens
    Cc: Roland McGrath
    Cc: Ingo Molnar
    Cc: Linus Torvalds
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • encapsulates the rest of arch-dependent operations with thread_info access.
    Two new helpers - setup_thread_stack() and end_of_stack(). For normal case
    the former consists of copying thread_info of parent to new thread_info and
    the latter returns pointer immediately past the end of thread_info.

    Signed-off-by: Al Viro
    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • new helper - task_thread_info(task). On platforms that have thread_info
    allocated separately (i.e. in default case) it simply returns
    task->thread_info. m68k wants (and for good reasons) to embed its thread_info
    into task_struct. So it will (in later patch) have task_thread_info() of its
    own. For now we just add a macro for generic case and convert existing
    instances of its body in core kernel to uses of new macro. Obviously safe -
    all normal architectures get the same preprocessor output they used to get.

    Signed-off-by: Al Viro
    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Al Viro
     
  • It is wrong to acquire the semaphore and then return from
    cpuset_zone_allowed without releasing it.

    Signed-off-by: Bob Picco
    Acked-by: Paul Jackson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bob Picco
     
  • When ptrace_attach fails we need to drop the task_struct reference.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Since few people need the support anymore, this moves the legacy
    pm_xxx functions to CONFIG_PM_LEGACY, and include/linux/pm_legacy.h.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

11 Nov, 2005

2 commits


10 Nov, 2005

1 commit

  • recalc_task_prio() is called from activate_task() to calculate dynamic
    priority and interactive credit for the activating task. For real-time
    scheduling process, all that dynamic calculation is thrown away at the end
    because rt priority is fixed. Patch to optimize recalc_task_prio() away
    for rt processes.

    Signed-off-by: Ken Chen
    Acked-by: Ingo Molnar
    Cc: Nick Piggin
    Cc: Con Kolivas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen, Kenneth W