13 Nov, 2013

2 commits

  • Merge first patch-bomb from Andrew Morton:
    "Quite a lot of other stuff is banked up awaiting further
    next->mainline merging, but this batch contains:

    - Lots of random misc patches
    - OCFS2
    - Most of MM
    - backlight updates
    - lib/ updates
    - printk updates
    - checkpatch updates
    - epoll tweaking
    - rtc updates
    - hfs
    - hfsplus
    - documentation
    - procfs
    - update gcov to gcc-4.7 format
    - IPC"

    * emailed patches from Andrew Morton : (269 commits)
    ipc, msg: fix message length check for negative values
    ipc/util.c: remove unnecessary work pending test
    devpts: plug the memory leak in kill_sb
    ./Makefile: export initial ramdisk compression config option
    init/Kconfig: add option to disable kernel compression
    drivers: w1: make w1_slave::flags long to avoid memory corruption
    drivers/w1/masters/ds1wm.cuse dev_get_platdata()
    drivers/memstick/core/ms_block.c: fix unreachable state in h_msb_read_page()
    drivers/memstick/core/mspro_block.c: fix attributes array allocation
    drivers/pps/clients/pps-gpio.c: remove redundant of_match_ptr
    kernel/panic.c: reduce 1 byte usage for print tainted buffer
    gcov: reuse kbasename helper
    kernel/gcov/fs.c: use pr_warn()
    kernel/module.c: use pr_foo()
    gcov: compile specific gcov implementation based on gcc version
    gcov: add support for gcc 4.7 gcov format
    gcov: move gcov structs definitions to a gcc version specific file
    kernel/taskstats.c: return -ENOMEM when alloc memory fails in add_del_listener()
    kernel/taskstats.c: add nla_nest_cancel() for failure processing between nla_nest_start() and nla_nest_end()
    kernel/sysctl_binary.c: use scnprintf() instead of snprintf()
    ...

    Linus Torvalds
     
  • Use standard gcc __attribute__((alias(foo))) to define the syscall aliases
    instead of custom assembler macros.

    This is far cleaner, and also fixes my LTO kernel build.

    Signed-off-by: Andi Kleen
    Cc: Al Viro
    Cc: Geert Uytterhoeven
    Cc: Tetsuo Handa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

09 Nov, 2013

1 commit


12 Sep, 2013

1 commit

  • Unclutter -Wmissing-prototypes warning types (enabled at make W=1)

    linux/include/linux/syscalls.h:190:18: warning: no previous prototype for 'SyS_semctl' [-Wmissing-prototypes]
    asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
    ^
    linux/include/linux/syscalls.h:183:2: note: in expansion of macro '__SYSCALL_DEFINEx'
    __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
    ^
    by adding forward declarations right before definitions.

    Signed-off-by: Sergei Trofimovich
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sergei Trofimovich
     

02 Sep, 2013

1 commit

  • For performance reasons, when SMAP is in use, SMAP is left open for an
    entire put_user_try { ... } put_user_catch(); block, however, calling
    __put_user() in the middle of that block will close SMAP as the
    STAC..CLAC constructs intentionally do not nest.

    Furthermore, using __put_user() rather than put_user_ex() here is bad
    for performance.

    Thus, introduce new [compat_]save_altstack_ex() helpers that replace
    __[compat_]save_altstack() for x86, being currently the only
    architecture which supports put_user_try { ... } put_user_catch().

    Reported-by: H. Peter Anvin
    Signed-off-by: Al Viro
    Signed-off-by: H. Peter Anvin
    Cc: # v3.8+
    Link: http://lkml.kernel.org/n/tip-es5p6y64if71k8p5u08agv9n@git.kernel.org

    Al Viro
     

10 May, 2013

1 commit


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
     

20 Mar, 2013

