01 Nov, 2010

1 commit

  • …rnel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    genirq: Fix up irq_node() for irq_data changes.
    genirq: Add single IRQ reservation helper
    genirq: Warn if enable_irq is called before irq is set up

    * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    semaphore: Remove mutex emulation
    staging: Final semaphore cleanup
    jbd2: Convert jbd2_slab_create_sem to mutex
    hpfs: Convert sbi->hpfs_creation_de to mutex

    Fix up trivial change/delete conflicts with deleted 'dream' drivers
    (drivers/staging/dream/camera/{mt9d112.c,mt9p012_fox.c,mt9t013.c,s5k3e2fx.c})

    Linus Torvalds
     

31 Oct, 2010

1 commit

  • …nel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    jump label: Add work around to i386 gcc asm goto bug
    x86, ftrace: Use safe noops, drop trap test
    jump_label: Fix unaligned traps on sparc.
    jump label: Make arch_jump_label_text_poke_early() optional
    jump label: Fix error with preempt disable holding mutex
    oprofile: Remove deprecated use of flush_scheduled_work()
    oprofile: Fix the hang while taking the cpu offline
    jump label: Fix deadlock b/w jump_label_mutex vs. text_mutex
    jump label: Fix module __init section race

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86: Check irq_remapped instead of remapping_enabled in destroy_irq()

    Linus Torvalds
     

30 Oct, 2010

13 commits

  • Normal syscall audit doesn't catch 5th argument of syscall. It also
    doesn't catch the contents of userland structures pointed to be
    syscall argument, so for both old and new mmap(2) ABI it doesn't
    record the descriptor we are mapping. For old one it also misses
    flags.

    Signed-off-by: Al Viro

    Al Viro
     
  • Protect the task lookups in audit_receive_msg() with rcu_read_lock()
    instead of tasklist_lock and use lock/unlock_sighand to protect
    against the exit race.

    Signed-off-by: Thomas Gleixner
    Cc: Al Viro
    Cc: Eric Paris
    Cc: Oleg Nesterov
    Signed-off-by: Al Viro

    Thomas Gleixner
     
  • audit_receive_msg() sends uninitialized data for AUDIT_TTY_GET when
    the task was not found.

    Send reply only when task was found.

    Signed-off-by: Thomas Gleixner
    Cc: Al Viro
    Cc: Eric Paris
    Signed-off-by: Al Viro

    Thomas Gleixner
     
  • While auditing all tasklist_lock read_lock sites I stumbled over the
    following call chain:

    audit_prepare_user_tty()
    read_lock(&tasklist_lock);
    tty_audit_push_task();
    mutex_lock(&buf->mutex);

    --> buf->mutex is locked with preemption disabled.

    Solve this by acquiring a reference to the task struct under
    rcu_read_lock and call tty_audit_push_task outside of the preempt
    disabled region.

    Move all code which needs to be protected by sighand lock into
    tty_audit_push_task() and use lock/unlock_sighand as we do not hold
    tasklist_lock.

    Signed-off-by: Thomas Gleixner
    Cc: Al Viro
    Cc: Eric Paris
    Cc: Oleg Nesterov
    Signed-off-by: Al Viro

    Thomas Gleixner
     
  • ... while we are not holding spinlocks.

    Signed-off-by: Al Viro

    Al Viro
     
  • I was doing some namespace checks and found some simple stuff in
    audit that could be cleaned up. Make some functions static, and
    put const on make_reply payload arg.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Al Viro

    Stephen Hemminger
     
  • Add support for matching by security label (e.g. SELinux context) of
    the sender of an user-space audit record.

    The audit filter code already allows user space to configure such
    filters, but they were ignored during evaluation. This patch implements
    evaluation of these filters.

    For example, after application of this patch, PAM authentication logs
    caused by cron can be disabled using
    auditctl -a user,never -F subj_type=crond_t

    Signed-off-by: Miloslav Trmac
    Acked-by: Eric Paris
    Signed-off-by: Al Viro

    Miloslav Trmac
     
  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
    kgdb,ppc: Individual register get/set for ppc
    kgdbts: prevent re-entry to kgdbts before it unregisters
    debug_core,x86,blackfin: Clean up hw debug disable API
    kdb: Fix early debugging crash regression
    kgdb,arm: fix register dump
    kdb: fix per_cpu command to remove supress mask
    kdb: Add kdb kernel module sample

    Linus Torvalds
     
  • The kgdb_disable_hw_debug() was an architecture specific function for
    disabling all hardware breakpoints on a per cpu basis when entering
    the debug core.

    This patch will remove the weak function kdbg_disable_hw_debug() and
    change it into a call back which lives with the rest of hw breakpoint
    call backs in struct kgdb_arch.

    Signed-off-by: Dongdong Deng
    Signed-off-by: Jason Wessel

    Dongdong Deng
     
  • The kdb_current legally be equal to NULL in the early boot of the x86
    arch. The problem pcan be observed by booting with the kernel arguments:

    earlyprintk=vga ekgdboc=kbd kgdbwait

    The kdb shell will oops on entry and recursively fault because it
    cannot get past the final stage of shell initialization.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Rusty pointed out that the per_cpu command uses up lots of space on
    the stack and the cpu supress mask is probably not needed.

    This patch removes the need for the supress mask as well as fixing up
    the following problems with the kdb per_cpu command:
    * The per_cpu command should allow an address as an argument
    * When you have more data than can be displayed on one screen allow
    the user to break out of the print loop.

    Reported-by: Rusty Russell
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Some archs do not need to do anything special for jump labels on
    startup (like MIPS). This patch adds a weak function stub for
    arch_jump_label_text_poke_early();

    Cc: Jason Baron
    Cc: David Miller
    Cc: David Daney
    Suggested-by: Thomas Gleixner
    LKML-Reference:
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • Kprobes and jump label were having a race between mutexes that
    was fixed by reordering the jump label. But this reordering
    moved the jump label mutex into a preempt disable location.

    This patch does a little fiddling to move the grabbing of
    the jump label mutex from inside the preempt disable section
    and still keep the order correct between the mutex and the
    kprobes lock.

    Reported-by: Ingo Molnar
    Acked-by: Masami Hiramatsu
    Cc: Jason Baron
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

