20 Dec, 2013

2 commits

  • This changes the stack protector config option into a choice of
    "None", "Regular", and "Strong":

    CONFIG_CC_STACKPROTECTOR_NONE
    CONFIG_CC_STACKPROTECTOR_REGULAR
    CONFIG_CC_STACKPROTECTOR_STRONG

    "Regular" means the old CONFIG_CC_STACKPROTECTOR=y option.

    "Strong" is a new mode introduced by this patch. With "Strong" the
    kernel is built with -fstack-protector-strong (available in
    gcc 4.9 and later). This option increases the coverage of the stack
    protector without the heavy performance hit of -fstack-protector-all.

    For reference, the stack protector options available in gcc are:

    -fstack-protector-all:
    Adds the stack-canary saving prefix and stack-canary checking
    suffix to _all_ function entry and exit. Results in substantial
    use of stack space for saving the canary for deep stack users
    (e.g. historically xfs), and measurable (though shockingly still
    low) performance hit due to all the saving/checking. Really not
    suitable for sane systems, and was entirely removed as an option
    from the kernel many years ago.

    -fstack-protector:
    Adds the canary save/check to functions that define an 8
    (--param=ssp-buffer-size=N, N=8 by default) or more byte local
    char array. Traditionally, stack overflows happened with
    string-based manipulations, so this was a way to find those
    functions. Very few total functions actually get the canary; no
    measurable performance or size overhead.

    -fstack-protector-strong
    Adds the canary for a wider set of functions, since it's not
    just those with strings that have ultimately been vulnerable to
    stack-busting. With this superset, more functions end up with a
    canary, but it still remains small compared to all functions
    with only a small change in performance. Based on the original
    design document, a function gets the canary when it contains any
    of:

    - local variable's address used as part of the right hand side
    of an assignment or function argument
    - local variable is an array (or union containing an array),
    regardless of array type or length
    - uses register local variables

    https://docs.google.com/a/google.com/document/d/1xXBH6rRZue4f296vGt9YQcuLVQHeE516stHwt8M9xyU

    Find below a comparison of "size" and "objdump" output when built with
    gcc-4.9 in three configurations:

    - defconfig
    11430641 kernel text size
    36110 function bodies

    - defconfig + CONFIG_CC_STACKPROTECTOR_REGULAR
    11468490 kernel text size (+0.33%)
    1015 of 36110 functions are stack-protected (2.81%)

    - defconfig + CONFIG_CC_STACKPROTECTOR_STRONG via this patch
    11692790 kernel text size (+2.24%)
    7401 of 36110 functions are stack-protected (20.5%)

    With -strong, ARM's compressed boot code now triggers stack
    protection, so a static guard was added. Since this is only used
    during decompression and was never used before, the exposure
    here is very small. Once it switches to the full kernel, the
    stack guard is back to normal.

    Chrome OS has been using -fstack-protector-strong for its kernel
    builds for the last 8 months with no problems.

    Signed-off-by: Kees Cook
    Cc: Arjan van de Ven
    Cc: Michal Marek
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Paul Mundt
    Cc: James Hogan
    Cc: Stephen Rothwell
    Cc: Shawn Guo
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: Peter Zijlstra
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-arch@vger.kernel.org
    Link: http://lkml.kernel.org/r/1387481759-14535-3-git-send-email-keescook@chromium.org
    [ Improved the changelog and descriptions some more. ]
    Signed-off-by: Ingo Molnar

    Kees Cook
     
  • Instead of duplicating the CC_STACKPROTECTOR Kconfig and
    Makefile logic in each architecture, switch to using
    HAVE_CC_STACKPROTECTOR and keep everything in one place. This
    retains the x86-specific bug verification scripts.

    Signed-off-by: Kees Cook
    Cc: Arjan van de Ven
    Cc: Michal Marek
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Paul Mundt
    Cc: James Hogan
    Cc: Stephen Rothwell
    Cc: Shawn Guo
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-arch@vger.kernel.org
    Link: http://lkml.kernel.org/r/1387481759-14535-2-git-send-email-keescook@chromium.org
    Signed-off-by: Ingo Molnar

    Kees Cook
     

