10 Sep, 2018

1 commit

  • commit 42a0cc3478584d4d63f68f2f5af021ddbea771fa upstream.

    Holding uts_sem as a writer while accessing userspace memory allows a
    namespace admin to stall all processes that attempt to take uts_sem.
    Instead, move data through stack buffers and don't access userspace memory
    while uts_sem is held.

    Cc: stable@vger.kernel.org
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Jann Horn
    Signed-off-by: Eric W. Biederman
    Signed-off-by: Greg Kroah-Hartman

    Jann Horn
     

05 Sep, 2018

2 commits

  • [ Upstream commit 12be1036c536f849ad6f9bba73cffa708aa965c3 ]

    This is necessary to be able to include when
    CONFIG_GENERIC_MSI_IRQ_DOMAIN is enabled. Without this, a build with
    CONFIG_GENERIC_MSI_IRQ_DOMAIN fails with:

    In file included from drivers//ata/ahci.c:45:0:
    >> include/linux/msi.h:226:10: error: unknown type name 'msi_alloc_info_t'; did you mean 'sg_alloc_fn'?
    msi_alloc_info_t *arg);
    ^~~~~~~~~~~~~~~~
    sg_alloc_fn
    include/linux/msi.h:230:9: error: unknown type name 'msi_alloc_info_t'; did you mean 'sg_alloc_fn'?
    msi_alloc_info_t *arg);
    ^~~~~~~~~~~~~~~~
    sg_alloc_fn
    include/linux/msi.h:239:12: error: unknown type name 'msi_alloc_info_t'; did you mean 'sg_alloc_fn'?
    msi_alloc_info_t *arg);
    ^~~~~~~~~~~~~~~~
    sg_alloc_fn
    include/linux/msi.h:240:22: error: unknown type name 'msi_alloc_info_t'; did you mean 'sg_alloc_fn'?
    void (*msi_finish)(msi_alloc_info_t *arg, int retval);
    ^~~~~~~~~~~~~~~~
    sg_alloc_fn
    include/linux/msi.h:241:20: error: unknown type name 'msi_alloc_info_t'; did you mean 'sg_alloc_fn'?
    void (*set_desc)(msi_alloc_info_t *arg,
    ^~~~~~~~~~~~~~~~
    sg_alloc_fn
    include/linux/msi.h:316:18: error: unknown type name 'msi_alloc_info_t'; did you mean 'sg_alloc_fn'?
    int nvec, msi_alloc_info_t *args);
    ^~~~~~~~~~~~~~~~
    sg_alloc_fn
    include/linux/msi.h:318:29: error: unknown type name 'msi_alloc_info_t'; did you mean 'sg_alloc_fn'?
    int virq, int nvec, msi_alloc_info_t *args);
    ^~~~~~~~~~~~~~~~
    sg_alloc_fn

    Signed-off-by: Thomas Petazzoni
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Thomas Petazzoni
     
  • [ Upstream commit 6f57ed681ed817a4ec444e83f3aa2ad695d5ef34 ]

    Code that was added to force gcc not to inline any function that isn't
    explicitly declared as inline uncovered that init_tick_ops() isn't
    marked as "__init". It is only called by __init functions and more
    importantly it too calls an __init function which would require it to be
    __init as well.

    Link: http://lkml.kernel.org/r/201806060444.hdHcKOBy%fengguang.wu@intel.com

    Reported-by: kbuild test robot
    Signed-off-by: Steven Rostedt (VMware)
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Steven Rostedt (VMware)
     

30 May, 2018

2 commits

  • [ Upstream commit d13864b68e41c11e4231de90cf358658f6ecea45 ]

    This avoids a lot of -Wunused warnings such as:

    ====================
    kernel/debug/debug_core.c: In function ‘kgdb_cpu_enter’:
    ./arch/sparc/include/asm/cmpxchg_64.h:55:22: warning: value computed is not used [-Wunused-value]
    #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))

    ./arch/sparc/include/asm/atomic_64.h:86:30: note: in expansion of macro ‘xchg’
    #define atomic_xchg(v, new) (xchg(&((v)->counter), new))
    ^~~~
    kernel/debug/debug_core.c:508:4: note: in expansion of macro ‘atomic_xchg’
    atomic_xchg(&kgdb_active, cpu);
    ^~~~~~~~~~~
    ====================

    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    David S. Miller
     
  • [ Upstream commit 173a3efd3edb2ef6ef07471397c5f542a360e9c1 ]

    Looking at functions with large stack frames across all architectures
    led me discovering that BUG() suffers from the same problem as
    fortify_panic(), which I've added a workaround for already.

    In short, variables that go out of scope by calling a noreturn function
    or __builtin_unreachable() keep using stack space in functions
    afterwards.

    A workaround that was identified is to insert an empty assembler
    statement just before calling the function that doesn't return. I'm
    adding a macro "barrier_before_unreachable()" to document this, and
    insert calls to that in all instances of BUG() that currently suffer
    from this problem.

    The files that saw the largest change from this had these frame sizes
    before, and much less with my patch:

    fs/ext4/inode.c:82:1: warning: the frame size of 1672 bytes is larger than 800 bytes [-Wframe-larger-than=]
    fs/ext4/namei.c:434:1: warning: the frame size of 904 bytes is larger than 800 bytes [-Wframe-larger-than=]
    fs/ext4/super.c:2279:1: warning: the frame size of 1160 bytes is larger than 800 bytes [-Wframe-larger-than=]
    fs/ext4/xattr.c:146:1: warning: the frame size of 1168 bytes is larger than 800 bytes [-Wframe-larger-than=]
    fs/f2fs/inode.c:152:1: warning: the frame size of 1424 bytes is larger than 800 bytes [-Wframe-larger-than=]
    net/netfilter/ipvs/ip_vs_core.c:1195:1: warning: the frame size of 1068 bytes is larger than 800 bytes [-Wframe-larger-than=]
    net/netfilter/ipvs/ip_vs_core.c:395:1: warning: the frame size of 1084 bytes is larger than 800 bytes [-Wframe-larger-than=]
    net/netfilter/ipvs/ip_vs_ftp.c:298:1: warning: the frame size of 928 bytes is larger than 800 bytes [-Wframe-larger-than=]
    net/netfilter/ipvs/ip_vs_ftp.c:418:1: warning: the frame size of 908 bytes is larger than 800 bytes [-Wframe-larger-than=]
    net/netfilter/ipvs/ip_vs_lblcr.c:718:1: warning: the frame size of 960 bytes is larger than 800 bytes [-Wframe-larger-than=]
    drivers/net/xen-netback/netback.c:1500:1: warning: the frame size of 1088 bytes is larger than 800 bytes [-Wframe-larger-than=]

    In case of ARC and CRIS, it turns out that the BUG() implementation
    actually does return (or at least the compiler thinks it does),
    resulting in lots of warnings about uninitialized variable use and
    leaving noreturn functions, such as:

    block/cfq-iosched.c: In function 'cfq_async_queue_prio':
    block/cfq-iosched.c:3804:1: error: control reaches end of non-void function [-Werror=return-type]
    include/linux/dmaengine.h: In function 'dma_maxpq':
    include/linux/dmaengine.h:1123:1: error: control reaches end of non-void function [-Werror=return-type]

    This makes them call __builtin_trap() instead, which should normally
    dump the stack and kill the current process, like some of the other
    architectures already do.

    I tried adding barrier_before_unreachable() to panic() and
    fortify_panic() as well, but that had very little effect, so I'm not
    submitting that patch.

    Vineet said:

    : For ARC, it is double win.
    :
    : 1. Fixes 3 -Wreturn-type warnings
    :
    : | ../net/core/ethtool.c:311:1: warning: control reaches end of non-void function
    : [-Wreturn-type]
    : | ../kernel/sched/core.c:3246:1: warning: control reaches end of non-void function
    : [-Wreturn-type]
    : | ../include/linux/sunrpc/svc_xprt.h:180:1: warning: control reaches end of
    : non-void function [-Wreturn-type]
    :
    : 2. bloat-o-meter reports code size improvements as gcc elides the
    : generated code for stack return.

    Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
    Link: http://lkml.kernel.org/r/20171219114112.939391-1-arnd@arndb.de
    Signed-off-by: Arnd Bergmann
    Acked-by: Vineet Gupta [arch/arc]
    Tested-by: Vineet Gupta [arch/arc]
    Cc: Mikael Starvik
    Cc: Jesper Nilsson
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Geert Uytterhoeven
    Cc: "David S. Miller"
    Cc: Christopher Li
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Kees Cook
    Cc: Ingo Molnar
    Cc: Josh Poimboeuf
    Cc: Will Deacon
    Cc: "Steven Rostedt (VMware)"
    Cc: Mark Rutland
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