29 Oct, 2010

4 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (29 commits)
    braino in internal.h
    convert simple cases of nfs-related ->get_sb() to ->mount()
    convert btrfs
    convert ceph
    convert gfs2
    convert afs
    convert ecryptfs
    convert sysfs
    convert cgroup and cpuset
    switch get_sb_ns() users
    switch procfs to ->mount()
    setting ->proc_mnt doesn't belong in proc_get_sb()
    convert cifs
    convert nilfs
    switch logfs to ->mount()
    logfs: fix a leak in get_sb
    logfs get_sb, part 3
    logfs get_sb, part 2
    logfs get_sb massage, part 1
    convert v9fs
    ...

    Linus Torvalds
     
  • …l/git/tip/linux-2.6-tip

    * 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    sched_stat: Update sched_info_queue/dequeue() code comments
    sched, cgroup: Fixup broken cgroup movement

    Linus Torvalds
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (27 commits)
    x86: allocate space within a region top-down
    x86: update iomem_resource end based on CPU physical address capabilities
    x86/PCI: allocate space from the end of a region, not the beginning
    PCI: allocate bus resources from the top down
    resources: support allocating space within a region from the top down
    resources: handle overflow when aligning start of available area
    resources: ensure callback doesn't allocate outside available space
    resources: factor out resource_clip() to simplify find_resource()
    resources: add a default alignf to simplify find_resource()
    x86/PCI: MMCONFIG: fix region end calculation
    PCI: Add support for polling PME state on suspended legacy PCI devices
    PCI: Export some PCI PM functionality
    PCI: fix message typo
    PCI: log vendor/device ID always
    PCI: update Intel chipset names and defines
    PCI: use new ccflags variable in Makefile
    PCI: add PCI_MSIX_TABLE/PBA defines
    PCI: add PCI vendor id for STmicroelectronics
    x86/PCI: irq and pci_ids patch for Intel Patsburg DeviceIDs
    PCI: OLPC: Only enable PCI configuration type override on XO-1
    ...

    Linus Torvalds
     

28 Oct, 2010