15 Nov, 2013

1 commit


12 Nov, 2013

1 commit

  • Pull timer changes from Ingo Molnar:
    "Main changes in this cycle were:

    - Updated full dynticks support.

    - Event stream support for architected (ARM) timers.

    - ARM clocksource driver updates.

    - Move arm64 to using the generic sched_clock framework & resulting
    cleanup in the generic sched_clock code.

    - Misc fixes and cleanups"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (50 commits)
    x86/time: Honor ACPI FADT flag indicating absence of a CMOS RTC
    clocksource: sun4i: remove IRQF_DISABLED
    clocksource: sun4i: Report the minimum tick that we can program
    clocksource: sun4i: Select CLKSRC_MMIO
    clocksource: Provide timekeeping for efm32 SoCs
    clocksource: em_sti: convert to clk_prepare/unprepare
    time: Fix signedness bug in sysfs_get_uname() and its callers
    timekeeping: Fix some trivial typos in comments
    alarmtimer: return EINVAL instead of ENOTSUPP if rtcdev doesn't exist
    clocksource: arch_timer: Do not register arch_sys_counter twice
    timer stats: Add a 'Collection: active/inactive' line to timer usage statistics
    sched_clock: Remove sched_clock_func() hook
    arch_timer: Move to generic sched_clock framework
    clocksource: tcb_clksrc: Remove IRQF_DISABLED
    clocksource: tcb_clksrc: Improve driver robustness
    clocksource: tcb_clksrc: Replace clk_enable/disable with clk_prepare_enable/disable_unprepare
    clocksource: arm_arch_timer: Use clocksource for suspend timekeeping
    clocksource: dw_apb_timer_of: Mark a few more functions as __init
    clocksource: Put nodes passed to CLOCKSOURCE_OF_DECLARE callbacks centrally
    arm: zynq: Enable arm_global_timer
    ...

    Linus Torvalds
     

01 Oct, 2013

1 commit

  • If irq_exit() is called on the arch's specified irq stack,
    it should be safe to run softirqs inline under that same
    irq stack as it is near empty by the time we call irq_exit().

    For example if we use the same stack for both hard and soft irqs here,
    the worst case scenario is:
    hardirq -> softirq -> hardirq. But then the softirq supersedes the
    first hardirq as the stack user since irq_exit() is called in
    a mostly empty stack. So the stack merge in this case looks acceptable.

    Stack overrun still have a chance to happen if hardirqs have more
    opportunities to nest, but then it's another problem to solve.

    So lets adapt the irq exit's softirq stack on top of a new Kconfig symbol
    that can be defined when irq_exit() runs on the irq stack. That way
    we can spare some stack switch on irq processing and all the cache
    issues that come along.

    Acked-by: Linus Torvalds
    Signed-off-by: Frederic Weisbecker
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Paul Mackerras
    Cc: James Hogan
    Cc: James E.J. Bottomley
    Cc: Helge Deller
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: David S. Miller
    Cc: Andrew Morton

    Frederic Weisbecker
     

30 Sep, 2013

1 commit

  • With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit. In order
    to use that feature, arch code should be audited to ensure there are no
    races in concurrent read/write of cputime_t. For example,
    reading/writing 64-bit cputime_t on some 32-bit arches may require
    multiple accesses for low and high value parts, so proper locking
    is needed to protect against concurrent accesses.

    Therefore, add CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN which arches can
    enable after they've been audited for potential races.

    This option is automatically enabled on 64-bit platforms.

    Feature requested by Frederic Weisbecker.

    Signed-off-by: Kevin Hilman
    Cc: Ingo Molnar
    Cc: Russell King
    Cc: Paul E. McKenney
    Cc: Arm Linux
    Signed-off-by: Frederic Weisbecker

    Kevin Hilman
     