25 May, 2018

1 commit

  • [ Upstream commit 00ad691ab140b54ab9f5de5e74cb994f552e8124 ]

    Never directly free @dev after calling device_register(), even
    if it returned an error. Always use put_device() to give up the
    reference initialized.

    Signed-off-by: Arvind Yadav
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arvind Yadav
     

26 Apr, 2018

1 commit

  • [ Upstream commit a8e654f01cb725d0bfd741ebca1bf4c9337969cc ]

    It's required to avoid losing dirty and accessed bits.

    [akpm@linux-foundation.org: add a `do' to the do-while loop]
    Link: http://lkml.kernel.org/r/20171213105756.69879-9-kirill.shutemov@linux.intel.com
    Signed-off-by: Nitin Gupta
    Signed-off-by: Kirill A. Shutemov
    Cc: David Miller
    Cc: Vlastimil Babka
    Cc: Andrea Arcangeli
    Cc: Michal Hocko
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Nitin Gupta
     

22 Feb, 2018

1 commit

  • commit 75f296d93bcebcfe375884ddac79e30263a31766 upstream.

    Convert all allocations that used a NOTRACK flag to stop using it.

    Link: http://lkml.kernel.org/r/20171007030159.22241-3-alexander.levin@verizon.com
    Signed-off-by: Sasha Levin
    Cc: Alexander Potapenko
    Cc: Eric W. Biederman
    Cc: Michal Hocko
    Cc: Pekka Enberg
    Cc: Steven Rostedt
    Cc: Tim Hansen
    Cc: Vegard Nossum
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Levin, Alexander (Sasha Levin)
     

17 Feb, 2018

1 commit

  • commit a208fa8f33031b9e0aba44c7d1b7e68eb0cbd29e upstream.

    We need to consistently enforce that keyed hashes cannot be used without
    setting the key. To do this we need a reliable way to determine whether
    a given hash algorithm is keyed or not. AF_ALG currently does this by
    checking for the presence of a ->setkey() method. However, this is
    actually slightly broken because the CRC-32 algorithms implement
    ->setkey() but can also be used without a key. (The CRC-32 "key" is not
    actually a cryptographic key but rather represents the initial state.
    If not overridden, then a default initial state is used.)

    Prepare to fix this by introducing a flag CRYPTO_ALG_OPTIONAL_KEY which
    indicates that the algorithm has a ->setkey() method, but it is not
    required to be called. Then set it on all the CRC-32 algorithms.

    The same also applies to the Adler-32 implementation in Lustre.

    Also, the cryptd and mcryptd templates have to pass through the flag
    from their underlying algorithm.

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     

03 Jan, 2018

1 commit

  • [ Upstream commit 59585b4be9ae4dc6506551709bdcd6f5210b8a01 ]

    Commit v4.12-rc4-1-g9289ea7f952b introduced a mistake that made the
    64-bit hweight stub call the 16-bit hweight function.

    Fixes: 9289ea7f952b ("sparc64: Use indirect calls in hamming weight stubs")
    Signed-off-by: Jan Engelhardt
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Jan Engelhardt
     

25 Dec, 2017

2 commits

  • commit d15155824c5014803d91b829736d249c500bdda6 upstream.

    linux/compiler.h is included indirectly by linux/types.h via
    uapi/linux/types.h -> uapi/linux/posix_types.h -> linux/stddef.h
    -> uapi/linux/stddef.h and is needed to provide a proper definition of
    offsetof.

    Unfortunately, compiler.h requires a definition of
    smp_read_barrier_depends() for defining lockless_dereference() and soon
    for defining READ_ONCE(), which means that all
    users of READ_ONCE() will need to include asm/barrier.h to avoid splats
    such as:

    In file included from include/uapi/linux/stddef.h:1:0,
    from include/linux/stddef.h:4,
    from arch/h8300/kernel/asm-offsets.c:11:
    include/linux/list.h: In function 'list_empty':
    >> include/linux/compiler.h:343:2: error: implicit declaration of function 'smp_read_barrier_depends' [-Werror=implicit-function-declaration]
    smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \
    ^

    A better alternative is to include asm/barrier.h in linux/compiler.h,
    but this requires a type definition for "bool" on some architectures
    (e.g. x86), which is defined later by linux/types.h. Type "bool" is also
    used directly in linux/compiler.h, so the whole thing is pretty fragile.

    This patch splits compiler.h in two: compiler_types.h contains type
    annotations, definitions and the compiler-specific parts, whereas
    compiler.h #includes compiler-types.h and additionally defines macros
    such as {READ,WRITE.ACCESS}_ONCE().

    uapi/linux/stddef.h and linux/linkage.h are then moved over to include
    linux/compiler_types.h, which fixes the build for h8 and blackfin.

    Signed-off-by: Will Deacon
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1508840570-22169-2-git-send-email-will.deacon@arm.com
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Will Deacon
     
  • [ Upstream commit 07aee94394547721ac168cbf4e1c09c14a5fe671 ]

    When LD_ABS/IND is used in the program, and we have a BPF helper
    call that changes packet data (bpf_helper_changes_pkt_data() returns
    true), then in case of sparc JIT, we try to reload cached skb data
    from bpf2sparc[BPF_REG_6]. However, there is no such guarantee or
    assumption that skb sits in R6 at this point, all helpers changing
    skb data only have a guarantee that skb sits in R1. Therefore,
    store BPF R1 in L7 temporarily and after procedure call use L7 to
    reload cached skb data. skb sitting in R6 is only true at the time
    when LD_ABS/IND is executed.

    Fixes: 7a12b5031c6b ("sparc64: Add eBPF JIT.")
    Signed-off-by: Daniel Borkmann
    Acked-by: David S. Miller
    Acked-by: Alexei Starovoitov
    Signed-off-by: Alexei Starovoitov
    Signed-off-by: Greg Kroah-Hartman

    Daniel Borkmann
     

17 Dec, 2017

1 commit

  • commit 4d2dc2cc766c3b51929658cacbc6e34fc8e242fb upstream.

    Currently, we're capping the values too low in the F_GETLK64 case. The
    fields in that structure are 64-bit values, so we shouldn't need to do
    any sort of fixup there.

    Make sure we check that assumption at build time in the future however
    by ensuring that the sizes we're copying will fit.

    With this, we no longer need COMPAT_LOFF_T_MAX either, so remove it.

    Fixes: 94073ad77fff2 (fs/locks: don't mess with the address limit in compat_fcntl64)
    Reported-by: Vitaly Lipatov
    Signed-off-by: Jeff Layton
    Reviewed-by: David Howells
    Signed-off-by: Greg Kroah-Hartman

    Jeff Layton
     

14 Dec, 2017

1 commit

  • [ Upstream commit 2a20aa171071a334d80c4e5d5af719d8374702fc ]

    Without deferred struct page feature (CONFIG_DEFERRED_STRUCT_PAGE_INIT),
    flags and other fields in "struct page"es are never changed prior to
    first initializing struct pages by going through __init_single_page().

    With deferred struct page feature enabled there is a case where we set
    some fields prior to initializing:

    mem_init() {
    register_page_bootmem_info();
    free_all_bootmem();
    ...
    }

    When register_page_bootmem_info() is called only non-deferred struct
    pages are initialized. But, this function goes through some reserved
    pages which might be part of the deferred, and thus are not yet
    initialized.

    mem_init
    register_page_bootmem_info
    register_page_bootmem_info_node
    get_page_bootmem
    .. setting fields here ..
    such as: page->freelist = (void *)type;

    free_all_bootmem()
    free_low_memory_core_early()
    for_each_reserved_mem_region()
    reserve_bootmem_region()
    init_reserved_page()
    Reviewed-by: Steven Sistare
    Reviewed-by: Daniel Jordan
    Reviewed-by: Bob Picco
    Acked-by: David S. Miller
    Acked-by: Michal Hocko
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Ard Biesheuvel
    Cc: Catalin Marinas
    Cc: Christian Borntraeger
    Cc: Dmitry Vyukov
    Cc: Heiko Carstens
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Mark Rutland
    Cc: Matthew Wilcox
    Cc: Mel Gorman
    Cc: Michal Hocko
    Cc: Sam Ravnborg
    Cc: Thomas Gleixner
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Pavel Tatashin
     

21 Nov, 2017

3 commits

  • [ Upstream commit 70f3c8b7c2e7ebcdde8354da004872e7c9184e97 ]

    For a PUD hugepage entry, we need to propagate bits [32:22]
    from virtual address to resolve at 4M granularity. However,
    the current code was incorrectly propagating bits [29:19].
    This bug can cause incorrect data to be returned for pages
    backed with 16G hugepages.

    Signed-off-by: Nitin Gupta
    Reported-by: Al Viro
    Cc: Al Viro
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Nitin Gupta
     
  • commit 01c3f0a42a2a0ff0c3fed80a1a25f2641ae72554 upstream.

    Fix the following build errors.

    In file included from arch/sparc/include/asm/mmu_context.h:4:0,
    from include/linux/mmu_context.h:4,
    from drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h:29,
    from drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:23:
    arch/sparc/include/asm/mmu_context_64.h:22:37: error:
    unknown type name 'per_cpu_secondary_mm'

    arch/sparc/include/asm/mmu_context_64.h: In function 'switch_mm':
    arch/sparc/include/asm/mmu_context_64.h:79:2: error:
    implicit declaration of function 'smp_processor_id'

    Fixes: 70539bd79500 ("drm/amd: Update MEC HQD loading code for KFD")
    Signed-off-by: Guenter Roeck
    Acked-by: Oded Gabbay
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     
  • commit 23198ddffb6cddb5d5824230af4dd4b46e4046a4 upstream.

    This fixes the build with i40e driver enabled.

    Reported-by: Guenter Roeck
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    David S. Miller
     

02 Nov, 2017

2 commits

  • Many user space API headers are missing licensing information, which
    makes it hard for compliance tools to determine the correct license.

    By default are files without license information under the default
    license of the kernel, which is GPLV2. Marking them GPLV2 would exclude
    them from being included in non GPLV2 code, which is obviously not
    intended. The user space API headers fall under the syscall exception
    which is in the kernels COPYING file:

    NOTE! This copyright does *not* cover user programs that use kernel
    services by normal system calls - this is merely considered normal use
    of the kernel, and does *not* fall under the heading of "derived work".

    otherwise syscall usage would not be possible.

    Update the files which contain no license information with an SPDX
    license identifier. The chosen identifier is 'GPL-2.0 WITH
    Linux-syscall-note' which is the officially assigned identifier for the
    Linux syscall exception. SPDX license identifiers are a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne. See the previous patch in this series for the
    methodology of how this patch was researched.

    Reviewed-by: Kate Stewart
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

09 Oct, 2017

1 commit

  • The new flag PCI_DEV_FLAGS_NO_RELAXED_ORDERING has been added
    to indicate that Relaxed Ordering Attributes (RO) should not
    be used for Transaction Layer Packets (TLP) targeted toward
    these affected Root Port, it will clear the bit4 in the PCIe
    Device Control register, so the PCIe device drivers could
    query PCIe configuration space to determine if it can send
    TLPs to Root Port with the Relaxed Ordering Attributes set.

    With this new flag we don't need the config ARCH_WANT_RELAX_ORDER
    to control the Relaxed Ordering Attributes for the ixgbe drivers
    just like the commit 1a8b6d76dc5b ("net:add one common config...") did,
    so revert this commit.

    Signed-off-by: Ding Tianhong
    Tested-by: Andrew Bowers
    Signed-off-by: Jeff Kirsher

    Ding Tianhong
     

12 Sep, 2017

1 commit

  • Pull namespace updates from Eric Biederman:
    "Life has been busy and I have not gotten half as much done this round
    as I would have liked. I delayed it so that a minor conflict
    resolution with the mips tree could spend a little time in linux-next
    before I sent this pull request.

    This includes two long delayed user namespace changes from Kirill
    Tkhai. It also includes a very useful change from Serge Hallyn that
    allows the security capability attribute to be used inside of user
    namespaces. The practical effect of this is people can now untar
    tarballs and install rpms in user namespaces. It had been suggested to
    generalize this and encode some of the namespace information
    information in the xattr name. Upon close inspection that makes the
    things that should be hard easy and the things that should be easy
    more expensive.

    Then there is my bugfix/cleanup for signal injection that removes the
    magic encoding of the siginfo union member from the kernel internal
    si_code. The mips folks reported the case where I had used FPE_FIXME
    me is impossible so I have remove FPE_FIXME from mips, while at the
    same time including a return statement in that case to keep gcc from
    complaining about unitialized variables.

    I almost finished the work to get make copy_siginfo_to_user a trivial
    copy to user. The code is available at:

    git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git neuter-copy_siginfo_to_user-v3

    But I did not have time/energy to get the code posted and reviewed
    before the merge window opened.

    I was able to see that the security excuse for just copying fields
    that we know are initialized doesn't work in practice there are buggy
    initializations that don't initialize the proper fields in siginfo. So
    we still sometimes copy unitialized data to userspace"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    Introduce v3 namespaced file capabilities
    mips/signal: In force_fcr31_sig return in the impossible case
    signal: Remove kernel interal si_code magic
    fcntl: Don't use ambiguous SIG_POLL si_codes
    prctl: Allow local CAP_SYS_ADMIN changing exe_file
    security: Use user_namespace::level to avoid redundant iterations in cap_capable()
    userns,pidns: Verify the userns for new pid namespaces
    signal/testing: Don't look for __SI_FAULT in userspace
    signal/mips: Document a conflict with SI_USER with SIGFPE
    signal/sparc: Document a conflict with SI_USER with SIGFPE
    signal/ia64: Document a conflict with SI_USER with SIGFPE
    signal/alpha: Document a conflict with SI_USER for SIGTRAP

    Linus Torvalds
     

11 Sep, 2017

1 commit

  • Pull sparc updates from David Miller:

    1) Use register window state adjustment instructions when available,
    from Anthony Yznaga.

    2) Add VCC console concentrator driver, from Jag Raman.

    3) Add 16GB hugepage support, from Nitin Gupta.

    4) Support cpu 'poke' hypercall, from Vijay Kumar.

    5) Add M7/M8 optimized memcpy/memset/copy_{to,from}_user, from Babu
    Moger.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: (33 commits)
    sparc64: Handle additional cases of no fault loads
    sparc64: speed up etrap/rtrap on NG2 and later processors
    sparc64: vcc: make ktermios const
    sparc: leon: grpci1: constify of_device_id
    sparc: leon: grpci2: constify of_device_id
    sparc64: vcc: Check for IS_ERR() instead of NULL
    sparc64: Cleanup hugepage table walk functions
    sparc64: Add 16GB hugepage support
    sparc64: Support huge PUD case in get_user_pages
    sparc64: vcc: Add install & cleanup TTY operations
    sparc64: vcc: Add break_ctl TTY operation
    sparc64: vcc: Add chars_in_buffer TTY operation
    sparc64: vcc: Add write & write_room TTY operations
    sparc64: vcc: Add hangup TTY operation
    sparc64: vcc: Add open & close TTY operations
    sparc64: vcc: Enable LDC event processing engine
    sparc64: vcc: Add RX & TX timer for delayed LDC operation
    sparc64: vcc: Create sysfs attribute group
    sparc64: vcc: Enable VCC port probe and removal
    sparc64: vcc: TTY driver initialization and cleanup
    ...

    Linus Torvalds
     

10 Sep, 2017

3 commits

  • Load instructions using ASI_PNF or other no-fault ASIs should not
    cause a SIGSEGV or SIGBUS.

    A garden variety unmapped address follows the TSB miss path, and when
    no valid mapping is found in the process page tables, the miss handler
    checks to see if the access was via a no-fault ASI. It then fixes up
    the target register with a zero, and skips the no-fault load
    instruction.

    But different paths are taken for data access exceptions and alignment
    traps, and these do not respect the no-fault ASI. We add checks in
    these paths for the no-fault ASI, and fix up the target register and
    TPC just like in the TSB miss case.

    Signed-off-by: Rob Gardner
    Acked-by: Sam Ravnborg
    Signed-off-by: David S. Miller

    Rob Gardner
     
  • For many sun4v processor types, reading or writing a privileged register
    has a latency of 40 to 70 cycles. Use a combination of the low-latency
    allclean, otherw, normalw, and nop instructions in etrap and rtrap to
    replace 2 rdpr and 5 wrpr instructions and improve etrap/rtrap
    performance. allclean, otherw, and normalw are available on NG2 and
    later processors.

    The average ticks to execute the flush windows trap ("ta 0x3") with and
    without this patch on select platforms:

    CPU Not patched Patched % Latency Reduction

    NG2 1762 1558 -11.58
    NG4 3619 3204 -11.47
    M7 3015 2624 -12.97
    SPARC64-X 829 770 -7.12

    Signed-off-by: Anthony Yznaga
    Signed-off-by: David S. Miller

    Anthony Yznaga
     
  • Merge more updates from Andrew Morton:

    - most of the rest of MM

    - a small number of misc things

    - lib/ updates

    - checkpatch

    - autofs updates

    - ipc/ updates

    * emailed patches from Andrew Morton : (126 commits)
    ipc: optimize semget/shmget/msgget for lots of keys
    ipc/sem: play nicer with large nsops allocations
    ipc/sem: drop sem_checkid helper
    ipc: convert kern_ipc_perm.refcount from atomic_t to refcount_t
    ipc: convert sem_undo_list.refcnt from atomic_t to refcount_t
    ipc: convert ipc_namespace.count from atomic_t to refcount_t
    kcov: support compat processes
    sh: defconfig: cleanup from old Kconfig options
    mn10300: defconfig: cleanup from old Kconfig options
    m32r: defconfig: cleanup from old Kconfig options
    drivers/pps: use surrounding "if PPS" to remove numerous dependency checks
    drivers/pps: aesthetic tweaks to PPS-related content
    cpumask: make cpumask_next() out-of-line
    kmod: move #ifdef CONFIG_MODULES wrapper to Makefile
    kmod: split off umh headers into its own file
    MAINTAINERS: clarify kmod is just a kernel module loader
    kmod: split out umh code into its own file
    test_kmod: flip INT checks to be consistent
    test_kmod: remove paranoid UINT_MAX check on uint range processing
    vfat: deduplicate hex2bin()
    ...

    Linus Torvalds
     

09 Sep, 2017

3 commits

  • Patch series "Define CPU_BIG_ENDIAN or warn for inconsistencies", v3.

    While working on enabling queued rwlock on SPARC, found this following
    code in include/asm-generic/qrwlock.h which uses CONFIG_CPU_BIG_ENDIAN to
    clear a byte.

    static inline u8 *__qrwlock_write_byte(struct qrwlock *lock)
    {
    return (u8 *)lock + 3 * IS_BUILTIN(CONFIG_CPU_BIG_ENDIAN);
    }

    Problem is many of the fixed big endian architectures don't define
    CPU_BIG_ENDIAN and clears the wrong byte.

    Define CPU_BIG_ENDIAN for all the fixed big endian architecture to fix it.

    Also found few more references of this config parameter in
    drivers/of/base.c
    drivers/of/fdt.c
    drivers/tty/serial/earlycon.c
    drivers/tty/serial/serial_core.c
    Be aware that this may cause regressions if someone has worked-around
    problems in the above code already. Remove the work-around.

    Here is our original discussion
    https://lkml.org/lkml/2017/5/24/620

    Link: http://lkml.kernel.org/r/1499358861-179979-2-git-send-email-babu.moger@oracle.com
    Signed-off-by: Babu Moger
    Suggested-by: Arnd Bergmann
    Acked-by: Geert Uytterhoeven
    Acked-by: David S. Miller
    Acked-by: Stafford Horne
    Cc: Yoshinori Sato
    Cc: Jonas Bonn
    Cc: Stefan Kristiansson
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Alexander Viro
    Cc: Michal Simek
    Cc: Michael Ellerman (powerpc)
    Cc: Peter Zijlstra
    Cc: Ingo Molnar
    Cc: Max Filippov
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Babu Moger
     
  • Where possible, call memset16(), memmove() or memcpy() instead of using
    open-coded loops. I don't like the calling convention that uses a byte
    count instead of a count of u16s, but it's a little late to change that.
    Reduces code size of fbcon.o by almost 400 bytes on my laptop build.

    [akpm@linux-foundation.org: fix build]
    Link: http://lkml.kernel.org/r/20170720184539.31609-9-willy@infradead.org
    Signed-off-by: Matthew Wilcox
    Cc: Ralf Baechle
    Cc: David Miller
    Cc: Sam Ravnborg
    Cc: "H. Peter Anvin"
    Cc: "James E.J. Bottomley"
    Cc: "Martin K. Petersen"
    Cc: Ingo Molnar
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Minchan Kim
    Cc: Richard Henderson
    Cc: Russell King
    Cc: Sergey Senozhatsky
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     
  • Pull PCI updates from Bjorn Helgaas:

    - add enhanced Downstream Port Containment support, which prints more
    details about Root Port Programmed I/O errors (Dongdong Liu)

    - add Layerscape ls1088a and ls2088a support (Hou Zhiqiang)

    - add MediaTek MT2712 and MT7622 support (Ryder Lee)

    - add MediaTek MT2712 and MT7622 MSI support (Honghui Zhang)

    - add Qualcom IPQ8074 support (Varadarajan Narayanan)

    - add R-Car r8a7743/5 device tree support (Biju Das)

    - add Rockchip per-lane PHY support for better power management (Shawn
    Lin)

    - fix IRQ mapping for hot-added devices by replacing the
    pci_fixup_irqs() boot-time design with a host bridge hook called at
    probe-time (Lorenzo Pieralisi, Matthew Minter)

    - fix race when enabling two devices that results in upstream bridge
    not being enabled correctly (Srinath Mannam)

    - fix pciehp power fault infinite loop (Keith Busch)

    - fix SHPC bridge MSI hotplug events by enabling bus mastering
    (Aleksandr Bezzubikov)

    - fix a VFIO issue by correcting PCIe capability sizes (Alex
    Williamson)

    - fix an INTD issue on Xilinx and possibly other drivers by unifying
    INTx IRQ domain support (Paul Burton)

    - avoid IOMMU stalls by marking AMD Stoney GPU ATS as broken (Joerg
    Roedel)

    - allow APM X-Gene device assignment to guests by adding an ACS quirk
    (Feng Kan)

    - fix driver crashes by disabling Extended Tags on Broadcom HT2100
    (Extended Tags support is required for PCIe Receivers but not
    Requesters, and we now enable them by default when Requesters support
    them) (Sinan Kaya)

    - fix MSIs for devices that use phantom RIDs for DMA by assuming MSIs
    use the real Requester ID (not a phantom RID) (Robin Murphy)

    - prevent assignment of Intel VMD children to guests (which may be
    supported eventually, but isn't yet) by not associating an IOMMU with
    them (Jon Derrick)

    - fix Intel VMD suspend/resume by releasing IRQs on suspend (Scott
    Bauer)

    - fix a Function-Level Reset issue with Intel 750 NVMe by waiting
    longer (up to 60sec instead of 1sec) for device to become ready
    (Sinan Kaya)

    - fix a Function-Level Reset issue on iProc Stingray by working around
    hardware defects in the CRS implementation (Oza Pawandeep)

    - fix an issue with Intel NVMe P3700 after an iProc reset by adding a
    delay during shutdown (Oza Pawandeep)

    - fix a Microsoft Hyper-V lockdep issue by polling instead of blocking
    in compose_msi_msg() (Stephen Hemminger)

    - fix a wireless LAN driver timeout by clearing DesignWare MSI
    interrupt status after it is handled, not before (Faiz Abbas)

    - fix DesignWare ATU enable checking (Jisheng Zhang)

    - reduce Layerscape dependencies on the bootloader by doing more
    initialization in the driver (Hou Zhiqiang)

    - improve Intel VMD performance allowing allocation of more IRQ vectors
    than present CPUs (Keith Busch)

    - improve endpoint framework support for initial DMA mask, different
    BAR sizes, configurable page sizes, MSI, test driver, etc (Kishon
    Vijay Abraham I, Stan Drozd)

    - rework CRS support to add periodic messages while we poll during
    enumeration and after Function-Level Reset and prepare for possible
    other uses of CRS (Sinan Kaya)

    - clean up Root Port AER handling by removing unnecessary code and
    moving error handler methods to struct pcie_port_service_driver
    (Christoph Hellwig)

    - clean up error handling paths in various drivers (Bjorn Andersson,
    Fabio Estevam, Gustavo A. R. Silva, Harunobu Kurokawa, Jeffy Chen,
    Lorenzo Pieralisi, Sergei Shtylyov)

    - clean up SR-IOV resource handling by disabling VF decoding before
    updating the corresponding resource structs (Gavin Shan)

    - clean up DesignWare-based drivers by unifying quirks to update Class
    Code and Interrupt Pin and related handling of write-protected
    registers (Hou Zhiqiang)

    - clean up by adding empty generic pcibios_align_resource() and
    pcibios_fixup_bus() and removing empty arch-specific implementations
    (Palmer Dabbelt)

    - request exclusive reset control for several drivers to allow cleanup
    elsewhere (Philipp Zabel)

    - constify various structures (Arvind Yadav, Bhumika Goyal)

    - convert from full_name() to %pOF (Rob Herring)

    - remove unused variables from iProc, HiSi, Altera, Keystone (Shawn
    Lin)

    * tag 'pci-v4.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (170 commits)
    PCI: xgene: Clean up whitespace
    PCI: xgene: Define XGENE_PCI_EXP_CAP and use generic PCI_EXP_RTCTL offset
    PCI: xgene: Fix platform_get_irq() error handling
    PCI: xilinx-nwl: Fix platform_get_irq() error handling
    PCI: rockchip: Fix platform_get_irq() error handling
    PCI: altera: Fix platform_get_irq() error handling
    PCI: spear13xx: Fix platform_get_irq() error handling
    PCI: artpec6: Fix platform_get_irq() error handling
    PCI: armada8k: Fix platform_get_irq() error handling
    PCI: dra7xx: Fix platform_get_irq() error handling
    PCI: exynos: Fix platform_get_irq() error handling
    PCI: iproc: Clean up whitespace
    PCI: iproc: Rename PCI_EXP_CAP to IPROC_PCI_EXP_CAP
    PCI: iproc: Add 500ms delay during device shutdown
    PCI: Fix typos and whitespace errors
    PCI: Remove unused "res" variable from pci_resource_io()
    PCI: Correct kernel-doc of pci_vpd_srdt_size(), pci_vpd_srdt_tag()
    PCI/AER: Reformat AER register definitions
    iommu/vt-d: Prevent VMD child devices from being remapping targets
    x86/PCI: Use is_vmd() rather than relying on the domain number
    ...

    Linus Torvalds
     

08 Sep, 2017

1 commit


07 Sep, 2017

2 commits

  • Pull crypto updates from Herbert Xu:
    "Here is the crypto update for 4.14:

    API:
    - Defer scompress scratch buffer allocation to first use.
    - Add __crypto_xor that takes separte src and dst operands.
    - Add ahash multiple registration interface.
    - Revamped aead/skcipher algif code to fix async IO properly.

    Drivers:
    - Add non-SIMD fallback code path on ARM for SVE.
    - Add AMD Security Processor framework for ccp.
    - Add support for RSA in ccp.
    - Add XTS-AES-256 support for CCP version 5.
    - Add support for PRNG in sun4i-ss.
    - Add support for DPAA2 in caam.
    - Add ARTPEC crypto support.
    - Add Freescale RNGC hwrng support.
    - Add Microchip / Atmel ECC driver.
    - Add support for STM32 HASH module"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (116 commits)
    crypto: af_alg - get_page upon reassignment to TX SGL
    crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()'
    crypto: inside-secure - fix an error handling path in safexcel_probe()
    crypto: rockchip - Don't dequeue the request when device is busy
    crypto: cavium - add release_firmware to all return case
    crypto: sahara - constify platform_device_id
    MAINTAINERS: Add ARTPEC crypto maintainer
    crypto: axis - add ARTPEC-6/7 crypto accelerator driver
    crypto: hash - add crypto_(un)register_ahashes()
    dt-bindings: crypto: add ARTPEC crypto
    crypto: algif_aead - fix comment regarding memory layout
    crypto: ccp - use dma_mapping_error to check map error
    lib/mpi: fix build with clang
    crypto: sahara - Remove leftover from previous used spinlock
    crypto: sahara - Fix dma unmap direction
    crypto: af_alg - consolidation of duplicate code
    crypto: caam - Remove unused dentry members
    crypto: ccp - select CONFIG_CRYPTO_RSA
    crypto: ccp - avoid uninitialized variable warning
    crypto: serpent - improve __serpent_setkey with UBSAN
    ...

    Linus Torvalds
     
  • Pull networking updates from David Miller:

    1) Support ipv6 checksum offload in sunvnet driver, from Shannon
    Nelson.

    2) Move to RB-tree instead of custom AVL code in inetpeer, from Eric
    Dumazet.

    3) Allow generic XDP to work on virtual devices, from John Fastabend.

    4) Add bpf device maps and XDP_REDIRECT, which can be used to build
    arbitrary switching frameworks using XDP. From John Fastabend.

    5) Remove UFO offloads from the tree, gave us little other than bugs.

    6) Remove the IPSEC flow cache, from Florian Westphal.

    7) Support ipv6 route offload in mlxsw driver.

    8) Support VF representors in bnxt_en, from Sathya Perla.

    9) Add support for forward error correction modes to ethtool, from
    Vidya Sagar Ravipati.

    10) Add time filter for packet scheduler action dumping, from Jamal Hadi
    Salim.

    11) Extend the zerocopy sendmsg() used by virtio and tap to regular
    sockets via MSG_ZEROCOPY. From Willem de Bruijn.

    12) Significantly rework value tracking in the BPF verifier, from Edward
    Cree.

    13) Add new jump instructions to eBPF, from Daniel Borkmann.

    14) Rework rtnetlink plumbing so that operations can be run without
    taking the RTNL semaphore. From Florian Westphal.

    15) Support XDP in tap driver, from Jason Wang.

    16) Add 32-bit eBPF JIT for ARM, from Shubham Bansal.

    17) Add Huawei hinic ethernet driver.

    18) Allow to report MD5 keys in TCP inet_diag dumps, from Ivan
    Delalande.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1780 commits)
    i40e: point wb_desc at the nvm_wb_desc during i40e_read_nvm_aq
    i40e: avoid NVM acquire deadlock during NVM update
    drivers: net: xgene: Remove return statement from void function
    drivers: net: xgene: Configure tx/rx delay for ACPI
    drivers: net: xgene: Read tx/rx delay for ACPI
    rocker: fix kcalloc parameter order
    rds: Fix non-atomic operation on shared flag variable
    net: sched: don't use GFP_KERNEL under spin lock
    vhost_net: correctly check tx avail during rx busy polling
    net: mdio-mux: add mdio_mux parameter to mdio_mux_init()
    rxrpc: Make service connection lookup always check for retry
    net: stmmac: Delete dead code for MDIO registration
    gianfar: Fix Tx flow control deactivation
    cxgb4: Ignore MPS_TX_INT_CAUSE[Bubble] for T6
    cxgb4: Fix pause frame count in t4_get_port_stats
    cxgb4: fix memory leak
    tun: rename generic_xdp to skb_xdp
    tun: reserve extra headroom only when XDP is set
    net: dsa: bcm_sf2: Configure IMP port TC2QOS mapping
    net: dsa: bcm_sf2: Advertise number of egress queues
    ...

    Linus Torvalds
     

05 Sep, 2017

1 commit

  • Pull locking updates from Ingo Molnar:

    - Add 'cross-release' support to lockdep, which allows APIs like
    completions, where it's not the 'owner' who releases the lock, to be
    tracked. It's all activated automatically under
    CONFIG_PROVE_LOCKING=y.

    - Clean up (restructure) the x86 atomics op implementation to be more
    readable, in preparation of KASAN annotations. (Dmitry Vyukov)

    - Fix static keys (Paolo Bonzini)

    - Add killable versions of down_read() et al (Kirill Tkhai)

    - Rework and fix jump_label locking (Marc Zyngier, Paolo Bonzini)

    - Rework (and fix) tlb_flush_pending() barriers (Peter Zijlstra)

    - Remove smp_mb__before_spinlock() and convert its usages, introduce
    smp_mb__after_spinlock() (Peter Zijlstra)

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (56 commits)
    locking/lockdep/selftests: Fix mixed read-write ABBA tests
    sched/completion: Avoid unnecessary stack allocation for COMPLETION_INITIALIZER_ONSTACK()
    acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK() abuse
    locking/pvqspinlock: Relax cmpxchg's to improve performance on some architectures
    smp: Avoid using two cache lines for struct call_single_data
    locking/lockdep: Untangle xhlock history save/restore from task independence
    locking/refcounts, x86/asm: Disable CONFIG_ARCH_HAS_REFCOUNT for the time being
    futex: Remove duplicated code and fix undefined behaviour
    Documentation/locking/atomic: Finish the document...
    locking/lockdep: Fix workqueue crossrelease annotation
    workqueue/lockdep: 'Fix' flush_work() annotation
    locking/lockdep/selftests: Add mixed read-write ABBA tests
    mm, locking/barriers: Clarify tlb_flush_pending() barriers
    locking/lockdep: Make CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS truly non-interactive
    locking/lockdep: Explicitly initialize wq_barrier::done::map
    locking/lockdep: Rename CONFIG_LOCKDEP_COMPLETE to CONFIG_LOCKDEP_COMPLETIONS
    locking/lockdep: Reword title of LOCKDEP_CROSSRELEASE config
    locking/lockdep: Make CONFIG_LOCKDEP_CROSSRELEASE part of CONFIG_PROVE_LOCKING
    locking/refcounts, x86/asm: Implement fast refcount overflow protection
    locking/lockdep: Fix the rollback and overwrite detection logic in crossrelease
    ...

    Linus Torvalds
     

04 Sep, 2017

1 commit

  • Pull RCU updates from Ingo Molnad:
    "The main RCU related changes in this cycle were:

    - Removal of spin_unlock_wait()
    - SRCU updates
    - RCU torture-test updates
    - RCU Documentation updates
    - Extend the sys_membarrier() ABI with the MEMBARRIER_CMD_PRIVATE_EXPEDITED variant
    - Miscellaneous RCU fixes
    - CPU-hotplug fixes"

    * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (63 commits)
    arch: Remove spin_unlock_wait() arch-specific definitions
    locking: Remove spin_unlock_wait() generic definitions
    drivers/ata: Replace spin_unlock_wait() with lock/unlock pair
    ipc: Replace spin_unlock_wait() with lock/unlock pair
    exit: Replace spin_unlock_wait() with lock/unlock pair
    completion: Replace spin_unlock_wait() with lock/unlock pair
    doc: Set down RCU's scheduling-clock-interrupt needs
    doc: No longer allowed to use rcu_dereference on non-pointers
    doc: Add RCU files to docbook-generation files
    doc: Update memory-barriers.txt for read-to-write dependencies
    doc: Update RCU documentation
    membarrier: Provide expedited private command
    rcu: Remove exports from rcu_idle_exit() and rcu_idle_enter()
    rcu: Add warning to rcu_idle_enter() for irqs enabled
    rcu: Make rcu_idle_enter() rely on callers disabling irqs
    rcu: Add assertions verifying blocked-tasks list
    rcu/tracing: Set disable_rcu_irq_enter on rcu_eqs_exit()
    rcu: Add TPS() protection for _rcu_barrier_trace strings
    rcu: Use idle versions of swait to make idle-hack clear
    swait: Add idle variants which don't contribute to load average
    ...

    Linus Torvalds
     

29 Aug, 2017

2 commits


26 Aug, 2017

1 commit

  • There is code duplicated over all architecture's headers for
    futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr,
    and comparison of the result.

    Remove this duplication and leave up to the arches only the needed
    assembly which is now in arch_futex_atomic_op_inuser.

    This effectively distributes the Will Deacon's arm64 fix for undefined
    behaviour reported by UBSAN to all architectures. The fix was done in
    commit 5f16a046f8e1 (arm64: futex: Fix undefined behaviour with
    FUTEX_OP_OPARG_SHIFT usage). Look there for an example dump.

    And as suggested by Thomas, check for negative oparg too, because it was
    also reported to cause undefined behaviour report.

    Note that s390 removed access_ok check in d12a29703 ("s390/uaccess:
    remove pointless access_ok() checks") as access_ok there returns true.
    We introduce it back to the helper for the sake of simplicity (it gets
    optimized away anyway).

    Signed-off-by: Jiri Slaby
    Signed-off-by: Thomas Gleixner
    Acked-by: Russell King
    Acked-by: Michael Ellerman (powerpc)
    Acked-by: Heiko Carstens [s390]
    Acked-by: Chris Metcalf [for tile]
    Reviewed-by: Darren Hart (VMware)
    Reviewed-by: Will Deacon [core/arm64]
    Cc: linux-mips@linux-mips.org
    Cc: Rich Felker
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: peterz@infradead.org
    Cc: Benjamin Herrenschmidt
    Cc: Max Filippov
    Cc: Paul Mackerras
    Cc: sparclinux@vger.kernel.org
    Cc: Jonas Bonn
    Cc: linux-s390@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: Yoshinori Sato
    Cc: linux-hexagon@vger.kernel.org
    Cc: Helge Deller
    Cc: "James E.J. Bottomley"
    Cc: Catalin Marinas
    Cc: Matt Turner
    Cc: linux-snps-arc@lists.infradead.org
    Cc: Fenghua Yu
    Cc: Arnd Bergmann
    Cc: linux-xtensa@linux-xtensa.org
    Cc: Stefan Kristiansson
    Cc: openrisc@lists.librecores.org
    Cc: Ivan Kokshaysky
    Cc: Stafford Horne
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: Richard Henderson
    Cc: Chris Zankel
    Cc: Michal Simek
    Cc: Tony Luck
    Cc: linux-parisc@vger.kernel.org
    Cc: Vineet Gupta
    Cc: Ralf Baechle
    Cc: Richard Kuo
    Cc: linux-alpha@vger.kernel.org
    Cc: Martin Schwidefsky
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: "David S. Miller"
    Link: http://lkml.kernel.org/r/20170824073105.3901-1-jslaby@suse.cz

    Jiri Slaby
     

25 Aug, 2017

1 commit


22 Aug, 2017

2 commits

  • David S. Miller
     
  • When building the kernel for Sparc using gcc 7.x, the build fails
    with:

    arch/sparc/kernel/pcic.c: In function ‘pcibios_fixup_bus’:
    arch/sparc/kernel/pcic.c:647:8: error: ‘cmd’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    cmd |= PCI_COMMAND_IO;
    ^~

    The simplified code looks like this:

    unsigned int cmd;
    [...]
    pcic_read_config(dev->bus, dev->devfn, PCI_COMMAND, 2, &cmd);
    [...]
    cmd |= PCI_COMMAND_IO;

    I.e, the code assumes that pcic_read_config() will always initialize
    cmd. But it's not the case. Looking at pcic_read_config(), if
    bus->number is != 0 or if the size is not one of 1, 2 or 4, *val will
    not be initialized.

    As a simple fix, we initialize cmd to zero at the beginning of
    pcibios_fixup_bus.

    Signed-off-by: Thomas Petazzoni
    Signed-off-by: David S. Miller

    Thomas Petazzoni
     

21 Aug, 2017

1 commit