1 commit

  • MIPS's siginfo handling has been broken since this commit:

    commit 574c4866e33d648520a8bd5bf6f573ea6e554e88
    Author: Al Viro
    Date: Sun Nov 25 22:24:19 2012 -0500
    consolidate kernel-side struct sigaction declarations

    for 64-bit BE MIPS CPUs.

    The UAPI variant looks like this:

    struct sigaction {
    unsigned int sa_flags;
    __sighandler_t sa_handler;
    sigset_t sa_mask;
    };

    but the core kernel's variant looks like this:

    struct sigaction {
    #ifndef __ARCH_HAS_ODD_SIGACTION
    __sighandler_t sa_handler;
    unsigned long sa_flags;
    #else
    unsigned long sa_flags;
    __sighandler_t sa_handler;
    #endif
    #ifdef __ARCH_HAS_SA_RESTORER
    __sigrestore_t sa_restorer;
    #endif
    sigset_t sa_mask;
    };

    The problem is that sa_flags has been changed from an unsigned int to an
    unsigned long.

    Fix this by making sa_flags unsigned int if __ARCH_HAS_ODD_SIGACTION is
    defined.

    Whilst we're at it, rename __ARCH_HAS_ODD_SIGACTION to
    __ARCH_HAS_IRIX_SIGACTION.

    Signed-off-by: David Howells
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: stable@vger.kernel.org
    Acked-by: Al Viro
    Signed-off-by: Ralf Baechle

    David Howells
     

04 Mar, 2013

7 commits


25 Feb, 2013

1 commit


24 Feb, 2013

1 commit


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

6 commits


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

4 commits


18 Dec, 2012

1 commit

  • This function is used by sparc, powerpc tile and arm64 for compat support.
    The patch adds a generic implementation with a wrapper for PowerPC to do
    the u32->int sign extension.

    The reason for a single patch covering powerpc, tile, sparc and arm64 is
    to keep it bisectable, otherwise kernel building may fail with mismatched
    function declarations.

    Signed-off-by: Catalin Marinas
    Acked-by: Chris Metcalf [for tile]
    Acked-by: David S. Miller
    Acked-by: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Alexander Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Catalin Marinas
     

29 Nov, 2012

1 commit


21 Oct, 2012

1 commit


10 Oct, 2012

1 commit

  • Pull generic execve() changes from Al Viro:
    "This introduces the generic kernel_thread() and kernel_execve()
    functions, and switches x86, arm, alpha, um and s390 over to them."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (26 commits)
    s390: convert to generic kernel_execve()
    s390: switch to generic kernel_thread()
    s390: fold kernel_thread_helper() into ret_from_fork()
    s390: fold execve_tail() into start_thread(), convert to generic sys_execve()
    um: switch to generic kernel_thread()
    x86, um/x86: switch to generic sys_execve and kernel_execve
    x86: split ret_from_fork
    alpha: introduce ret_from_kernel_execve(), switch to generic kernel_execve()
    alpha: switch to generic kernel_thread()
    alpha: switch to generic sys_execve()
    arm: get rid of execve wrapper, switch to generic execve() implementation
    arm: optimized current_pt_regs()
    arm: introduce ret_from_kernel_execve(), switch to generic kernel_execve()
    arm: split ret_from_fork, simplify kernel_thread() [based on patch by rmk]
    generic sys_execve()
    generic kernel_execve()
    new helper: current_pt_regs()
    preparation for generic kernel_thread()
    um: kill thread->forking
    um: let signal_delivered() do SIGTRAP on singlestepping into handler
    ...

    Linus Torvalds
     

06 Oct, 2012

1 commit

  • This is a preparatory patch for the introduction of NT_SIGINFO elf note.

    Make the location of compat_siginfo_t uniform across eight architectures
    which have it. Now it can be pulled in by including asm/compat.h or
    linux/compat.h.

    Most of the copies are verbatim. compat_uid[32]_t had to be replaced by
    __compat_uid[32]_t. compat_uptr_t had to be moved up before
    compat_siginfo_t in asm/compat.h on a several architectures (tile already
    had it moved up). compat_sigval_t had to be relocated from linux/compat.h
    to asm/compat.h.

    Signed-off-by: Denys Vlasenko
    Cc: Oleg Nesterov
    Cc: Amerigo Wang
    Cc: "Jonathan M. Foote"
    Cc: Roland McGrath
    Cc: Pedro Alves
    Cc: Fengguang Wu
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denys Vlasenko
     

03 Oct, 2012