28 Sep, 2013

1 commit

  • Linus suggested to replace

    #ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX
    #define arch_mutex_cpu_relax() cpu_relax()
    #endif

    with just a simple

    #ifndef arch_mutex_cpu_relax
    # define arch_mutex_cpu_relax() cpu_relax()
    #endif

    to get rid of CONFIG_HAVE_CPU_RELAX_SIMPLE. So architectures can
    simply define arch_mutex_cpu_relax if they want an architecture
    specific function instead of having to add a select statement in
    their Kconfig in addition.

    Suggested-by: Linus Torvalds
    Signed-off-by: Heiko Carstens

    Heiko Carstens
     

14 Aug, 2013

1 commit

  • Fix inadvertent breakage in the clone syscall ABI for Microblaze that
    was introduced in commit f3268edbe6fe ("microblaze: switch to generic
    fork/vfork/clone").

    The Microblaze syscall ABI for clone takes the parent tid address in the
    4th argument; the third argument slot is used for the stack size. The
    incorrectly-used CLONE_BACKWARDS type assigned parent tid to the 3rd
    slot.

    This commit restores the original ABI so that existing userspace libc
    code will work correctly.

    All kernel versions from v3.8-rc1 were affected.

    Signed-off-by: Michal Simek
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Simek
     

04 Jul, 2013

1 commit

  • The soft-dirty is a bit on a PTE which helps to track which pages a task
    writes to. In order to do this tracking one should

    1. Clear soft-dirty bits from PTEs ("echo 4 > /proc/PID/clear_refs)
    2. Wait some time.
    3. Read soft-dirty bits (55'th in /proc/PID/pagemap2 entries)

    To do this tracking, the writable bit is cleared from PTEs when the
    soft-dirty bit is. Thus, after this, when the task tries to modify a
    page at some virtual address the #PF occurs and the kernel sets the
    soft-dirty bit on the respective PTE.

    Note, that although all the task's address space is marked as r/o after
    the soft-dirty bits clear, the #PF-s that occur after that are processed
    fast. This is so, since the pages are still mapped to physical memory,
    and thus all the kernel does is finds this fact out and puts back
    writable, dirty and soft-dirty bits on the PTE.

    Another thing to note, is that when mremap moves PTEs they are marked
    with soft-dirty as well, since from the user perspective mremap modifies
    the virtual memory at mremap's new address.

    Signed-off-by: Pavel Emelyanov
    Cc: Matt Mackall
    Cc: Xiao Guangrong
    Cc: Glauber Costa
    Cc: Marcelo Tosatti
    Cc: KOSAKI Motohiro
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Emelyanov
     

16 May, 2013

1 commit


06 May, 2013

1 commit

  • Pull mudule updates from Rusty Russell:
    "We get rid of the general module prefix confusion with a binary config
    option, fix a remove/insert race which Never Happens, and (my
    favorite) handle the case when we have too many modules for a single
    commandline. Seriously, the kernel is full, please go away!"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    modpost: fix unwanted VMLINUX_SYMBOL_STR expansion
    X.509: Support parse long form of length octets in Authority Key Identifier
    module: don't unlink the module until we've removed all exposure.
    kernel: kallsyms: memory override issue, need check destination buffer length
    MODSIGN: do not send garbage to stderr when enabling modules signature
    modpost: handle huge numbers of modules.
    modpost: add -T option to read module names from file/stdin.
    modpost: minor cleanup.
    genksyms: pass symbol-prefix instead of arch
    module: fix symbol versioning with symbol prefixes
    CONFIG_SYMBOL_PREFIX: cleanup.

    Linus Torvalds
     

05 May, 2013

1 commit

  • commit d1669912 (idle: Implement generic idle function) added a new
    generic idle along with support for hlt/nohlt command line options to
    override default idle loop behavior. However, the command-line
    processing is never compiled.

    The command-line handling is wrapped by CONFIG_GENERIC_IDLE_POLL_SETUP
    and arches that use this feature select it in their Kconfigs.
    However, no Kconfig definition was created for this option, so it is
    never enabled, and therefore command-line override of the idle-loop
    behavior is broken after migrating to the generic idle loop.

    To fix, add a Kconfig definition for GENERIC_IDLE_POLL_SETUP.

    Tested on ARM (OMAP4/Panda) which enables the command-line overrides
    by default.

    Signed-off-by: Kevin Hilman
    Reviewed-by: Srivatsa S. Bhat
    Cc: Linus Torvalds
    Cc: Rusty Russell
    Cc: Paul McKenney
    Cc: Peter Zijlstra
    Cc: Magnus Damm
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linaro-kernel@lists.linaro.org
    Link: http://lkml.kernel.org/r/1366849153-25564-1-git-send-email-khilman@linaro.org
    Signed-off-by: Thomas Gleixner

    Kevin Hilman
     

01 May, 2013

1 commit

  • Pull compat cleanup from Al Viro:
    "Mostly about syscall wrappers this time; there will be another pile
    with patches in the same general area from various people, but I'd
    rather push those after both that and vfs.git pile are in."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
    syscalls.h: slightly reduce the jungles of macros
    get rid of union semop in sys_semctl(2) arguments
    make do_mremap() static
    sparc: no need to sign-extend in sync_file_range() wrapper
    ppc compat wrappers for add_key(2) and request_key(2) are pointless
    x86: trim sys_ia32.h
    x86: sys32_kill and sys32_mprotect are pointless
    get rid of compat_sys_semctl() and friends in case of ARCH_WANT_OLD_COMPAT_IPC
    merge compat sys_ipc instances
    consolidate compat lookup_dcookie()
    convert vmsplice to COMPAT_SYSCALL_DEFINE
    switch getrusage() to COMPAT_SYSCALL_DEFINE
    switch epoll_pwait to COMPAT_SYSCALL_DEFINE
    convert sendfile{,64} to COMPAT_SYSCALL_DEFINE
    switch signalfd{,4}() to COMPAT_SYSCALL_DEFINE
    make SYSCALL_DEFINE-generated wrappers do asmlinkage_protect
    make HAVE_SYSCALL_WRAPPERS unconditional
    consolidate cond_syscall and SYSCALL_ALIAS declarations
    teach SYSCALL_DEFINE how to deal with long long/unsigned long long
    get rid of duplicate logics in __SC_....[1-6] definitions

    Linus Torvalds
     

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
     

13 Mar, 2013

1 commit

  • In commit 887cbce0adea ("arch Kconfig: centralise ARCH_NO_VIRT_TO_BUS")
    I introduced the config sybmol HAVE_VIRT_TO_BUS and selected that where
    needed. I am not sure what I was thinking. Instead, just directly
    select VIRT_TO_BUS where it is needed.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     

04 Mar, 2013

2 commits

  • Signed-off-by: Al Viro

    Al Viro
     
  • Pull new ImgTec Meta architecture from James Hogan:
    "This adds core architecture support for Imagination's Meta processor
    cores, followed by some later miscellaneous arch/metag cleanups and
    fixes which I kept separate to ease review:

    - Support for basic Meta 1 (ATP) and Meta 2 (HTP) core architecture
    - A few fixes all over, particularly for symbol prefixes
    - A few privilege protection fixes
    - Several cleanups (setup.c includes, split out a lot of
    metag_ksyms.c)
    - Fix some missing exports
    - Convert hugetlb to use vm_unmapped_area()
    - Copy device tree to non-init memory
    - Provide dma_get_sgtable()"

    * tag 'metag-v3.9-rc1-v4' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag: (61 commits)
    metag: Provide dma_get_sgtable()
    metag: prom.h: remove declaration of metag_dt_memblock_reserve()
    metag: copy devicetree to non-init memory
    metag: cleanup metag_ksyms.c includes
    metag: move mm/init.c exports out of metag_ksyms.c
    metag: move usercopy.c exports out of metag_ksyms.c
    metag: move setup.c exports out of metag_ksyms.c
    metag: move kick.c exports out of metag_ksyms.c
    metag: move traps.c exports out of metag_ksyms.c
    metag: move irq enable out of irqflags.h on SMP
    genksyms: fix metag symbol prefix on crc symbols
    metag: hugetlb: convert to vm_unmapped_area()
    metag: export clear_page and copy_page
    metag: export metag_code_cache_flush_all
    metag: protect more non-MMU memory regions
    metag: make TXPRIVEXT bits explicit
    metag: kernel/setup.c: sort includes
    perf: Enable building perf tools for Meta
    metag: add boot time LNKGET/LNKSET check
    metag: add __init to metag_cache_probe()
    ...

    Linus Torvalds
     

03 Mar, 2013

1 commit

  • On 64 bit architectures with no efficient unaligned access, padding and
    explicit alignment must be added in various places to prevent unaligned
    64bit accesses (such as taskstats and trace ring buffer).

    However this also needs to apply to 32 bit architectures with 64 bit
    accesses requiring alignment such as metag.

    This is solved by adding a new Kconfig symbol HAVE_64BIT_ALIGNED_ACCESS
    which defaults to 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS, and can be
    explicitly selected by METAG and any other relevant architectures. This
    can be used in various places to determine whether 64bit alignment is
    required.

    Signed-off-by: James Hogan
    Cc: Al Viro
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: Eric Paris
    Cc: Will Drewry

    James Hogan
     

28 Feb, 2013

1 commit

  • Change it to CONFIG_HAVE_VIRT_TO_BUS and set it in all architecures
    that already provide virt_to_bus().

    Signed-off-by: Stephen Rothwell
    Reviewed-by: James Hogan
    Cc: Bjorn Helgaas
    Cc: H Hartley Sweeten
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: "David S. Miller"
    Cc: Paul Mundt
    Cc: Vineet Gupta
    Cc: James Bottomley
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     

24 Feb, 2013

1 commit

  • Pull signal handling cleanups from Al Viro:
    "This is the first pile; another one will come a bit later and will
    contain SYSCALL_DEFINE-related patches.

    - a bunch of signal-related syscalls (both native and compat)
    unified.

    - a bunch of compat syscalls switched to COMPAT_SYSCALL_DEFINE
    (fixing several potential problems with missing argument
    validation, while we are at it)

    - a lot of now-pointless wrappers killed

    - a couple of architectures (cris and hexagon) forgot to save
    altstack settings into sigframe, even though they used the
    (uninitialized) values in sigreturn; fixed.

    - microblaze fixes for delivery of multiple signals arriving at once

    - saner set of helpers for signal delivery introduced, several
    architectures switched to using those."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (143 commits)
    x86: convert to ksignal
    sparc: convert to ksignal
    arm: switch to struct ksignal * passing
    alpha: pass k_sigaction and siginfo_t using ksignal pointer
    burying unused conditionals
    make do_sigaltstack() static
    arm64: switch to generic old sigaction() (compat-only)
    arm64: switch to generic compat rt_sigaction()
    arm64: switch compat to generic old sigsuspend
    arm64: switch to generic compat rt_sigqueueinfo()
    arm64: switch to generic compat rt_sigpending()
    arm64: switch to generic compat rt_sigprocmask()
    arm64: switch to generic sigaltstack
    sparc: switch to generic old sigsuspend
    sparc: COMPAT_SYSCALL_DEFINE does all sign-extension as well as SYSCALL_DEFINE
    sparc: kill sign-extending wrappers for native syscalls
    kill sparc32_open()
    sparc: switch to use of generic old sigaction
    sparc: switch sys_compat_rt_sigaction() to COMPAT_SYSCALL_DEFINE
    mips: switch to generic sys_fork() and sys_clone()
    ...

    Linus Torvalds
     

14 Feb, 2013

1 commit

  • __ARCH_WANT_SYS_RT_SIGACTION,
    __ARCH_WANT_SYS_RT_SIGSUSPEND,
    __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND,
    __ARCH_WANT_COMPAT_SYS_SCHED_RR_GET_INTERVAL - not used anymore
    CONFIG_GENERIC_{SIGALTSTACK,COMPAT_RT_SIG{ACTION,QUEUEINFO,PENDING,PROCMASK}} -
    can be assumed always set.

    Al Viro
     

04 Feb, 2013

7 commits


22 Jan, 2013

1 commit

  • Split ftrace-based kprobes code from kprobes, and introduce
    CONFIG_(HAVE_)KPROBES_ON_FTRACE Kconfig flags.
    For the cleanup reason, this also moves kprobe_ftrace check
    into skip_singlestep.

    Link: http://lkml.kernel.org/r/20120928081520.3560.25624.stgit@ltc138.sdl.hitachi.co.jp

    Cc: Ingo Molnar
    Cc: Ananth N Mavinakayanahalli
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Frederic Weisbecker
    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Steven Rostedt

    Masami Hiramatsu
     

21 Dec, 2012

1 commit

  • Pull signal handling cleanups from Al Viro:
    "sigaltstack infrastructure + conversion for x86, alpha and um,
    COMPAT_SYSCALL_DEFINE infrastructure.

    Note that there are several conflicts between "unify
    SS_ONSTACK/SS_DISABLE definitions" and UAPI patches in mainline;
    resolution is trivial - just remove definitions of SS_ONSTACK and
    SS_DISABLED from arch/*/uapi/asm/signal.h; they are all identical and
    include/uapi/linux/signal.h contains the unified variant."

    Fixed up conflicts as per Al.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
    alpha: switch to generic sigaltstack
    new helpers: __save_altstack/__compat_save_altstack, switch x86 and um to those
    generic compat_sys_sigaltstack()
    introduce generic sys_sigaltstack(), switch x86 and um to it
    new helper: compat_user_stack_pointer()
    new helper: restore_altstack()
    unify SS_ONSTACK/SS_DISABLE definitions
    new helper: current_user_stack_pointer()
    missing user_stack_pointer() instances
    Bury the conditionals from kernel_thread/kernel_execve series
    COMPAT_SYSCALL_DEFINE: infrastructure

    Linus Torvalds
     

20 Dec, 2012

2 commits


19 Dec, 2012

1 commit

  • Pull preparatory gcc intrisics bswap patch from David Woodhouse:
    "This single patch is effectively a no-op for now. It enables
    architectures to opt in to using GCC's __builtin_bswapXX() intrinsics
    for byteswapping, and if we merge this now then the architecture
    maintainers can enable it for their arch during the next cycle without
    dependency issues.

    It's worth making it a par-arch opt-in, because although in *theory*
    the compiler should never do worse than hand-coded assembler (and of
    course it also ought to do a lot better on platforms like Atom and
    PowerPC which have load-and-swap or store-and-swap instructions), that
    isn't always the case. See

    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46453

    for example."

    * tag 'byteswap-for-linus-20121219' of git://git.infradead.org/users/dwmw2/byteswap:
    byteorder: allow arch to opt to use GCC intrinsics for byteswapping

    Linus Torvalds
     

18 Dec, 2012

1 commit

  • Currently only block_dev and uprobes use percpu_rw_semaphore,
    add the config option selected by BLOCK || UPROBES.

    Signed-off-by: Oleg Nesterov
    Cc: Anton Arapov
    Cc: Ingo Molnar
    Cc: Linus Torvalds
    Cc: Michal Marek
    Cc: Mikulas Patocka
    Cc: "Paul E. McKenney"
    Cc: Peter Zijlstra
    Cc: Srikar Dronamraju
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

13 Dec, 2012

1 commit

  • Pull big execve/kernel_thread/fork unification series from Al Viro:
    "All architectures are converted to new model. Quite a bit of that
    stuff is actually shared with architecture trees; in such cases it's
    literally shared branch pulled by both, not a cherry-pick.

    A lot of ugliness and black magic is gone (-3KLoC total in this one):

    - kernel_thread()/kernel_execve()/sys_execve() redesign.

    We don't do syscalls from kernel anymore for either kernel_thread()
    or kernel_execve():

    kernel_thread() is essentially clone(2) with callback run before we
    return to userland, the callbacks either never return or do
    successful do_execve() before returning.

    kernel_execve() is a wrapper for do_execve() - it doesn't need to
    do transition to user mode anymore.

    As a result kernel_thread() and kernel_execve() are
    arch-independent now - they live in kernel/fork.c and fs/exec.c
    resp. sys_execve() is also in fs/exec.c and it's completely
    architecture-independent.

    - daemonize() is gone, along with its parts in fs/*.c

    - struct pt_regs * is no longer passed to do_fork/copy_process/
    copy_thread/do_execve/search_binary_handler/->load_binary/do_coredump.

    - sys_fork()/sys_vfork()/sys_clone() unified; some architectures
    still need wrappers (ones with callee-saved registers not saved in
    pt_regs on syscall entry), but the main part of those suckers is in
    kernel/fork.c now."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (113 commits)
    do_coredump(): get rid of pt_regs argument
    print_fatal_signal(): get rid of pt_regs argument
    ptrace_signal(): get rid of unused arguments
    get rid of ptrace_signal_deliver() arguments
    new helper: signal_pt_regs()
    unify default ptrace_signal_deliver
    flagday: kill pt_regs argument of do_fork()
    death to idle_regs()
    don't pass regs to copy_process()
    flagday: don't pass regs to copy_thread()
    bfin: switch to generic vfork, get rid of pointless wrappers
    xtensa: switch to generic clone()
    openrisc: switch to use of generic fork and clone
    unicore32: switch to generic clone(2)
    score: switch to generic fork/vfork/clone
    c6x: sanitize copy_thread(), get rid of clone(2) wrapper, switch to generic clone()
    take sys_fork/sys_vfork/sys_clone prototypes to linux/syscalls.h
    mn10300: switch to generic fork/vfork/clone
    h8300: switch to generic fork/vfork/clone
    tile: switch to generic clone()
    ...

    Conflicts:
    arch/microblaze/include/asm/Kbuild

    Linus Torvalds
     

06 Dec, 2012

1 commit

  • Since GCC 4.4, there have been __builtin_bswap32() and __builtin_bswap16()
    intrinsics. A __builtin_bswap16() came a little later (4.6 for PowerPC,
    48 for other platforms).

    By using these instead of the inline assembler that most architectures
    have in their __arch_swabXX() macros, we let the compiler see what's
    actually happening. The resulting code should be at least as good, and
    much *better* in the cases where it can be combined with a nearby load
    or store, using a load-and-byteswap or store-and-byteswap instruction
    (e.g. lwbrx/stwbrx on PowerPC, movbe on Atom).

    When GCC is sufficiently recent *and* the architecture opts in to using
    the intrinsics by setting CONFIG_ARCH_USE_BUILTIN_BSWAP, they will be
    used in preference to the __arch_swabXX() macros. An architecture which
    does not set ARCH_USE_BUILTIN_BSWAP will continue to use its own
    hand-crafted macros.

    Signed-off-by: David Woodhouse
    Acked-by: H. Peter Anvin

    David Woodhouse
     

01 Dec, 2012

1 commit

  • Create a new subsystem that probes on kernel boundaries
    to keep track of the transitions between level contexts
    with two basic initial contexts: user or kernel.

    This is an abstraction of some RCU code that use such tracking
    to implement its userspace extended quiescent state.

    We need to pull this up from RCU into this new level of indirection
    because this tracking is also going to be used to implement an "on
    demand" generic virtual cputime accounting. A necessary step to
    shutdown the tick while still accounting the cputime.

    Signed-off-by: Frederic Weisbecker
    Cc: Andrew Morton
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Li Zhong
    Cc: Gilad Ben-Yossef
    Reviewed-by: Steven Rostedt
    [ paulmck: fix whitespace error and email address. ]
    Signed-off-by: Paul E. McKenney

    Frederic Weisbecker
     

29 Nov, 2012

1 commit

  • ... and get rid of idiotic struct pt_regs * in asm-generic/syscalls.h
    prototypes of the same, while we are at it. Eventually we want those
    in linux/syscalls.h, of course, but that'll have to wait a bit.

    Note that there are *three* variants of sys_clone() order of arguments.
    Braindamage galore...

    Signed-off-by: Al Viro

    Al Viro
     

15 Oct, 2012

1 commit

  • Pull module signing support from Rusty Russell:
    "module signing is the highlight, but it's an all-over David Howells frenzy..."

    Hmm "Magrathea: Glacier signing key". Somebody has been reading too much HHGTTG.

    * 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (37 commits)
    X.509: Fix indefinite length element skip error handling
    X.509: Convert some printk calls to pr_devel
    asymmetric keys: fix printk format warning
    MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking
    MODSIGN: Make mrproper should remove generated files.
    MODSIGN: Use utf8 strings in signer's name in autogenerated X.509 certs
    MODSIGN: Use the same digest for the autogen key sig as for the module sig
    MODSIGN: Sign modules during the build process
    MODSIGN: Provide a script for generating a key ID from an X.509 cert
    MODSIGN: Implement module signature checking
    MODSIGN: Provide module signing public keys to the kernel
    MODSIGN: Automatically generate module signing keys if missing
    MODSIGN: Provide Kconfig options
    MODSIGN: Provide gitignore and make clean rules for extra files
    MODSIGN: Add FIPS policy
    module: signature checking hook
    X.509: Add a crypto key parser for binary (DER) X.509 certificates
    MPILIB: Provide a function to read raw data into an MPI
    X.509: Add an ASN.1 decoder
    X.509: Add simple ASN.1 grammar compiler
    ...

    Linus Torvalds
     

13 Oct, 2012

1 commit

  • Pull third pile of kernel_execve() patches from Al Viro:
    "The last bits of infrastructure for kernel_thread() et.al., with
    alpha/arm/x86 use of those. Plus sanitizing the asm glue and
    do_notify_resume() on alpha, fixing the "disabled irq while running
    task_work stuff" breakage there.

    At that point the rest of kernel_thread/kernel_execve/sys_execve work
    can be done independently for different architectures. The only
    pending bits that do depend on having all architectures converted are
    restrictred to fs/* and kernel/* - that'll obviously have to wait for
    the next cycle.

    I thought we'd have to wait for all of them done before we start
    eliminating the longjump-style insanity in kernel_execve(), but it
    turned out there's a very simple way to do that without flagday-style
    changes."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
    alpha: switch to saner kernel_execve() semantics
    arm: switch to saner kernel_execve() semantics
    x86, um: convert to saner kernel_execve() semantics
    infrastructure for saner ret_from_kernel_thread semantics
    make sure that kernel_thread() callbacks call do_exit() themselves
    make sure that we always have a return path from kernel_execve()
    ppc: eeh_event should just use kthread_run()
    don't bother with kernel_thread/kernel_execve for launching linuxrc
    alpha: get rid of switch_stack argument of do_work_pending()
    alpha: don't bother passing switch_stack separately from regs
    alpha: take SIGPENDING/NOTIFY_RESUME loop into signal.c
    alpha: simplify TIF_NEED_RESCHED handling

    Linus Torvalds