21 commits

  • register_kprobe() downs the 'text_mutex' and then calls
    jump_label_text_reserved(), which downs the 'jump_label_mutex'.
    However, the jump label code takes those mutexes in the reverse
    order.

    Fix by requiring the caller of jump_label_text_reserved() to do
    the jump label locking via the newly added: jump_label_lock(),
    jump_label_unlock(). Currently, kprobes is the only user
    of jump_label_text_reserved().

    Reported-by: Ingo Molnar
    Acked-by: Masami Hiramatsu
    Signed-off-by: Jason Baron
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Jason Baron
     
  • Jump label uses is_module_text_address() to ensure that the module
    __init sections are valid before updating them. However, between the
    check for a valid module __init section and the subsequent jump
    label update, the module's __init section could be freed out from under
    us.

    We fix this potential race by adding a notifier callback to the
    MODULE_STATE_LIVE state. This notifier is called *after* the __init
    section has been run but before it is going to be freed. In the
    callback, the jump label code zeros the key value for any __init jump
    code within the module, and we add a check for a non-zero key value when
    we update jump labels. In this way we require no additional data
    structures.

    Thanks to Mathieu Desnoyers for pointing out this race condition.

    Reported-by: Mathieu Desnoyers
    Cc: Masami Hiramatsu
    Signed-off-by: Jason Baron
    LKML-Reference:

    [ Renamed remove_module_init() to remove_jump_label_module_init()
    as suggested by Masami Hiramatsu. ]

    Signed-off-by: Steven Rostedt

    Jason Baron
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-mn10300: (44 commits)
    MN10300: Save frame pointer in thread_info struct rather than global var
    MN10300: Change "Matsushita" to "Panasonic".
    MN10300: Create a defconfig for the ASB2364 board
    MN10300: Update the ASB2303 defconfig
    MN10300: ASB2364: Add support for SMSC911X and SMC911X
    MN10300: ASB2364: Handle the IRQ multiplexer in the FPGA
    MN10300: Generic time support
    MN10300: Specify an ELF HWCAP flag for MN10300 Atomic Operations Unit support
    MN10300: Map userspace atomic op regs as a vmalloc page
    MN10300: And Panasonic AM34 subarch and implement SMP
    MN10300: Delete idle_timestamp from irq_cpustat_t
    MN10300: Make various interrupt priority settings configurable
    MN10300: Optimise do_csum()
    MN10300: Implement atomic ops using atomic ops unit
    MN10300: Make the FPU operate in non-lazy mode under SMP
    MN10300: SMP TLB flushing
    MN10300: Use the [ID]PTEL2 registers rather than [ID]PTEL for TLB control
    MN10300: Make the use of PIDR to mark TLB entries controllable
    MN10300: Rename __flush_tlb*() to local_flush_tlb*()
    MN10300: AM34 erratum requires MMUCTR read and write on exception entry
    ...

    Linus Torvalds
     
  • …/git/tip/linux-2.6-tip

    * 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (50 commits)
    perf python scripting: Add futex-contention script
    perf python scripting: Fixup cut'n'paste error in sctop script
    perf scripting: Shut up 'perf record' final status
    perf record: Remove newline character from perror() argument
    perf python scripting: Support fedora 11 (audit 1.7.17)
    perf python scripting: Improve the syscalls-by-pid script
    perf python scripting: print the syscall name on sctop
    perf python scripting: Improve the syscalls-counts script
    perf python scripting: Improve the failed-syscalls-by-pid script
    kprobes: Remove redundant text_mutex lock in optimize
    x86/oprofile: Fix uninitialized variable use in debug printk
    tracing: Fix 'faild' -> 'failed' typo
    perf probe: Fix format specified for Dwarf_Off parameter
    perf trace: Fix detection of script extension
    perf trace: Use $PERF_EXEC_PATH in canned report scripts
    perf tools: Document event modifiers
    perf tools: Remove direct slang.h include
    perf_events: Fix for transaction recovery in group_sched_in()
    perf_events: Revert: Fix transaction recovery in group_sched_in()
    perf, x86: Use NUMA aware allocations for PEBS/BTS/DS allocations
    ...

    Linus Torvalds
     
  • * 'module' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
    NULL-terminate all pci_device_id tables
    (trivial) Fix compiler warning in kernel/modules.c

    Linus Torvalds
     
  • Signed-off-by: Zimny Lech
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zimny Lech
     
  • If the same resource is inserted to the resource tree (maybe not on
    purpose), a dead loop will be created. In this situation, The kernel does
    not report any warning or error :(

    The command below will show a endless print.
    #cat /proc/iomem

    [akpm@linux-foundation.org: add WARN_ON()]
    Signed-off-by: Huang Shijie
    Cc: Jesse Barnes
    Cc: Bjorn Helgaas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Shijie
     
  • The taskstats interface uses microsecond granularity for the user and
    system time values. The conversion from cputime to the taskstats values
    uses the cputime_to_msecs primitive which effectively limits the
    granularity to milliseconds. Add the cputime_to_usecs primitive for
    architectures that have better, more precise CPU time values. Remove
    cputime_to_msecs primitive because there are no more users left.

    Signed-off-by: Michael Holzheu
    Acked-by: Balbir Singh
    Cc: Luck Tony
    Cc: Shailabh Nagar
    Cc: Martin Schwidefsky
    Cc: Oleg Nesterov
    Cc: Benjamin Herrenschmidt
    Cc: Heiko Carstens
    Cc: Thomas Gleixner
    Cc: Shailabh Nagar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Holzheu
     
  • Separate the finding of a task_struct by pid or tgid from filling the
    taskstats data. This makes the code more readable.

    Signed-off-by: Michael Holzheu
    Acked-by: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Holzheu
     
  • Move each taskstats command into a single function. This makes the code
    more readable and makes it easier to add new commands.

    Signed-off-by: Michael Holzheu
    Acked-by: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Holzheu
     
  • prepare_reply() sets up an skb for the response. The payload contains:

    +--------------------------------+
    | genlmsghdr - 4 bytes |
    +--------------------------------+
    | NLA header - 4 bytes | /* Aggregate header */
    +-+------------------------------+
    | | NLA header - 4 bytes | /* PID header */
    | +------------------------------+
    | | pid/tgid - 4 bytes |
    | +------------------------------+
    | | NLA header - 4 bytes | /* stats header */
    | + -----------------------------+
    Cc: Balbir Singh
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • In /proc/stat, the number of per-IRQ event is shown by making a sum each
    irq's events on all cpus. But we can make use of kstat_irqs().

    kstat_irqs() do the same calculation, If !CONFIG_GENERIC_HARDIRQ,
    it's not a big cost. (Both of the number of cpus and irqs are small.)

    If a system is very big and CONFIG_GENERIC_HARDIRQ, it does

    for_each_irq()
    for_each_cpu()
    - look up a radix tree
    - read desc->irq_stat[cpu]
    This seems not efficient. This patch adds kstat_irqs() for
    CONFIG_GENRIC_HARDIRQ and change the calculation as

    for_each_irq()
    look up radix tree
    for_each_cpu()
    - read desc->irq_stat[cpu]

    This reduces cost.

    A test on (4096cpusp, 256 nodes, 4592 irqs) host (by Jack Steiner)

    %time cat /proc/stat > /dev/null

    Before Patch: 2.459 sec
    After Patch : .561 sec

    [akpm@linux-foundation.org: unexport kstat_irqs, coding-style tweaks]
    [akpm@linux-foundation.org: fix unused variable 'per_irq_sum']
    Signed-off-by: KAMEZAWA Hiroyuki
    Tested-by: Jack Steiner
    Acked-by: Jack Steiner
    Cc: Yinghai Lu
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KAMEZAWA Hiroyuki
     
  • find_new_reaper() releases and regrabs tasklist_lock but was missing
    proper annotations. Add it. This remove following sparse warning:

    warning: context imbalance in 'find_new_reaper' - unexpected unlock

    Signed-off-by: Namhyung Kim
    Acked-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • Oleg Nesterov pointed out we have to prevent multiple-threads-inside-exec
    itself and we can reuse ->cred_guard_mutex for it. Yes, concurrent
    execve() has no worth.

    Let's move ->cred_guard_mutex from task_struct to signal_struct. It
    naturally prevent multiple-threads-inside-exec.

    Signed-off-by: KOSAKI Motohiro
    Reviewed-by: Oleg Nesterov
    Acked-by: Roland McGrath
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    KOSAKI Motohiro
     
  • ptrace_stop() releases and regrabs current->sighand->siglock but was
    missing proper annotation. Add it.

    Signed-off-by: Namhyung Kim
    Acked-by: Roland McGrath
    Cc: Ingo Molnar
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • lock_task_sighand() grabs sighand->siglock in case of returning non-NULL
    but unlock_task_sighand() releases it unconditionally. This leads sparse
    to complain about the lock context imbalance. Rename and wrap
    lock_task_sighand() using __cond_lock() macro to make sparse happy.

    Suggested-by: Eric Dumazet
    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Cc: Oleg Nesterov
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • Use new 'datavp' and 'datalp' variables to remove unnecesary castings.

    Signed-off-by: Namhyung Kim
    Acked-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • Since userspace API of ptrace syscall defines @addr and @data as void
    pointers, it would be more appropriate to define them as unsigned long in
    kernel. Therefore related functions are changed also.

    'unsigned long' is typically used in other places in kernel as an opaque
    data type and that using this helps cleaning up a lot of warnings from
    sparse.

    Suggested-by: Arnd Bergmann
    Signed-off-by: Namhyung Kim
    Acked-by: Arnd Bergmann
    Acked-by: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • exit_ptrace() releases and regrabs tasklist_lock but was missing proper
    annotation. Add it.

    Signed-off-by: Namhyung Kim
    Acked-by: Roland McGrath
    Cc: Ingo Molnar
    Cc: Oleg Nesterov
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • The ns_cgroup will be removed very soon. Let's warn, for this version,
    ns_cgroup is deprecated.

    Make ns_cgroup and clone_children exclusive. If the clone_children is set
    and the ns_cgroup is mounted, let's fail with EINVAL when the ns_cgroup
    subsys is created (a printk will help the user to understand why the
    creation fails).

    Update the feature remove schedule file with the deprecated ns_cgroup.

    Signed-off-by: Daniel Lezcano
    Acked-by: Paul Menage
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Lezcano
     
  • Function "strcpy" is used without check for maximum allowed source string
    length and could cause destination string overflow. Check for string
    length is added before using "strcpy". Function now is return error if
    source string length is more than a maximum.

    akpm: presently considered NotABug, but add the check for general
    future-safeness and robustness.

    Signed-off-by: Evgeny Kuznetsov
    Acked-by: Paul Menage
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeny Kuznetsov