1 commit

  • This function is used by sparc, powerpc and arm64 for compat support.
    The patch adds a generic implementation which calls do_sendfile()
    directly and avoids set_fs().

    The sparc architecture has wrappers for the sign extensions while
    powerpc relies on the compiler to do the this. The patch adds wrappers
    for powerpc to handle the u32->int type conversion.

    compat_sys_sendfile64() can be replaced by a sys_sendfile() call since
    compat_loff_t has the same size as off_t on a 64-bit system.

    On powerpc, the patch also changes the 64-bit sendfile call from
    sys_sendile64 to sys_sendfile.

    Signed-off-by: Catalin Marinas
    Acked-by: David S. Miller
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Alexander Viro
    Cc: Andrew Morton
    Signed-off-by: Al Viro

    Catalin Marinas
     

01 Oct, 2012

1 commit

  • Selected by __ARCH_WANT_SYS_EXECVE in unistd.h. Requires
    * working current_pt_regs()
    * *NOT* doing a syscall-in-kernel kind of kernel_execve()
    implementation. Using generic kernel_execve() is fine.

    Signed-off-by: Al Viro

    Al Viro
     

31 Jul, 2012

3 commits

  • Rather than #define the options manually in the architecture code, add
    Kconfig options for them and select them there instead. This also allows
    us to select the compat IPC version parsing automatically for platforms
    using the old compat IPC interface.

    Reported-by: Andrew Morton
    Signed-off-by: Will Deacon
    Cc: Arnd Bergmann
    Cc: Chris Metcalf
    Cc: Catalin Marinas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Deacon
     
  • The msgsnd and msgrcv system calls use size_t to represent the size of the
    message being transferred. POSIX states that values of msgsz greater than
    SSIZE_MAX cause the result to be implementation-defined. On Linux, this
    equates to returning -EINVAL if (long) msgsz < 0.

    For compat tasks where !CONFIG_ARCH_WANT_OLD_COMPAT_IPC and compat_size_t
    is smaller than size_t, negative size values passed from userspace will be
    interpreted as positive values by do_msg{rcv,snd} and will fail to exit
    early with -EINVAL.

    This patch changes the compat prototypes for msg{rcv,snd} so that the
    message size is represented as a compat_ssize_t, which we cast to the
    native ssize_t type for the core IPC code.

    Cc: Arnd Bergmann
    Acked-by: Chris Metcalf
    Acked-by: Catalin Marinas
    Signed-off-by: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Deacon
     
  • Commit 48b25c43e6ee ("ipc: provide generic compat versions of IPC
    syscalls") added a new ARCH_WANT_OLD_COMPAT_IPC config option for
    architectures to select if their compat target requires the old IPC
    syscall interface.

    For architectures (such as AArch64) that do not require the internal
    calling conventions provided by this option, but have a compat target
    where the C library passes the IPC_64 flag explicitly,
    compat_ipc_parse_version no longer strips out the flag before calling
    the native system call implementation, resulting in unknown SHM/IPC
    commands and -EINVAL being returned to userspace.

    This patch separates the selection of the internal calling conventions
    for the IPC syscalls from the version parsing, allowing architectures to
    select __ARCH_WANT_COMPAT_IPC_PARSE_VERSION if they want to use version
    parsing whilst retaining the newer syscall calling conventions.

    Acked-by: Chris Metcalf
    Cc: Arnd Bergmann
    Acked-by: Catalin Marinas
    Signed-off-by: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Deacon
     

01 Jun, 2012

1 commit

  • A cleanup of rw_copy_check_uvector and compat_rw_copy_check_uvector after
    changes made to support CMA in an earlier patch.

    Rather than having an additional check_access parameter to these
    functions, the first paramater type is overloaded to allow the caller to
    specify CHECK_IOVEC_ONLY which means check that the contents of the iovec
    are valid, but do not check the memory that they point to. This is used
    by process_vm_readv/writev where we need to validate that a iovec passed
    to the syscall is valid but do not want to check the memory that it points
    to at this point because it refers to an address space in another process.

    Signed-off-by: Chris Yeoh
    Reviewed-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christopher Yeoh