Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge v4.9.126 into 4.9-2.0.x-imx #34

Merged
merged 971 commits into from
Sep 12, 2018
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Aug 24, 2018

  1. dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()

    [ Upstream commit c4c2b76 ]
    
    The d->chans[] array has d->dma_requests elements so the > should be
    >= here.
    
    Fixes: 8e6152b ("dmaengine: Add hisilicon k3 DMA engine driver")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Dan Carpenter authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    87aea47 View commit details
    Browse the repository at this point in the history
  2. md/raid10: fix that replacement cannot complete recovery after reasse…

    …mble
    
    [ Upstream commit bda3153 ]
    
    During assemble, the spare marked for replacement is not checked.
    conf->fullsync cannot be updated to be 1. As a result, recovery will
    treat it as a clean array. All recovering sectors are skipped. Original
    device is replaced with the not-recovered spare.
    
    mdadm -C /dev/md0 -l10 -n4 -pn2 /dev/loop[0123]
    mdadm /dev/md0 -a /dev/loop4
    mdadm /dev/md0 --replace /dev/loop0
    mdadm -S /dev/md0 # stop array during recovery
    
    mdadm -A /dev/md0 /dev/loop[01234]
    
    After reassemble, you can see recovery go on, but it completes
    immediately. In fact, recovery is not actually processed.
    
    To solve this problem, we just add the missing logics for replacment
    spares. (In raid1.c or raid5.c, they have already been checked.)
    
    Reported-by: Alex Chen <alexchen@synology.com>
    Reviewed-by: Alex Wu <alexwu@synology.com>
    Reviewed-by: Chung-Chiang Cheng <cccheng@synology.com>
    Signed-off-by: BingJing Chang <bingjingc@synology.com>
    Signed-off-by: Shaohua Li <shli@fb.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    bingjingc authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    e303840 View commit details
    Browse the repository at this point in the history
  3. nl80211: relax ht operation checks for mesh

    [ Upstream commit 188f60a ]
    
    Commit 9757235, "nl80211: correct checks for
    NL80211_MESHCONF_HT_OPMODE value") relaxed the range for the HT
    operation field in meshconf, while also adding checks requiring
    the non-greenfield and non-ht-sta bits to be set in certain
    circumstances.  The latter bit is actually reserved for mesh BSSes
    according to Table 9-168 in 802.11-2016, so in fact it should not
    be set.
    
    wpa_supplicant sets these bits because the mesh and AP code share
    the same implementation, but authsae does not.  As a result, some
    meshconf updates from authsae which set only the NONHT_MIXED
    protection bits were being rejected.
    
    In order to avoid breaking userspace by changing the rules again,
    simply accept the values with or without the bits set, and mask
    off the reserved bit to match the spec.
    
    While in here, update the 802.11-2012 reference to 802.11-2016.
    
    Fixes: 9757235 ("nl80211: correct checks for NL80211_MESHCONF_HT_OPMODE value")
    Cc: Masashi Honma <masashi.honma@gmail.com>
    Signed-off-by: Bob Copeland <bobcopeland@fb.com>
    Reviewed-by: Masashi Honma <masashi.honma@gmail.com>
    Reviewed-by: Masashi Honma <masashi.honma@gmail.com>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    bcopeland authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    15a7879 View commit details
    Browse the repository at this point in the history
  4. drm/exynos: gsc: Fix support for NV16/61, YUV420/YVU420 and YUV422 modes

    [ Upstream commit dd209ef ]
    
    Fix following issues related to planar YUV pixel format configuration:
    - NV16/61 modes were incorrectly programmed as NV12/21,
    - YVU420 was programmed as YUV420 on source,
    - YVU420 and YUV422 were programmed as YUV420 on output.
    
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: Inki Dae <inki.dae@samsung.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mszyprow authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    f17bac0 View commit details
    Browse the repository at this point in the history
  5. drm/exynos: decon5433: Fix per-plane global alpha for XRGB modes

    [ Upstream commit ab337fc ]
    
    Set per-plane global alpha to maximum value to get proper blending of
    XRGB and ARGB planes. This fixes the strange order of overlapping planes.
    
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: Inki Dae <inki.dae@samsung.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mszyprow authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    29d33ed View commit details
    Browse the repository at this point in the history
  6. drm/exynos: decon5433: Fix WINCONx reset value

    [ Upstream commit 7b7aa62 ]
    
    The only bits that should be preserved in decon_win_set_fmt() is
    WINCONx_ENWIN_F. All other bits depends on the selected pixel formats and
    are set by the mentioned function.
    
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Signed-off-by: Inki Dae <inki.dae@samsung.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mszyprow authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    1db00de View commit details
    Browse the repository at this point in the history
  7. bpf, s390: fix potential memleak when later bpf_jit_prog fails

    [ Upstream commit f605ce5 ]
    
    If we would ever fail in the bpf_jit_prog() pass that writes the
    actual insns to the image after we got header via bpf_jit_binary_alloc()
    then we also need to make sure to free it through bpf_jit_binary_free()
    again when bailing out. Given we had prior bpf_jit_prog() passes to
    initially probe for clobbered registers, program size and to fill in
    addrs arrray for jump targets, this is more of a theoretical one,
    but at least make sure this doesn't break with future changes.
    
    Fixes: 0546231 ("s390/bpf: Add s390x eBPF JIT compiler backend")
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Acked-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    borkmann authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    36b0779 View commit details
    Browse the repository at this point in the history
  8. PCI: xilinx: Add missing of_node_put()

    [ Upstream commit 8c3f9bd ]
    
    The call to of_get_next_child() returns a node pointer with refcount
    incremented thus it must be explicitly decremented here after the last
    usage.
    
    Fixes: 8961def ("PCI: xilinx: Add Xilinx AXI PCIe Host Bridge IP driver")
    Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
    [lorenzo.pieralisi@arm.com: reworked commit log]
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Nicholas Mc Guire authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    b61fc97 View commit details
    Browse the repository at this point in the history
  9. PCI: xilinx-nwl: Add missing of_node_put()

    [ Upstream commit 342639d ]
    
    The call to of_get_next_child() returns a node pointer with
    refcount incremented thus it must be explicitly decremented
    here after the last usage.
    
    Fixes: ab597d3 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller")
    Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
    [lorenzo.pieralisi@arm.com: updated commit log]
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Nicholas Mc Guire authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    3b8eeae View commit details
    Browse the repository at this point in the history
  10. bnx2x: Fix receiving tx-timeout in error or recovery state.

    [ Upstream commit 484c016 ]
    
    Driver performs the internal reload when it receives tx-timeout event from
    the OS. Internal reload might fail in some scenarios e.g., fatal HW issues.
    In such cases OS still see the link, which would result in undesirable
    functionalities such as re-generation of tx-timeouts.
    The patch addresses this issue by indicating the link-down to OS when
    tx-timeout is detected, and keeping the link in down state till the
    internal reload is successful.
    
    Please consider applying it to 'net' branch.
    
    Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
    Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Sudarsana Reddy Kalluru authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    21fe14f View commit details
    Browse the repository at this point in the history
  11. acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value

    [ Upstream commit c1985ce ]
    
    cmd_rc is passed in by reference to the acpi_nfit_ctl() function and the
    caller expects a value returned. However, when the package is pass through
    via the ND_CMD_CALL command, cmd_rc is not touched. Make sure cmd_rc is
    always set.
    
    Fixes: aef2533 ("libnvdimm, nfit: centralize command status translation")
    
    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    davejiang authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    23458d7 View commit details
    Browse the repository at this point in the history
  12. m68k: fix "bad page state" oops on ColdFire boot

    [ Upstream commit ecd6053 ]
    
    Booting a ColdFire m68k core with MMU enabled causes a "bad page state"
    oops since commit 1d40a5e ("mm: mark pages in use for page tables"):
    
     BUG: Bad page state in process sh  pfn:01ce2
     page:004fefc8 count:0 mapcount:-1024 mapping:00000000 index:0x0
     flags: 0x0()
     raw: 00000000 00000000 00000000 fffffbff 00000000 00000100 00000200 00000000
     raw: 039c4000
     page dumped because: nonzero mapcount
     Modules linked in:
     CPU: 0 PID: 22 Comm: sh Not tainted 4.17.0-07461-g1d40a5ea01d5 Freescale#13
    
    Fix by calling pgtable_page_dtor() in our __pte_free_tlb() code path,
    so that the PG_table flag is cleared before we free the pte page.
    
    Note that I had to change the type of pte_free() to be static from
    extern. Otherwise you get a lot of warnings like this:
    
    ./arch/m68k/include/asm/mcf_pgalloc.h:80:2: warning: ‘pgtable_page_dtor’ is static but used in inline function ‘pte_free’ which is not static
      pgtable_page_dtor(page);
      ^
    
    And making it static is consistent with our use of this in the other
    m68k pgalloc definitions of pte_free().
    
    Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
    CC: Matthew Wilcox <willy@infradead.org>
    Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Greg Ungerer authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    b9ce3ce View commit details
    Browse the repository at this point in the history
  13. objtool: Support GCC 8 '-fnoreorder-functions'

    [ Upstream commit 08b393d ]
    
    Since the following commit:
    
      cd77849 ("objtool: Fix GCC 8 cold subfunction detection for aliased functions")
    
    ... if the kernel is built with EXTRA_CFLAGS='-fno-reorder-functions',
    objtool can get stuck in an infinite loop.
    
    That flag causes the new GCC 8 cold subfunctions to be placed in .text
    instead of .text.unlikely.  But it also has an unfortunate quirk: in the
    symbol table, the subfunction (e.g., nmi_panic.cold.7) is nested inside
    the parent (nmi_panic).
    
    That function overlap confuses objtool, and causes it to get into an
    infinite loop in next_insn_same_func().  Here's Allan's description of
    the loop:
    
      "Objtool iterates through the instructions in nmi_panic using
      next_insn_same_func. Once it reaches the end of nmi_panic at 0x534 it
      jumps to 0x528 as that's the start of nmi_panic.cold.7. However, since
      the instructions starting at 0x528 are still associated with nmi_panic
      objtool will get stuck in a loop, continually jumping back to 0x528
      after reaching 0x534."
    
    Fix it by shortening the length of the parent function so that the
    functions no longer overlap.
    
    Reported-and-analyzed-by: Allan Xavier <allan.x.xavier@oracle.com>
    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Cc: Allan Xavier <allan.x.xavier@oracle.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Brian Gerst <brgerst@gmail.com>
    Cc: Denys Vlasenko <dvlasenk@redhat.com>
    Cc: H. Peter Anvin <hpa@zytor.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Link: http://lkml.kernel.org/r/9e704c52bee651129b036be14feda317ae5606ae.1530136978.git.jpoimboe@redhat.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jpoimboe authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    ce94ead View commit details
    Browse the repository at this point in the history
  14. ipvlan: call dev_change_flags when ipvlan mode is reset

    [ Upstream commit 5dc2d39 ]
    
    After we change the ipvlan mode from l3 to l2, or vice versa, we only
    reset IFF_NOARP flag, but don't flush the ARP table cache, which will
    cause eth->h_dest to be equal to eth->h_source in ipvlan_xmit_mode_l2().
    Then the message will not come out of host.
    
    Here is the reproducer on local host:
    
    ip link set eth1 up
    ip addr add 192.168.1.1/24 dev eth1
    ip link add link eth1 ipvlan1 type ipvlan mode l3
    
    ip netns add net1
    ip link set ipvlan1 netns net1
    ip netns exec net1 ip link set ipvlan1 up
    ip netns exec net1 ip addr add 192.168.2.1/24 dev ipvlan1
    
    ip route add 192.168.2.0/24 via 192.168.1.2
    ping 192.168.2.2 -c 2
    
    ip netns exec net1 ip link set ipvlan1 type ipvlan mode l2
    ping 192.168.2.2 -c 2
    
    Add the same configuration on remote host. After we set the mode to l2,
    we could find that the src/dst MAC addresses are the same on eth1:
    
    21:26:06.648565 00:b7:13:ad:d3:05 > 00:b7:13:ad:d3:05, ethertype IPv4 (0x0800), length 98: (tos 0x0, ttl 64, id 58356, offset 0, flags [DF], proto ICMP (1), length 84)
        192.168.2.1 > 192.168.2.2: ICMP echo request, id 22686, seq 1, length 64
    
    Fix this by calling dev_change_flags(), which will call netdevice notifier
    with flag change info.
    
    v2:
    a) As pointed out by Wang Cong, check return value for dev_change_flags() when
    change dev flags.
    b) As suggested by Stefano and Sabrina, move flags setting before l3mdev_ops.
    So we don't need to redo ipvlan_{, un}register_nf_hook() again in err path.
    
    Reported-by: Jianlin Shi <jishi@redhat.com>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
    Fixes: 2ad7bf3 ("ipvlan: Initial check-in of the IPVLAN driver.")
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    liuhangbin authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    377c72c View commit details
    Browse the repository at this point in the history
  15. HID: wacom: Correct touch maximum XY of 2nd-gen Intuos

    [ Upstream commit 3b8d573 ]
    
    The touch sensors on the 2nd-gen Intuos tablets don't use a 4096x4096
    sensor like other similar tablets (3rd-gen Bamboo, Intuos5, etc.).
    The incorrect maximum XY values don't normally affect userspace since
    touch input from these devices is typically relative rather than
    absolute. It does, however, cause problems when absolute distances
    need to be measured, e.g. for gesture recognition. Since the resolution
    of the touch sensor on these devices is 10 units / mm (versus 100 for
    the pen sensor), the proper maximum values can be calculated by simply
    dividing by 10.
    
    Fixes: b5fd2a3 ("Input: wacom - add support for three new Intuos devices")
    Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jigpu authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    53a93eb View commit details
    Browse the repository at this point in the history
  16. ARM: imx_v6_v7_defconfig: Select ULPI support

    [ Upstream commit 157bcc0 ]
    
    Select CONFIG_USB_CHIPIDEA_ULPI and CONFIG_USB_ULPI_BUS so that
    USB ULPI can be functional on some boards like imx51-babbge.
    
    This fixes a kernel hang in 4.18-rc1 on i.mx51-babbage, caused by commit
    03e6275 ("usb: chipidea: Fix ULPI on imx51").
    
    Suggested-by: Andrey Smirnov <andrew.smirnov@gmail.com>
    Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Fabio Estevam authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    7214761 View commit details
    Browse the repository at this point in the history
  17. ARM: imx_v4_v5_defconfig: Select ULPI support

    [ Upstream commit 2ceb278 ]
    
    Select CONFIG_USB_CHIPIDEA_ULPI and CONFIG_USB_ULPI_BUS so that
    USB ULPI can be functional on some boards like that use ULPI
    interface.
    
    Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
    Signed-off-by: Shawn Guo <shawnguo@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Fabio Estevam authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    eaccc6f View commit details
    Browse the repository at this point in the history
  18. tracing: Use __printf markup to silence compiler

    [ Upstream commit 26b68dd ]
    
    Silence warnings (triggered at W=1) by adding relevant __printf attributes.
    
      CC      kernel/trace/trace.o
    kernel/trace/trace.c: In function ‘__trace_array_vprintk’:
    kernel/trace/trace.c:2979:2: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
      len = vscnprintf(tbuffer, TRACE_BUF_SIZE, fmt, args);
      ^~~
      AR      kernel/trace/built-in.o
    
    Link: http://lkml.kernel.org/r/20180308205843.27447-1-malat@debian.org
    
    Signed-off-by: Mathieu Malaterre <malat@debian.org>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    malaterre authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    bca139f View commit details
    Browse the repository at this point in the history
  19. kasan: fix shadow_size calculation error in kasan_module_alloc

    [ Upstream commit 1e8e18f ]
    
    There is a special case that the size is "(N << KASAN_SHADOW_SCALE_SHIFT)
    Pages plus X", the value of X is [1, KASAN_SHADOW_SCALE_SIZE-1].  The
    operation "size >> KASAN_SHADOW_SCALE_SHIFT" will drop X, and the
    roundup operation can not retrieve the missed one page.  For example:
    size=0x28006, PAGE_SIZE=0x1000, KASAN_SHADOW_SCALE_SHIFT=3, we will get
    shadow_size=0x5000, but actually we need 6 pages.
    
      shadow_size = round_up(size >> KASAN_SHADOW_SCALE_SHIFT, PAGE_SIZE);
    
    This can lead to a kernel crash when kasan is enabled and the value of
    mod->core_layout.size or mod->init_layout.size is like above.  Because
    the shadow memory of X has not been allocated and mapped.
    
    move_module:
      ptr = module_alloc(mod->core_layout.size);
      ...
      memset(ptr, 0, mod->core_layout.size);		//crashed
    
      Unable to handle kernel paging request at virtual address ffff0fffff97b000
      ......
      Call trace:
        __asan_storeN+0x174/0x1a8
        memset+0x24/0x48
        layout_and_allocate+0xcd8/0x1800
        load_module+0x190/0x23e8
        SyS_finit_module+0x148/0x180
    
    Link: http://lkml.kernel.org/r/1529659626-12660-1-git-send-email-thunder.leizhen@huawei.com
    Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
    Reviewed-by: Dmitriy Vyukov <dvyukov@google.com>
    Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
    Cc: Alexander Potapenko <glider@google.com>
    Cc: Hanjun Guo <guohanjun@huawei.com>
    Cc: Libin <huawei.libin@huawei.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Zhen Lei authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    2b7f885 View commit details
    Browse the repository at this point in the history
  20. smsc75xx: Add workaround for gigabit link up hardware errata.

    [ Upstream commit d461e3d ]
    
    In certain conditions, the device may not be able to link in gigabit mode. This software workaround ensures that the device will not enter the failure state.
    
    Fixes: d0cad87 ("SMSC75XX USB 2.0 Gigabit Ethernet Devices")
    Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    microchip1 authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    667f036 View commit details
    Browse the repository at this point in the history
  21. samples/bpf: add missing <linux/if_vlan.h>

    [ Upstream commit 4d5d33a ]
    
    This fixes build error regarding redefinition:
    
        CLANG-bpf  samples/bpf/parse_varlen.o
      samples/bpf/parse_varlen.c:111:8: error: redefinition of 'vlan_hdr'
      struct vlan_hdr {
             ^
      ./include/linux/if_vlan.h:38:8: note: previous definition is here
    
    So remove duplicate 'struct vlan_hdr' in sample code and include if_vlan.h
    
    Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
    Acked-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Taeung authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    f4bc80f View commit details
    Browse the repository at this point in the history
  22. samples/bpf: Check the error of write() and read()

    [ Upstream commit 02a2f00 ]
    
    test_task_rename() and test_urandom_read()
    can be failed during write() and read(),
    So check the result of them.
    
    Reviewed-by: David Laight <David.Laight@ACULAB.COM>
    Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
    Acked-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Taeung authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    fbfd753 View commit details
    Browse the repository at this point in the history
  23. ieee802154: 6lowpan: set IFLA_LINK

    [ Upstream commit b30c122 ]
    
    Otherwise NetworkManager (and iproute alike) is not able to identify the
    parent IEEE 802.15.4 interface of a 6LoWPAN link.
    
    Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
    Acked-by: Alexander Aring <aring@mojatatu.com>
    Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lkundrak authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    1c7e225 View commit details
    Browse the repository at this point in the history
  24. netfilter: x_tables: set module owner for icmp(6) matches

    [ Upstream commit d376bef ]
    
    nft_compat relies on xt_request_find_match to increment
    refcount of the module that provides the match/target.
    
    The (builtin) icmp matches did't set the module owner so it
    was possible to rmmod ip(6)tables while icmp extensions were still in use.
    
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Florian Westphal authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    894b753 View commit details
    Browse the repository at this point in the history
  25. ipv6: make ipv6_renew_options() interrupt/kernel safe

    [ Upstream commit a9ba23d ]
    
    At present the ipv6_renew_options_kern() function ends up calling into
    access_ok() which is problematic if done from inside an interrupt as
    access_ok() calls WARN_ON_IN_IRQ() on some (all?) architectures
    (x86-64 is affected).  Example warning/backtrace is shown below:
    
     WARNING: CPU: 1 PID: 3144 at lib/usercopy.c:11 _copy_from_user+0x85/0x90
     ...
     Call Trace:
      <IRQ>
      ipv6_renew_option+0xb2/0xf0
      ipv6_renew_options+0x26a/0x340
      ipv6_renew_options_kern+0x2c/0x40
      calipso_req_setattr+0x72/0xe0
      netlbl_req_setattr+0x126/0x1b0
      selinux_netlbl_inet_conn_request+0x80/0x100
      selinux_inet_conn_request+0x6d/0xb0
      security_inet_conn_request+0x32/0x50
      tcp_conn_request+0x35f/0xe00
      ? __lock_acquire+0x250/0x16c0
      ? selinux_socket_sock_rcv_skb+0x1ae/0x210
      ? tcp_rcv_state_process+0x289/0x106b
      tcp_rcv_state_process+0x289/0x106b
      ? tcp_v6_do_rcv+0x1a7/0x3c0
      tcp_v6_do_rcv+0x1a7/0x3c0
      tcp_v6_rcv+0xc82/0xcf0
      ip6_input_finish+0x10d/0x690
      ip6_input+0x45/0x1e0
      ? ip6_rcv_finish+0x1d0/0x1d0
      ipv6_rcv+0x32b/0x880
      ? ip6_make_skb+0x1e0/0x1e0
      __netif_receive_skb_core+0x6f2/0xdf0
      ? process_backlog+0x85/0x250
      ? process_backlog+0x85/0x250
      ? process_backlog+0xec/0x250
      process_backlog+0xec/0x250
      net_rx_action+0x153/0x480
      __do_softirq+0xd9/0x4f7
      do_softirq_own_stack+0x2a/0x40
      </IRQ>
      ...
    
    While not present in the backtrace, ipv6_renew_option() ends up calling
    access_ok() via the following chain:
    
      access_ok()
      _copy_from_user()
      copy_from_user()
      ipv6_renew_option()
    
    The fix presented in this patch is to perform the userspace copy
    earlier in the call chain such that it is only called when the option
    data is actually coming from userspace; that place is
    do_ipv6_setsockopt().  Not only does this solve the problem seen in
    the backtrace above, it also allows us to simplify the code quite a
    bit by removing ipv6_renew_options_kern() completely.  We also take
    this opportunity to cleanup ipv6_renew_options()/ipv6_renew_option()
    a small amount as well.
    
    This patch is heavily based on a rough patch by Al Viro.  I've taken
    his original patch, converted a kmemdup() call in do_ipv6_setsockopt()
    to a memdup_user() call, made better use of the e_inval jump target in
    the same function, and cleaned up the use ipv6_renew_option() by
    ipv6_renew_options().
    
    CC: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Paul Moore <paul@paul-moore.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    pcmoore authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    8823c73 View commit details
    Browse the repository at this point in the history
  26. net: qrtr: Broadcast messages only from control port

    [ Upstream commit fdf5fd3 ]
    
    The broadcast node id should only be sent with the control port id.
    
    Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Arun Kumar Neelakantam authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    865c4f9 View commit details
    Browse the repository at this point in the history
  27. sh_eth: fix invalid context bug while calling auto-negotiation by eth…

    …tool
    
    [ Upstream commit 53a710b ]
    
    Since commit 35b5f6b ("PHYLIB: Locking fixes for PHY I/O
    potentially sleeping") phy_start_aneg() function utilizes a mutex
    to serialize changes to phy state, however the helper function is
    called in atomic context.
    
    The bug can be reproduced by running "ethtool -r" command, the bug
    is reported if CONFIG_DEBUG_ATOMIC_SLEEP build option is enabled.
    
    Fixes: dc19e4e ("sh: sh_eth: Add support ethtool")
    Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
    Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Vladimir Zapolskiy authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    e90f9f5 View commit details
    Browse the repository at this point in the history
  28. sh_eth: fix invalid context bug while changing link options by ethtool

    [ Upstream commit 5cb3f52 ]
    
    The change fixes sleep in atomic context bug, which is encountered
    every time when link settings are changed by ethtool.
    
    Since commit 35b5f6b ("PHYLIB: Locking fixes for PHY I/O
    potentially sleeping") phy_start_aneg() function utilizes a mutex
    to serialize changes to phy state, however that helper function is
    called in atomic context under a grabbed spinlock, because
    phy_start_aneg() is called by phy_ethtool_ksettings_set() and by
    replaced phy_ethtool_sset() helpers from phylib.
    
    Now duplex mode setting is enforced in sh_eth_adjust_link() only,
    also now RX/TX is disabled when link is put down or modifications
    to E-MAC registers ECMR and GECMR are expected for both cases of
    checked and ignored link status pin state from E-MAC interrupt handler.
    
    For reference the change is a partial rework of commit 1e1b812
    ("sh_eth: fix handling of no LINK signal").
    
    Fixes: dc19e4e ("sh: sh_eth: Add support ethtool")
    Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
    Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Vladimir Zapolskiy authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    c5c80ef View commit details
    Browse the repository at this point in the history
  29. ravb: fix invalid context bug while calling auto-negotiation by ethtool

    [ Upstream commit 0973a4d ]
    
    Since commit 35b5f6b ("PHYLIB: Locking fixes for PHY I/O
    potentially sleeping") phy_start_aneg() function utilizes a mutex
    to serialize changes to phy state, however the helper function is
    called in atomic context.
    
    The bug can be reproduced by running "ethtool -r" command, the bug
    is reported if CONFIG_DEBUG_ATOMIC_SLEEP build option is enabled.
    
    Fixes: c156633 ("Renesas Ethernet AVB driver proper")
    Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
    Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Vladimir Zapolskiy authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    354077c View commit details
    Browse the repository at this point in the history
  30. ravb: fix invalid context bug while changing link options by ethtool

    [ Upstream commit 05925e5 ]
    
    The change fixes sleep in atomic context bug, which is encountered
    every time when link settings are changed by ethtool.
    
    Since commit 35b5f6b ("PHYLIB: Locking fixes for PHY I/O
    potentially sleeping") phy_start_aneg() function utilizes a mutex
    to serialize changes to phy state, however that helper function is
    called in atomic context under a grabbed spinlock, because
    phy_start_aneg() is called by phy_ethtool_ksettings_set() and by
    replaced phy_ethtool_sset() helpers from phylib.
    
    Now duplex mode setting is enforced in ravb_adjust_link() only, also
    now RX/TX is disabled when link is put down or modifications to E-MAC
    registers ECMR and GECMR are expected for both cases of checked and
    ignored link status pin state from E-MAC interrupt handler.
    
    Fixes: c156633 ("Renesas Ethernet AVB driver proper")
    Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
    Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Vladimir Zapolskiy authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    fb96d97 View commit details
    Browse the repository at this point in the history
  31. ARM: pxa: irq: fix handling of ICMR registers in suspend/resume

    [ Upstream commit 0c1049d ]
    
    PXA3xx platforms have 56 interrupts that are stored in two ICMR
    registers. The code in pxa_irq_suspend() and pxa_irq_resume() however
    does a simple division by 32 which only leads to one register being
    saved at suspend and restored at resume time. The NAND interrupt
    setting, for instance, is lost.
    
    Fix this by using DIV_ROUND_UP() instead.
    
    Signed-off-by: Daniel Mack <daniel@zonque.org>
    Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    zonque authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    ecbef3e View commit details
    Browse the repository at this point in the history
  32. net/sched: act_tunnel_key: fix NULL dereference when 'goto chain' is …

    …used
    
    [ Upstream commit 38230a3 ]
    
    the control action in the common member of struct tcf_tunnel_key must be a
    valid value, as it can contain the chain index when 'goto chain' is used.
    Ensure that the control action can be read as x->tcfa_action, when x is a
    pointer to struct tc_action and x->ops->type is TCA_ACT_TUNNEL_KEY, to
    prevent the following command:
    
     # tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
     > $tcflags dst_mac $h2mac action tunnel_key unset goto chain 1
    
    from causing a NULL dereference when a matching packet is received:
    
     BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
     PGD 80000001097ac067 P4D 80000001097ac067 PUD 103b0a067 PMD 0
     Oops: 0000 [Freescale#1] SMP PTI
     CPU: 0 PID: 3491 Comm: mausezahn Tainted: G            E     4.18.0-rc2.auguri+ Freescale#421
     Hardware name: Hewlett-Packard HP Z220 CMT Workstation/1790, BIOS K51 v01.58 02/07/2013
     RIP: 0010:tcf_action_exec+0xb8/0x100
     Code: 00 00 00 20 74 1d 83 f8 03 75 09 49 83 c4 08 4d 39 ec 75 bc 48 83 c4 10 5b 5d 41 5c 41 5d 41 5e 41 5f c3 49 8b 97 a8 00 00 00 <48> 8b 12 48 89 55 00 48 83 c4 10 5b 5d 41 5c 41 5d 41 5e 41 5f c3
     RSP: 0018:ffff95145ea03c40 EFLAGS: 00010246
     RAX: 0000000020000001 RBX: ffff9514499e5800 RCX: 0000000000000001
     RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000
     RBP: ffff95145ea03e60 R08: 0000000000000000 R09: ffff95145ea03c9c
     R10: ffff95145ea03c78 R11: 0000000000000008 R12: ffff951456a69800
     R13: ffff951456a69808 R14: 0000000000000001 R15: ffff95144965ee40
     FS:  00007fd67ee11740(0000) GS:ffff95145ea00000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 0000000000000000 CR3: 00000001038a2006 CR4: 00000000001606f0
     Call Trace:
      <IRQ>
      fl_classify+0x1ad/0x1c0 [cls_flower]
      ? __update_load_avg_se.isra.47+0x1ca/0x1d0
      ? __update_load_avg_se.isra.47+0x1ca/0x1d0
      ? update_load_avg+0x665/0x690
      ? update_load_avg+0x665/0x690
      ? kmem_cache_alloc+0x38/0x1c0
      tcf_classify+0x89/0x140
      __netif_receive_skb_core+0x5ea/0xb70
      ? enqueue_entity+0xd0/0x270
      ? process_backlog+0x97/0x150
      process_backlog+0x97/0x150
      net_rx_action+0x14b/0x3e0
      __do_softirq+0xde/0x2b4
      do_softirq_own_stack+0x2a/0x40
      </IRQ>
      do_softirq.part.18+0x49/0x50
      __local_bh_enable_ip+0x49/0x50
      __dev_queue_xmit+0x4ab/0x8a0
      ? wait_woken+0x80/0x80
      ? packet_sendmsg+0x38f/0x810
      ? __dev_queue_xmit+0x8a0/0x8a0
      packet_sendmsg+0x38f/0x810
      sock_sendmsg+0x36/0x40
      __sys_sendto+0x10e/0x140
      ? do_vfs_ioctl+0xa4/0x630
      ? syscall_trace_enter+0x1df/0x2e0
      ? __audit_syscall_exit+0x22a/0x290
      __x64_sys_sendto+0x24/0x30
      do_syscall_64+0x5b/0x180
      entry_SYSCALL_64_after_hwframe+0x44/0xa9
     RIP: 0033:0x7fd67e18dc93
     Code: 48 8b 0d 18 83 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 59 c7 20 00 00 75 13 49 89 ca b8 2c 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 34 c3 48 83 ec 08 e8 2b f7 ff ff 48 89 04 24
     RSP: 002b:00007ffe0189b748 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
     RAX: ffffffffffffffda RBX: 00000000020ca010 RCX: 00007fd67e18dc93
     RDX: 0000000000000062 RSI: 00000000020ca322 RDI: 0000000000000003
     RBP: 00007ffe0189b780 R08: 00007ffe0189b760 R09: 0000000000000014
     R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000062
     R13: 00000000020ca322 R14: 00007ffe0189b760 R15: 0000000000000003
     Modules linked in: act_tunnel_key act_gact cls_flower sch_ingress vrf veth act_csum(E) xt_CHECKSUM iptable_mangle ipt_MASQUERADE iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT nf_reject_ipv4 tun bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter intel_rapl snd_hda_codec_hdmi x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_realtek coretemp snd_hda_codec_generic kvm_intel kvm irqbypass snd_hda_intel crct10dif_pclmul crc32_pclmul hp_wmi ghash_clmulni_intel pcbc snd_hda_codec aesni_intel sparse_keymap rfkill snd_hda_core snd_hwdep snd_seq crypto_simd iTCO_wdt gpio_ich iTCO_vendor_support wmi_bmof cryptd mei_wdt glue_helper snd_seq_device snd_pcm pcspkr snd_timer snd i2c_i801 lpc_ich sg soundcore wmi mei_me
      mei ie31200_edac nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sd_mod sr_mod cdrom i915 video i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ahci crc32c_intel libahci serio_raw sfc libata mtd drm ixgbe mdio i2c_core e1000e dca
     CR2: 0000000000000000
     ---[ end trace 1ab8b5b5d4639dfc ]---
     RIP: 0010:tcf_action_exec+0xb8/0x100
     Code: 00 00 00 20 74 1d 83 f8 03 75 09 49 83 c4 08 4d 39 ec 75 bc 48 83 c4 10 5b 5d 41 5c 41 5d 41 5e 41 5f c3 49 8b 97 a8 00 00 00 <48> 8b 12 48 89 55 00 48 83 c4 10 5b 5d 41 5c 41 5d 41 5e 41 5f c3
     RSP: 0018:ffff95145ea03c40 EFLAGS: 00010246
     RAX: 0000000020000001 RBX: ffff9514499e5800 RCX: 0000000000000001
     RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000
     RBP: ffff95145ea03e60 R08: 0000000000000000 R09: ffff95145ea03c9c
     R10: ffff95145ea03c78 R11: 0000000000000008 R12: ffff951456a69800
     R13: ffff951456a69808 R14: 0000000000000001 R15: ffff95144965ee40
     FS:  00007fd67ee11740(0000) GS:ffff95145ea00000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 0000000000000000 CR3: 00000001038a2006 CR4: 00000000001606f0
     Kernel panic - not syncing: Fatal exception in interrupt
     Kernel Offset: 0x11400000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
     ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
    
    Fixes: d0f6dd8 ("net/sched: Introduce act_tunnel_key")
    Signed-off-by: Davide Caratti <dcaratti@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    dcaratti authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    7754ed7 View commit details
    Browse the repository at this point in the history
  33. ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem

    [ Upstream commit 20f3304 ]
    
    The check is valid but it does not warrant to crash the kernel. A
    WARN_ON() is good enough here.
    Found by checkpatch.
    
    Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stefan-Schmidt authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    afb72ef View commit details
    Browse the repository at this point in the history
  34. ieee802154: at86rf230: use __func__ macro for debug messages

    [ Upstream commit 8a81388 ]
    
    Instead of having the function name hard-coded (it might change and we
    forgot to update them in the debug output) we can use __func__ instead
    and also shorter the line so we do not need to break it. Also fix an
    extra blank line while being here.
    Found by checkpatch.
    
    Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stefan-Schmidt authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    7a389e0 View commit details
    Browse the repository at this point in the history
  35. ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem

    [ Upstream commit 8f2fbc6 ]
    
    The check is valid but it does not warrant to crash the kernel. A
    WARN_ON() is good enough here.
    Found by checkpatch.
    
    Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stefan-Schmidt authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    f8b8e02 View commit details
    Browse the repository at this point in the history
  36. drm/armada: fix colorkey mode property

    [ Upstream commit d378859 ]
    
    The colorkey mode property was not correctly disabling the colorkeying
    when "disabled" mode was selected.  Arrange for this to work as one
    would expect.
    
    Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Russell King authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    b968343 View commit details
    Browse the repository at this point in the history
  37. netfilter: nf_conntrack: Fix possible possible crash on module loading.

    [ Upstream commit 2045cdf ]
    
    Loading the nf_conntrack module with doubled hashsize parameter, i.e.
    	  modprobe nf_conntrack hashsize=12345 hashsize=12345
    causes NULL-ptr deref.
    
    If 'hashsize' specified twice, the nf_conntrack_set_hashsize() function
    will be called also twice.
    The first nf_conntrack_set_hashsize() call will set the
    'nf_conntrack_htable_size' variable:
    
    	nf_conntrack_set_hashsize()
    		...
    		/* On boot, we can set this without any fancy locking. */
    		if (!nf_conntrack_htable_size)
    			return param_set_uint(val, kp);
    
    But on the second invocation, the nf_conntrack_htable_size is already set,
    so the nf_conntrack_set_hashsize() will take a different path and call
    the nf_conntrack_hash_resize() function. Which will crash on the attempt
    to dereference 'nf_conntrack_hash' pointer:
    
    	BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
    	RIP: 0010:nf_conntrack_hash_resize+0x255/0x490 [nf_conntrack]
    	Call Trace:
    	 nf_conntrack_set_hashsize+0xcd/0x100 [nf_conntrack]
    	 parse_args+0x1f9/0x5a0
    	 load_module+0x1281/0x1a50
    	 __se_sys_finit_module+0xbe/0xf0
    	 do_syscall_64+0x7c/0x390
    	 entry_SYSCALL_64_after_hwframe+0x49/0xbe
    
    Fix this, by checking !nf_conntrack_hash instead of
    !nf_conntrack_htable_size. nf_conntrack_hash will be initialized only
    after the module loaded, so the second invocation of the
    nf_conntrack_set_hashsize() won't crash, it will just reinitialize
    nf_conntrack_htable_size again.
    
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aryabinin authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    d8a77d1 View commit details
    Browse the repository at this point in the history
  38. ARC: Improve cmpxchg syscall implementation

    [ Upstream commit e870878 ]
    
    This is used in configs lacking hardware atomics to emulate atomic r-m-w
    for user space, implemented by disabling preemption in kernel.
    
    However there are issues in current implementation:
    
    1. Process not terminated if invalid user pointer passed:
       i.e. __get_user() failed.
    
    2. The reason for this patch was __put_user() failure not being handled
       either, specifically for the COW break scenario.
       The zero page is initially wired up and read from __get_user()
       succeeds. A subsequent write by __put_user() induces a
       Protection Violation, but COW can't finish as Linux page fault
       handler is disabled due to preempt disable.
       And what's worse is we silently return the stale value to user space.
       Fix this specific case by re-enabling preemption and explicitly
       fixing up the fault and retrying the whole sequence over.
    
    Cc: Max Filippov <jcmvbkbc@gmail.com>
    Cc: linux-arch@vger.kernel.org
    Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
    Signed-off-by: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    [vgupta: rewrote the changelog]
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Peter Zijlstra authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    6cfe79d View commit details
    Browse the repository at this point in the history
  39. bnxt_en: Always set output parameters in bnxt_get_max_rings().

    [ Upstream commit 78f058a ]
    
    The current code returns -ENOMEM and does not bother to set the output
    parameters to 0 when no rings are available.  Some callers, such as
    bnxt_get_channels() will display garbage ring numbers when that happens.
    Fix it by always setting the output parameters.
    
    Fixes: 6e6c5a5 ("bnxt_en: Modify bnxt_get_max_rings() to support shared or non shared rings.")
    Signed-off-by: Michael Chan <michael.chan@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Michael Chan authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    f4a1792 View commit details
    Browse the repository at this point in the history
  40. bnxt_en: Fix for system hang if request_irq fails

    [ Upstream commit c58387a ]
    
    Fix bug in the error code path when bnxt_request_irq() returns failure.
    bnxt_disable_napi() should not be called in this error path because
    NAPI has not been enabled yet.
    
    Fixes: c0c050c ("bnxt_en: New Broadcom ethernet driver.")
    Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
    Signed-off-by: Michael Chan <michael.chan@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    vikasbrcm authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    0bf550c View commit details
    Browse the repository at this point in the history
  41. perf llvm-utils: Remove bashism from kernel include fetch script

    [ Upstream commit f6432b9 ]
    
    Like system(), popen() calls /bin/sh, which may/may not be bash.
    
    Script when run on dash and encounters the line, yields:
    
     exit: Illegal number: -1
    
    checkbashisms report on script content:
    
     possible bashism (exit|return with negative status code):
     exit -1
    
    Remove the bashism and use the more portable non-zero failure
    status code 1.
    
    Signed-off-by: Kim Phillips <kim.phillips@arm.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Michael Petlan <mpetlan@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
    Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
    Link: http://lkml.kernel.org/r/20180629124652.8d0af7e2281fd3fd8262cacc@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    kim-phillips-arm authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    b81825b View commit details
    Browse the repository at this point in the history
  42. nfit: fix unchecked dereference in acpi_nfit_ctl

    [ Upstream commit ee6581c ]
    
    Incremental patch to fix the unchecked dereference in acpi_nfit_ctl.
    Reported by Dan Carpenter:
    
    "acpi/nfit: fix cmd_rc for acpi_nfit_ctl to
    always return a value" from Jun 28, 2018, leads to the following
    Smatch complaint:
    
        drivers/acpi/nfit/core.c:578 acpi_nfit_ctl()
         warn: variable dereferenced before check 'cmd_rc' (see line 411)
    
    drivers/acpi/nfit/core.c
       410
       411		*cmd_rc = -EINVAL;
                    ^^^^^^^^^^^^^^^^^^
    Patch adds unchecked dereference.
    
    Fixes: c1985ce ("acpi/nfit: fix cmd_rc for acpi_nfit_ctl to always return a value")
    
    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    davejiang authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    8e4449f View commit details
    Browse the repository at this point in the history
  43. RDMA/mlx5: Fix memory leak in mlx5_ib_create_srq() error path

    [ Upstream commit d63c467 ]
    
    Fix memory leak in the error path of mlx5_ib_create_srq() by making sure
    to free the allocated srq.
    
    Fixes: c2b37f7 ("IB/mlx5: Fix integer overflows in mlx5_ib_create_srq")
    Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
    Acked-by: Leon Romanovsky <leonro@mellanox.com>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Kamalheib authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    199b59a View commit details
    Browse the repository at this point in the history
  44. ARM: 8780/1: ftrace: Only set kernel memory back to read-only after boot

    [ Upstream commit b4c7e2b ]
    
    Dynamic ftrace requires modifying the code segments that are usually
    set to read-only. To do this, a per arch function is called both before
    and after the ftrace modifications are performed. The "before" function
    will set kernel code text to read-write to allow for ftrace to make the
    modifications, and the "after" function will set the kernel code text
    back to "read-only" to keep the kernel code text protected.
    
    The issue happens when dynamic ftrace is tested at boot up. The test is
    done before the kernel code text has been set to read-only. But the
    "before" and "after" calls are still performed. The "after" call will
    change the kernel code text to read-only prematurely, and other boot
    code that expects this code to be read-write will fail.
    
    The solution is to add a variable that is set when the kernel code text
    is expected to be converted to read-only, and make the ftrace "before"
    and "after" calls do nothing if that variable is not yet set. This is
    similar to the x86 solution from commit 1623963 ("ftrace, x86:
    make kernel text writable only for conversions").
    
    Link: http://lkml.kernel.org/r/20180620212906.24b7b66e@vmware.local.home
    
    Reported-by: Stefan Agner <stefan@agner.ch>
    Tested-by: Stefan Agner <stefan@agner.ch>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rostedt authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    b1baa11 View commit details
    Browse the repository at this point in the history
  45. ARM: DRA7/OMAP5: Enable ACTLR[0] (Enable invalidates of BTB) for seco…

    …ndary cores
    
    [ Upstream commit 2f8b5b2 ]
    
    Call secure services to enable ACTLR[0] (Enable invalidates of BTB with
    ICIALLU) when branch hardening is enabled for kernel.
    
    On GP devices OMAP5/DRA7, there is no possibility to update secure
    side since "secure world" is ROM and there are no override mechanisms
    possible. On HS devices, appropriate PPA should do the workarounds as
    well.
    
    However, the configuration is only done for secondary core, since it is
    expected that firmware/bootloader will have enabled the required
    configuration for the primary boot core (note: bootloaders typically
    will NOT enable secondary processors, since it has no need to do so).
    
    Signed-off-by: Nishanth Menon <nm@ti.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nmenon authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    66b29e2 View commit details
    Browse the repository at this point in the history
  46. ARM: dts: am3517.dtsi: Disable reference to OMAP3 OTG controller

    [ Upstream commit 9238474 ]
    
    The AM3517 has a different OTG controller location than the OMAP3,
    which is included from omap3.dtsi.  This results in a hwmod error.
    Since the AM3517 has a different OTG controller address, this patch
    disabes one that is isn't available.
    
    Signed-off-by: Adam Ford <aford173@gmail.com>
    Signed-off-by: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aford173 authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    c8c9e45 View commit details
    Browse the repository at this point in the history
  47. ixgbe: Be more careful when modifying MAC filters

    [ Upstream commit d14c780 ]
    
    This change makes it so that we are much more explicit about the ordering
    of updates to the receive address register (RAR) table. Prior to this patch
    I believe we may have been updating the table while entries were still
    active, or possibly allowing for reordering of things since we weren't
    explicitly flushing writes to either the lower or upper portion of the
    register prior to accessing the other half.
    
    Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
    Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
    Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Alexander Duyck authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    43db78f View commit details
    Browse the repository at this point in the history
  48. tools: build: Use HOSTLDFLAGS with fixdep

    [ Upstream commit 8b247a9 ]
    
    The final link of fixdep uses LDFLAGS but not the existing HOSTLDFLAGS.
    Fix this.
    
    Signed-off-by: Laura Abbott <labbott@redhat.com>
    Acked-by: Jiri Olsa <jolsa@kernel.org>
    Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    labbott authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    faf0464 View commit details
    Browse the repository at this point in the history
  49. packet: reset network header if packet shorter than ll reserved space

    [ Upstream commit 993675a ]
    
    If variable length link layer headers result in a packet shorter
    than dev->hard_header_len, reset the network header offset. Else
    skb->mac_len may exceed skb->len after skb_mac_reset_len.
    
    packet_sendmsg_spkt already has similar logic.
    
    Fixes: b84bbaf ("packet: in packet_snd start writing at link layer allocation")
    Signed-off-by: Willem de Bruijn <willemb@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    wdebruij authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    4770fdc View commit details
    Browse the repository at this point in the history
  50. qlogic: check kstrtoul() for errors

    [ Upstream commit 5fc853c ]
    
    We accidentally left out the error handling for kstrtoul().
    
    Fixes: a520030 ("qlcnic: Implement flash sysfs callback for 83xx adapter")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Dan Carpenter authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    d793d5b View commit details
    Browse the repository at this point in the history
  51. tcp: remove DELAYED ACK events in DCTCP

    [ Upstream commit a69258f ]
    
    After fixing the way DCTCP tracking delayed ACKs, the delayed-ACK
    related callbacks are no longer needed
    
    Signed-off-by: Yuchung Cheng <ycheng@google.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Acked-by: Neal Cardwell <ncardwell@google.com>
    Acked-by: Lawrence Brakmo <brakmo@fb.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    yuchungcheng authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    d4efb85 View commit details
    Browse the repository at this point in the history
  52. pinctrl: nsp: off by ones in nsp_pinmux_enable()

    [ Upstream commit f90a21c ]
    
    The > comparisons should be >= or else we read beyond the end of the
    pinctrl->functions[] array.
    
    Fixes: cc4fa83 ("pinctrl: nsp: add pinmux driver support for Broadcom NSP SoC")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Ray Jui <ray.jui@broadcom.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Dan Carpenter authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    6219a83 View commit details
    Browse the repository at this point in the history
  53. pinctrl: nsp: Fix potential NULL dereference

    [ Upstream commit c29e9da ]
    
    platform_get_resource() may fail and return NULL, so we should
    better check it's return value to avoid a NULL pointer dereference
    a bit later in the code.
    
    This is detected by Coccinelle semantic patch.
    
    @@
    expression pdev, res, n, t, e, e1, e2;
    @@
    
    res = platform_get_resource(pdev, t, n);
    + if (!res)
    +   return -EINVAL;
    ... when != res == NULL
    e = devm_ioremap_nocache(e1, res->start, e2);
    
    Fixes: cc4fa83 ("pinctrl: nsp: add pinmux driver support for Broadcom NSP SoC")
    Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
    Reviewed-by: Ray Jui <ray.jui@broadcom.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Wei Yongjun authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    3a2b9fa View commit details
    Browse the repository at this point in the history
  54. drm/nouveau/gem: off by one bugs in nouveau_gem_pushbuf_reloc_apply()

    [ Upstream commit 7f073d0 ]
    
    The bo array has req->nr_buffers elements so the > should be >= so we
    don't read beyond the end of the array.
    
    Fixes: a1606a9 ("drm/nouveau: new gem pushbuf interface, bump to 0.0.16")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Dan Carpenter authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    700cbb6 View commit details
    Browse the repository at this point in the history
  55. net/ethernet/freescale/fman: fix cross-build error

    [ Upstream commit c133459 ]
    
      CC [M]  drivers/net/ethernet/freescale/fman/fman.o
    In file included from ../drivers/net/ethernet/freescale/fman/fman.c:35:
    ../include/linux/fsl/guts.h: In function 'guts_set_dmacr':
    ../include/linux/fsl/guts.h:165:2: error: implicit declaration of function 'clrsetbits_be32' [-Werror=implicit-function-declaration]
      clrsetbits_be32(&guts->dmacr, 3 << shift, device << shift);
      ^~~~~~~~~~~~~~~
    
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Cc: Madalin Bucur <madalin.bucur@nxp.com>
    Cc: netdev@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rddunlap authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    d2a4505 View commit details
    Browse the repository at this point in the history
  56. net: usb: rtl8150: demote allmulti message to dev_dbg()

    [ Upstream commit 3a9b045 ]
    
    This driver can spam the kernel log with multiple messages of:
    
        net eth0: eth0: allmulti set
    
    Usually 4 or 8 at a time (probably because of using ConnMan).
    
    This message doesn't seem useful, so let's demote it from dev_info()
    to dev_dbg().
    
    Signed-off-by: David Lechner <david@lechnology.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    dlech authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    9709382 View commit details
    Browse the repository at this point in the history
  57. PCI: OF: Fix I/O space page leak

    commit a5fb9fb upstream.
    
    When testing the R-Car PCIe driver on the Condor board, if the PCIe PHY
    driver was left disabled, the kernel crashed with this BUG:
    
      kernel BUG at lib/ioremap.c:72!
      Internal error: Oops - BUG: 0 [Freescale#1] PREEMPT SMP
      Modules linked in:
      CPU: 0 PID: 39 Comm: kworker/0:1 Not tainted 4.17.0-dirty #1092
      Hardware name: Renesas Condor board based on r8a77980 (DT)
      Workqueue: events deferred_probe_work_func
      pstate: 80000005 (Nzcv daif -PAN -UAO)
      pc : ioremap_page_range+0x370/0x3c8
      lr : ioremap_page_range+0x40/0x3c8
      sp : ffff000008da39e0
      x29: ffff000008da39e0 x28: 00e8000000000f07
      x27: ffff7dfffee00000 x26: 0140000000000000
      x25: ffff7dfffef00000 x24: 00000000000fe100
      x23: ffff80007b906000 x22: ffff000008ab8000
      x21: ffff000008bb1d58 x20: ffff7dfffef00000
      x19: ffff800009c30fb8 x18: 0000000000000001
      x17: 00000000000152d0 x16: 00000000014012d0
      x15: 0000000000000000 x14: 0720072007200720
      x13: 0720072007200720 x12: 0720072007200720
      x11: 0720072007300730 x10: 00000000000000ae
      x9 : 0000000000000000 x8 : ffff7dffff000000
      x7 : 0000000000000000 x6 : 0000000000000100
      x5 : 0000000000000000 x4 : 000000007b906000
      x3 : ffff80007c61a880 x2 : ffff7dfffeefffff
      x1 : 0000000040000000 x0 : 00e80000fe100f07
      Process kworker/0:1 (pid: 39, stack limit = 0x        (ptrval))
      Call trace:
       ioremap_page_range+0x370/0x3c8
       pci_remap_iospace+0x7c/0xac
       pci_parse_request_of_pci_ranges+0x13c/0x190
       rcar_pcie_probe+0x4c/0xb04
       platform_drv_probe+0x50/0xbc
       driver_probe_device+0x21c/0x308
       __device_attach_driver+0x98/0xc8
       bus_for_each_drv+0x54/0x94
       __device_attach+0xc4/0x12c
       device_initial_probe+0x10/0x18
       bus_probe_device+0x90/0x98
       deferred_probe_work_func+0xb0/0x150
       process_one_work+0x12c/0x29c
       worker_thread+0x200/0x3fc
       kthread+0x108/0x134
       ret_from_fork+0x10/0x18
      Code: f9004ba2 54000080 aa0003fb 17ffff48 (d4210000)
    
    It turned out that pci_remap_iospace() wasn't undone when the driver's
    probe failed, and since devm_phy_optional_get() returned -EPROBE_DEFER,
    the probe was retried, finally causing the BUG due to trying to remap
    already remapped pages.
    
    Introduce the devm_pci_remap_iospace() managed API and replace the
    pci_remap_iospace() call with it to fix the bug.
    
    Fixes: dbf9826 ("PCI: generic: Convert to DT resource parsing API")
    Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
    [lorenzo.pieralisi@arm.com: split commit/updated the commit log]
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Sergei Shtylyov authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    3934e01 View commit details
    Browse the repository at this point in the history
  58. PCI: versatile: Fix I/O space page leak

    [ Upstream commit 0018b26 ]
    
    When testing the R-Car PCIe driver on the Condor board, if the PCIe PHY
    driver was left disabled, the kernel crashed with this BUG:
    
      kernel BUG at lib/ioremap.c:72!
      Internal error: Oops - BUG: 0 [Freescale#1] PREEMPT SMP
      Modules linked in:
      CPU: 0 PID: 39 Comm: kworker/0:1 Not tainted 4.17.0-dirty #1092
      Hardware name: Renesas Condor board based on r8a77980 (DT)
      Workqueue: events deferred_probe_work_func
      pstate: 80000005 (Nzcv daif -PAN -UAO)
      pc : ioremap_page_range+0x370/0x3c8
      lr : ioremap_page_range+0x40/0x3c8
      sp : ffff000008da39e0
      x29: ffff000008da39e0 x28: 00e8000000000f07
      x27: ffff7dfffee00000 x26: 0140000000000000
      x25: ffff7dfffef00000 x24: 00000000000fe100
      x23: ffff80007b906000 x22: ffff000008ab8000
      x21: ffff000008bb1d58 x20: ffff7dfffef00000
      x19: ffff800009c30fb8 x18: 0000000000000001
      x17: 00000000000152d0 x16: 00000000014012d0
      x15: 0000000000000000 x14: 0720072007200720
      x13: 0720072007200720 x12: 0720072007200720
      x11: 0720072007300730 x10: 00000000000000ae
      x9 : 0000000000000000 x8 : ffff7dffff000000
      x7 : 0000000000000000 x6 : 0000000000000100
      x5 : 0000000000000000 x4 : 000000007b906000
      x3 : ffff80007c61a880 x2 : ffff7dfffeefffff
      x1 : 0000000040000000 x0 : 00e80000fe100f07
      Process kworker/0:1 (pid: 39, stack limit = 0x        (ptrval))
      Call trace:
       ioremap_page_range+0x370/0x3c8
       pci_remap_iospace+0x7c/0xac
       pci_parse_request_of_pci_ranges+0x13c/0x190
       rcar_pcie_probe+0x4c/0xb04
       platform_drv_probe+0x50/0xbc
       driver_probe_device+0x21c/0x308
       __device_attach_driver+0x98/0xc8
       bus_for_each_drv+0x54/0x94
       __device_attach+0xc4/0x12c
       device_initial_probe+0x10/0x18
       bus_probe_device+0x90/0x98
       deferred_probe_work_func+0xb0/0x150
       process_one_work+0x12c/0x29c
       worker_thread+0x200/0x3fc
       kthread+0x108/0x134
       ret_from_fork+0x10/0x18
      Code: f9004ba2 54000080 aa0003fb 17ffff48 (d4210000)
    
    It turned out that pci_remap_iospace() wasn't undone when the driver's
    probe failed, and since devm_phy_optional_get() returned -EPROBE_DEFER,
    the probe was retried, finally causing the BUG due to trying to remap
    already remapped pages.
    
    The Versatile PCI controller driver has the same issue.
    Replace pci_remap_iospace() with the devm_ managed version to fix the bug.
    
    Fixes: b7e7817 ("PCI: versatile: Add DT-based ARM Versatile PB PCIe host driver")
    Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
    [lorenzo.pieralisi@arm.com: updated the commit log]
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Sergei Shtylyov authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    90788ea View commit details
    Browse the repository at this point in the history
  59. net: qca_spi: Avoid packet drop during initial sync

    [ Upstream commit b2bab42 ]
    
    As long as the synchronization with the QCA7000 isn't finished, we
    cannot accept packets from the upper layers. So let the SPI thread
    enable the TX queue after sync and avoid unwanted packet drop.
    
    Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
    Fixes: 291ab06 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lategoodbye authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    167e93c View commit details
    Browse the repository at this point in the history
  60. net: qca_spi: Make sure the QCA7000 reset is triggered

    [ Upstream commit 711c62d ]
    
    In case the SPI thread is not running, a simple reset of sync
    state won't fix the transmit timeout. We also need to wake up the kernel
    thread.
    
    Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
    Fixes: ed7d42e ("net: qca_spi: fix transmit queue timeout handling")
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lategoodbye authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    c8697ad View commit details
    Browse the repository at this point in the history
  61. net: qca_spi: Fix log level if probe fails

    [ Upstream commit 5097399 ]
    
    In cases the probing fails the log level of the messages should
    be an error.
    
    Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lategoodbye authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    1e15542 View commit details
    Browse the repository at this point in the history
  62. tcp: identify cryptic messages as TCP seq # bugs

    [ Upstream commit e56b8ce ]
    
    Attempt to make cryptic TCP seq number error messages clearer by
    (1) identifying the source of the message as "TCP", (2) identifying the
    errors as "seq # bug", and (3) grouping the field identifiers and values
    by separating them with commas.
    
    E.g., the following message is changed from:
    
    recvmsg bug 2: copied 73BCB6CD seq 70F17CBE rcvnxt 73BCB9AA fl 0
    WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:1881 tcp_recvmsg+0x649/0xb90
    
    to:
    
    TCP recvmsg seq # bug 2: copied 73BCB6CD, seq 70F17CBE, rcvnxt 73BCB9AA, fl 0
    WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:2011 tcp_recvmsg+0x694/0xba0
    
    Suggested-by: 積丹尼 Dan Jacobson <jidanni@jidanni.org>
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rddunlap authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    e63303e View commit details
    Browse the repository at this point in the history
  63. KVM: irqfd: fix race between EPOLLHUP and irq_bypass_register_consumer

    commit 9432a31 upstream.
    
    A comment warning against this bug is there, but the code is not doing what
    the comment says.  Therefore it is possible that an EPOLLHUP races against
    irq_bypass_register_consumer.  The EPOLLHUP handler schedules irqfd_shutdown,
    and if that runs soon enough, you get a use-after-free.
    
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    bonzini authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    1cd0c7d View commit details
    Browse the repository at this point in the history
  64. ext4: fix spectre gadget in ext4_mb_regular_allocator()

    commit 1a5d5e5 upstream.
    
    'ac->ac_g_ex.fe_len' is a user-controlled value which is used in the
    derivation of 'ac->ac_2order'. 'ac->ac_2order', in turn, is used to
    index arrays which makes it a potential spectre gadget. Fix this by
    sanitizing the value assigned to 'ac->ac2_order'.  This covers the
    following accesses found with the help of smatch:
    
    * fs/ext4/mballoc.c:1896 ext4_mb_simple_scan_group() warn: potential
      spectre issue 'grp->bb_counters' [w] (local cap)
    
    * fs/ext4/mballoc.c:445 mb_find_buddy() warn: potential spectre issue
      'EXT4_SB(e4b->bd_sb)->s_mb_offsets' [r] (local cap)
    
    * fs/ext4/mballoc.c:446 mb_find_buddy() warn: potential spectre issue
      'EXT4_SB(e4b->bd_sb)->s_mb_maxs' [r] (local cap)
    
    Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Signed-off-by: Jeremy Cline <jcline@redhat.com>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jeremycline authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    51ada11 View commit details
    Browse the repository at this point in the history
  65. parisc: Remove ordered stores from syscall.S

    commit 7797167 upstream.
    
    Now that we use a sync prior to releasing the locks in syscall.S, we don't need
    the PA 2.0 ordered stores used to release some locks.  Using an ordered store,
    potentially slows the release and subsequent code.
    
    There are a number of other ordered stores and loads that serve no purpose.  I
    have converted these to normal stores.
    
    Signed-off-by: John David Anglin <dave.anglin@bell.net>
    Cc: stable@vger.kernel.org # 4.0+
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    danglin44 authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    8725807 View commit details
    Browse the repository at this point in the history
  66. xfrm_user: prevent leaking 2 bytes of kernel memory

    commit 45c180b upstream.
    
    struct xfrm_userpolicy_type has two holes, so we should not
    use C99 style initializer.
    
    KMSAN report:
    
    BUG: KMSAN: kernel-infoleak in copyout lib/iov_iter.c:140 [inline]
    BUG: KMSAN: kernel-infoleak in _copy_to_iter+0x1b14/0x2800 lib/iov_iter.c:571
    CPU: 1 PID: 4520 Comm: syz-executor841 Not tainted 4.17.0+ Freescale#5
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
    Call Trace:
     __dump_stack lib/dump_stack.c:77 [inline]
     dump_stack+0x185/0x1d0 lib/dump_stack.c:113
     kmsan_report+0x188/0x2a0 mm/kmsan/kmsan.c:1117
     kmsan_internal_check_memory+0x138/0x1f0 mm/kmsan/kmsan.c:1211
     kmsan_copy_to_user+0x7a/0x160 mm/kmsan/kmsan.c:1253
     copyout lib/iov_iter.c:140 [inline]
     _copy_to_iter+0x1b14/0x2800 lib/iov_iter.c:571
     copy_to_iter include/linux/uio.h:106 [inline]
     skb_copy_datagram_iter+0x422/0xfa0 net/core/datagram.c:431
     skb_copy_datagram_msg include/linux/skbuff.h:3268 [inline]
     netlink_recvmsg+0x6f1/0x1900 net/netlink/af_netlink.c:1959
     sock_recvmsg_nosec net/socket.c:802 [inline]
     sock_recvmsg+0x1d6/0x230 net/socket.c:809
     ___sys_recvmsg+0x3fe/0x810 net/socket.c:2279
     __sys_recvmmsg+0x58e/0xe30 net/socket.c:2391
     do_sys_recvmmsg+0x2a6/0x3e0 net/socket.c:2472
     __do_sys_recvmmsg net/socket.c:2485 [inline]
     __se_sys_recvmmsg net/socket.c:2481 [inline]
     __x64_sys_recvmmsg+0x15d/0x1c0 net/socket.c:2481
     do_syscall_64+0x15b/0x230 arch/x86/entry/common.c:287
     entry_SYSCALL_64_after_hwframe+0x44/0xa9
    RIP: 0033:0x446ce9
    RSP: 002b:00007fc307918db8 EFLAGS: 00000293 ORIG_RAX: 000000000000012b
    RAX: ffffffffffffffda RBX: 00000000006dbc24 RCX: 0000000000446ce9
    RDX: 000000000000000a RSI: 0000000020005040 RDI: 0000000000000003
    RBP: 00000000006dbc20 R08: 0000000020004e40 R09: 0000000000000000
    R10: 0000000040000000 R11: 0000000000000293 R12: 0000000000000000
    R13: 00007ffc8d2df32f R14: 00007fc3079199c0 R15: 0000000000000001
    
    Uninit was stored to memory at:
     kmsan_save_stack_with_flags mm/kmsan/kmsan.c:279 [inline]
     kmsan_save_stack mm/kmsan/kmsan.c:294 [inline]
     kmsan_internal_chain_origin+0x12b/0x210 mm/kmsan/kmsan.c:685
     kmsan_memcpy_origins+0x11d/0x170 mm/kmsan/kmsan.c:527
     __msan_memcpy+0x109/0x160 mm/kmsan/kmsan_instr.c:413
     __nla_put lib/nlattr.c:569 [inline]
     nla_put+0x276/0x340 lib/nlattr.c:627
     copy_to_user_policy_type net/xfrm/xfrm_user.c:1678 [inline]
     dump_one_policy+0xbe1/0x1090 net/xfrm/xfrm_user.c:1708
     xfrm_policy_walk+0x45a/0xd00 net/xfrm/xfrm_policy.c:1013
     xfrm_dump_policy+0x1c0/0x2a0 net/xfrm/xfrm_user.c:1749
     netlink_dump+0x9b5/0x1550 net/netlink/af_netlink.c:2226
     __netlink_dump_start+0x1131/0x1270 net/netlink/af_netlink.c:2323
     netlink_dump_start include/linux/netlink.h:214 [inline]
     xfrm_user_rcv_msg+0x8a3/0x9b0 net/xfrm/xfrm_user.c:2577
     netlink_rcv_skb+0x37e/0x600 net/netlink/af_netlink.c:2448
     xfrm_netlink_rcv+0xb2/0xf0 net/xfrm/xfrm_user.c:2598
     netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
     netlink_unicast+0x1680/0x1750 net/netlink/af_netlink.c:1336
     netlink_sendmsg+0x104f/0x1350 net/netlink/af_netlink.c:1901
     sock_sendmsg_nosec net/socket.c:629 [inline]
     sock_sendmsg net/socket.c:639 [inline]
     ___sys_sendmsg+0xec8/0x1320 net/socket.c:2117
     __sys_sendmsg net/socket.c:2155 [inline]
     __do_sys_sendmsg net/socket.c:2164 [inline]
     __se_sys_sendmsg net/socket.c:2162 [inline]
     __x64_sys_sendmsg+0x331/0x460 net/socket.c:2162
     do_syscall_64+0x15b/0x230 arch/x86/entry/common.c:287
     entry_SYSCALL_64_after_hwframe+0x44/0xa9
    Local variable description: ----upt.i@dump_one_policy
    Variable was created at:
     dump_one_policy+0x78/0x1090 net/xfrm/xfrm_user.c:1689
     xfrm_policy_walk+0x45a/0xd00 net/xfrm/xfrm_policy.c:1013
    
    Byte 130 of 137 is uninitialized
    Memory access starts at ffff88019550407f
    
    Fixes: c0144be ("[XFRM] netlink: Use nla_put()/NLA_PUT() variantes")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Cc: Steffen Klassert <steffen.klassert@secunet.com>
    Cc: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Eric Dumazet authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    2038a9e View commit details
    Browse the repository at this point in the history
  67. netfilter: conntrack: dccp: treat SYNC/SYNCACK as invalid if no prior…

    … state
    
    commit 6613b61 upstream.
    
    When first DCCP packet is SYNC or SYNCACK, we insert a new conntrack
    that has an un-initialized timeout value, i.e. such entry could be
    reaped at any time.
    
    Mark them as INVALID and only ignore SYNC/SYNCACK when connection had
    an old state.
    
    Reported-by: syzbot+6f18401420df260e37ed@syzkaller.appspotmail.com
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Florian Westphal authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    f29eb8e View commit details
    Browse the repository at this point in the history
  68. packet: refine ring v3 block size test to hold one frame

    commit 4576cd4 upstream.
    
    TPACKET_V3 stores variable length frames in fixed length blocks.
    Blocks must be able to store a block header, optional private space
    and at least one minimum sized frame.
    
    Frames, even for a zero snaplen packet, store metadata headers and
    optional reserved space.
    
    In the block size bounds check, ensure that the frame of the
    chosen configuration fits. This includes sockaddr_ll and optional
    tp_reserve.
    
    Syzbot was able to construct a ring with insuffient room for the
    sockaddr_ll in the header of a zero-length frame, triggering an
    out-of-bounds write in dev_parse_header.
    
    Convert the comparison to less than, as zero is a valid snap len.
    This matches the test for minimum tp_frame_size immediately below.
    
    Fixes: f6fb8f1 ("af-packet: TPACKET_V3 flexible buffer implementation.")
    Fixes: eb73190 ("net/packet: refine check for priv area size")
    Reported-by: syzbot <syzkaller@googlegroups.com>
    Signed-off-by: Willem de Bruijn <willemb@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    wdebruij authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    5962984 View commit details
    Browse the repository at this point in the history
  69. parisc: Remove unnecessary barriers from spinlock.h

    commit 3b885ac upstream.
    
    Now that mb() is an instruction barrier, it will slow performance if we issue
    unnecessary barriers.
    
    The spinlock defines have a number of unnecessary barriers.  The __ldcw()
    define is both a hardware and compiler barrier.  The mb() barriers in the
    routines using __ldcw() serve no purpose.
    
    The only barrier needed is the one in arch_spin_unlock().  We need to ensure
    all accesses are complete prior to releasing the lock.
    
    Signed-off-by: John David Anglin <dave.anglin@bell.net>
    Cc: stable@vger.kernel.org # 4.0+
    Signed-off-by: Helge Deller <deller@gmx.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    danglin44 authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    eba0611 View commit details
    Browse the repository at this point in the history
  70. PCI: hotplug: Don't leak pci_slot on registration failure

    commit 4ce6435 upstream.
    
    If addition of sysfs files fails on registration of a hotplug slot, the
    struct pci_slot as well as the entry in the slot_list is leaked.  The
    issue has been present since the hotplug core was introduced in 2002:
    https://git.kernel.org/tglx/history/c/a8a2069f432c
    
    Perhaps the idea was that even though sysfs addition fails, the slot
    should still be usable.  But that's not how drivers use the interface,
    they abort probe if a non-zero value is returned.
    
    Signed-off-by: Lukas Wunner <lukas@wunner.de>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Cc: stable@vger.kernel.org # v2.4.15+
    Cc: Greg Kroah-Hartman <greg@kroah.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    l1k authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    f284245 View commit details
    Browse the repository at this point in the history
  71. PCI: Skip MPS logic for Virtual Functions (VFs)

    commit 3dbe97e upstream.
    
    PCIe r4.0, sec 9.3.5.4, "Device Control Register", shows both
    Max_Payload_Size (MPS) and Max_Read_request_Size (MRRS) to be 'RsvdP' for
    VFs.  Just prior to the table it states:
    
      "PF and VF functionality is defined in Section 7.5.3.4 except where
       noted in Table 9-16.  For VF fields marked 'RsvdP', the PF setting
       applies to the VF."
    
    All of which implies that with respect to Max_Payload_Size Supported
    (MPSS), MPS, and MRRS values, we should not be paying any attention to the
    VF's fields, but rather only to the PF's.  Only looking at the PF's fields
    also logically makes sense as it's the sole physical interface to the PCIe
    bus.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=200527
    Fixes: 27d868b ("PCI: Set MPS to match upstream bridge")
    Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Cc: stable@vger.kernel.org # 4.3+
    Cc: Keith Busch <keith.busch@intel.com>
    Cc: Sinan Kaya <okaya@kernel.org>
    Cc: Dongdong Liu <liudongdong3@huawei.com>
    Cc: Jon Mason <jdmason@kudzu.us>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Myron Stowe authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    73aae59 View commit details
    Browse the repository at this point in the history
  72. PCI: pciehp: Fix use-after-free on unplug

    commit 281e878 upstream.
    
    When pciehp is unbound (e.g. on unplug of a Thunderbolt device), the
    hotplug_slot struct is deregistered and thus freed before freeing the
    IRQ.  The IRQ handler and the work items it schedules print the slot
    name referenced from the freed structure in various informational and
    debug log messages, each time resulting in a quadruple dereference of
    freed pointers (hotplug_slot -> pci_slot -> kobject -> name).
    
    At best the slot name is logged as "(null)", at worst kernel memory is
    exposed in logs or the driver crashes:
    
      pciehp 0000:10:00.0:pcie204: Slot((null)): Card not present
    
    An attacker may provoke the bug by unplugging multiple devices on a
    Thunderbolt daisy chain at once.  Unplugging can also be simulated by
    powering down slots via sysfs.  The bug is particularly easy to trigger
    in poll mode.
    
    It has been present since the driver's introduction in 2004:
    https://git.kernel.org/tglx/history/c/c16b4b14d980
    
    Fix by rearranging teardown such that the IRQ is freed first.  Run the
    work items queued by the IRQ handler to completion before freeing the
    hotplug_slot struct by draining the work queue from the ->release_slot
    callback which is invoked by pci_hp_deregister().
    
    Signed-off-by: Lukas Wunner <lukas@wunner.de>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Cc: stable@vger.kernel.org # v2.6.4
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    l1k authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    3fcdcdd View commit details
    Browse the repository at this point in the history
  73. PCI: pciehp: Fix unprotected list iteration in IRQ handler

    commit 1204e35 upstream.
    
    Commit b440bde ("PCI: Add pci_ignore_hotplug() to ignore hotplug
    events for a device") iterates over the devices on a hotplug port's
    subordinate bus in pciehp's IRQ handler without acquiring pci_bus_sem.
    It is thus possible for a user to cause a crash by concurrently
    manipulating the device list, e.g. by disabling slot power via sysfs
    on a different CPU or by initiating a remove/rescan via sysfs.
    
    This can't be fixed by acquiring pci_bus_sem because it may sleep.
    The simplest fix is to avoid the list iteration altogether and just
    check the ignore_hotplug flag on the port itself.  This works because
    pci_ignore_hotplug() sets the flag both on the device as well as on its
    parent bridge.
    
    We do lose the ability to print the name of the device blocking hotplug
    in the debug message, but that's probably bearable.
    
    Fixes: b440bde ("PCI: Add pci_ignore_hotplug() to ignore hotplug events for a device")
    Signed-off-by: Lukas Wunner <lukas@wunner.de>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    l1k authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    86a3d59 View commit details
    Browse the repository at this point in the history
  74. i2c: imx: Fix race condition in dma read

    commit bed4ff1 upstream.
    
    This fixes a race condition, where the DMAEN bit ends up being set after
    I2C slave has transmitted a byte following the dummy read.  When that
    happens, an interrupt is generated instead, and no DMA request is generated
    to kickstart the DMA read, and a timeout happens after DMA_TIMEOUT (1 sec).
    
    Fixed by setting the DMAEN bit before the dummy read.
    
    Signed-off-by: Esben Haabendal <eha@deif.com>
    Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
    Cc: stable@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Esben Haabendal authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    44745bd View commit details
    Browse the repository at this point in the history
  75. reiserfs: fix broken xattr handling (heap corruption, bad retval)

    commit a13f085 upstream.
    
    This fixes the following issues:
    
    - When a buffer size is supplied to reiserfs_listxattr() such that each
      individual name fits, but the concatenation of all names doesn't fit,
      reiserfs_listxattr() overflows the supplied buffer.  This leads to a
      kernel heap overflow (verified using KASAN) followed by an out-of-bounds
      usercopy and is therefore a security bug.
    
    - When a buffer size is supplied to reiserfs_listxattr() such that a
      name doesn't fit, -ERANGE should be returned.  But reiserfs instead just
      truncates the list of names; I have verified that if the only xattr on a
      file has a longer name than the supplied buffer length, listxattr()
      incorrectly returns zero.
    
    With my patch applied, -ERANGE is returned in both cases and the memory
    corruption doesn't happen anymore.
    
    Credit for making me clean this code up a bit goes to Al Viro, who pointed
    out that the ->actor calling convention is suboptimal and should be
    changed.
    
    Link: http://lkml.kernel.org/r/20180802151539.5373-1-jannh@google.com
    Fixes: 48b32a3 ("reiserfs: use generic xattr handlers")
    Signed-off-by: Jann Horn <jannh@google.com>
    Acked-by: Jeff Mahoney <jeffm@suse.com>
    Cc: Eric Biggers <ebiggers@google.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    thejh authored and gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    696d906 View commit details
    Browse the repository at this point in the history
  76. Linux 4.9.124

    gregkh committed Aug 24, 2018
    Configuration menu
    Copy the full SHA
    e8d49e4 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2018

  1. vti6: fix PMTU caching and reporting on xmit

    [ Upstream commit d699097 ]
    
    When setting the skb->dst before doing the MTU check, the route PMTU
    caching and reporting is done on the new dst which is about to be
    released.
    
    Instead, PMTU handling should be done using the original dst.
    
    This is aligned with IPv4 VTI.
    
    Fixes: ccd740c ("vti6: Add pmtu handling to vti6_xmit.")
    Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ebirger authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    ce723f8 View commit details
    Browse the repository at this point in the history
  2. xfrm: fix missing dst_release() after policy blocking lbcast and mult…

    …icast
    
    [ Upstream commit 8cc8877 ]
    
    Fix missing dst_release() when local broadcast or multicast traffic is
    xfrm policy blocked.
    
    For IPv4 this results to dst leak: ip_route_output_flow() allocates
    dst_entry via __ip_route_output_key() and passes it to
    xfrm_lookup_route(). xfrm_lookup returns ERR_PTR(-EPERM) that is
    propagated. The dst that was allocated is never released.
    
    IPv4 local broadcast testcase:
     ping -b 192.168.1.255 &
     sleep 1
     ip xfrm policy add src 0.0.0.0/0 dst 192.168.1.255/32 dir out action block
    
    IPv4 multicast testcase:
     ping 224.0.0.1 &
     sleep 1
     ip xfrm policy add src 0.0.0.0/0 dst 224.0.0.1/32 dir out action block
    
    For IPv6 the missing dst_release() causes trouble e.g. when used in netns:
     ip netns add TEST
     ip netns exec TEST ip link set lo up
     ip link add dummy0 type dummy
     ip link set dev dummy0 netns TEST
     ip netns exec TEST ip addr add fd00::1111 dev dummy0
     ip netns exec TEST ip link set dummy0 up
     ip netns exec TEST ping -6 -c 5 ff02::1%dummy0 &
     sleep 1
     ip netns exec TEST ip xfrm policy add src ::/0 dst ff02::1 dir out action block
     wait
     ip netns del TEST
    
    After netns deletion we see:
    [  258.239097] unregister_netdevice: waiting for lo to become free. Usage count = 2
    [  268.279061] unregister_netdevice: waiting for lo to become free. Usage count = 2
    [  278.367018] unregister_netdevice: waiting for lo to become free. Usage count = 2
    [  288.375259] unregister_netdevice: waiting for lo to become free. Usage count = 2
    
    Fixes: ac37e25 ("xfrm: release dst_orig in case of error in xfrm_lookup()")
    Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rantala authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    590f312 View commit details
    Browse the repository at this point in the history
  3. xfrm: free skb if nlsk pointer is NULL

    [ Upstream commit 86126b7 ]
    
    nlmsg_multicast() always frees the skb, so in case we cannot call
    it we must do that ourselves.
    
    Fixes: 21ee543 ("xfrm: fix race between netns cleanup and state expire notification")
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Florian Westphal authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    301a6da View commit details
    Browse the repository at this point in the history
  4. mac80211: add stations tied to AP_VLANs during hw reconfig

    [ Upstream commit 19103a4 ]
    
    As part of hw reconfig, only stations linked to AP interfaces are added
    back to the driver ignoring those which are tied to AP_VLAN interfaces.
    
    It is true that there could be stations tied to the AP_VLAN interface while
    serving 4addr clients or when using AP_VLAN for VLAN operations; we should
    be adding these stations back to the driver as part of hw reconfig, failing
    to do so can cause functional issues.
    
    In the case of ath10k driver, the following errors were observed.
    
    ath10k_pci : failed to install key for non-existent peer XX:XX:XX:XX:XX:XX
    Workqueue: events_freezable ieee80211_restart_work [mac80211]
    (unwind_backtrace) from (show_stack+0x10/0x14)
    (show_stack) (dump_stack+0x80/0xa0)
    (dump_stack) (warn_slowpath_common+0x68/0x8c)
    (warn_slowpath_common) (warn_slowpath_null+0x18/0x20)
    (warn_slowpath_null) (ieee80211_enable_keys+0x88/0x154 [mac80211])
    (ieee80211_enable_keys) (ieee80211_reconfig+0xc90/0x19c8 [mac80211])
    (ieee80211_reconfig]) (ieee80211_restart_work+0x8c/0xa0 [mac80211])
    (ieee80211_restart_work) (process_one_work+0x284/0x488)
    (process_one_work) (worker_thread+0x228/0x360)
    (worker_thread) (kthread+0xd8/0xec)
    (kthread) (ret_from_fork+0x14/0x24)
    
    Also while bringing down the AP VAP, WARN_ONs and errors related to peer
    removal were observed.
    
    ath10k_pci : failed to clear all peer wep keys for vdev 0: -2
    ath10k_pci : failed to disassociate station: 8c:fd:f0:0a:8c:f5 vdev 0: -2
    (unwind_backtrace) (show_stack+0x10/0x14)
    (show_stack) (dump_stack+0x80/0xa0)
    (dump_stack) (warn_slowpath_common+0x68/0x8c)
    (warn_slowpath_common) (warn_slowpath_null+0x18/0x20)
    (warn_slowpath_null) (sta_set_sinfo+0xb98/0xc9c [mac80211])
    (sta_set_sinfo [mac80211]) (__sta_info_flush+0xf0/0x134 [mac80211])
    (__sta_info_flush [mac80211]) (ieee80211_stop_ap+0xe8/0x390 [mac80211])
    (ieee80211_stop_ap [mac80211]) (__cfg80211_stop_ap+0xe0/0x3dc [cfg80211])
    (__cfg80211_stop_ap [cfg80211]) (cfg80211_stop_ap+0x30/0x44 [cfg80211])
    (cfg80211_stop_ap [cfg80211]) (genl_rcv_msg+0x274/0x30c)
    (genl_rcv_msg) (netlink_rcv_skb+0x58/0xac)
    (netlink_rcv_skb) (genl_rcv+0x20/0x34)
    (genl_rcv) (netlink_unicast+0x11c/0x204)
    (netlink_unicast) (netlink_sendmsg+0x30c/0x370)
    (netlink_sendmsg) (sock_sendmsg+0x70/0x84)
    (sock_sendmsg) (___sys_sendmsg.part.3+0x188/0x228)
    (___sys_sendmsg.part.3) (__sys_sendmsg+0x4c/0x70)
    (__sys_sendmsg) (ret_fast_syscall+0x0/0x44)
    
    These issues got fixed by adding the stations which are
    tied to AP_VLANs back to the driver.
    
    Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org>
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mpubbise@codeaurora.org authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    f1ddbb1 View commit details
    Browse the repository at this point in the history
  5. nl80211: Add a missing break in parse_station_flags

    [ Upstream commit 5cf3006 ]
    
    I was looking at usually suppressed gcc warnings,
    [-Wimplicit-fallthrough=] in this case:
    
    The code definitely looks like a break is missing here.
    However I am not able to test the NL80211_IFTYPE_MESH_POINT,
    nor do I actually know what might be :)
    So please use this patch with caution and only if you are
    able to do some testing.
    
    Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
    [johannes: looks obvious enough to apply as is, interesting
     though that it never seems to have been a problem]
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    bernd-edlinger authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    4fd0897 View commit details
    Browse the repository at this point in the history
  6. drm/bridge: adv7511: Reset registers on hotplug

    [ Upstream commit 5f34175 ]
    
    The bridge loses its hw state when the cable is unplugged. If we detect
    this case in the hpd handler, reset its state.
    
    Reported-by: Rob Clark <robdclark@gmail.com>
    Tested-by: Rob Clark <robdclark@gmail.com>
    Reviewed-by: Archit Taneja <architt@codeaurora.org>
    Signed-off-by: Sean Paul <seanpaul@chromium.org>
    Link: https://patchwork.freedesktop.org/patch/msgid/20180703165648.120401-1-seanpaul@chromium.org
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    atseanpaul authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    fa1c6d2 View commit details
    Browse the repository at this point in the history
  7. scsi: libiscsi: fix possible NULL pointer dereference in case of TMF

    [ Upstream commit a17037e ]
    
    In iscsi_check_tmf_restrictions() task->hdr is dereferenced to print the
    opcode, it is possible that task->hdr is NULL.
    
    There are two cases based on opcode argument:
    
    1. ISCSI_OP_SCSI_CMD - In this case alloc_pdu() is called
    after iscsi_check_tmf_restrictions()
    
    iscsi_prep_scsi_cmd_pdu() -> iscsi_check_tmf_restrictions() -> alloc_pdu().
    
    Transport drivers allocate memory for iSCSI hdr in alloc_pdu() and assign
    it to task->hdr. In case of TMF task->hdr will be NULL resulting in NULL
    pointer dereference.
    
    2. ISCSI_OP_SCSI_DATA_OUT - In this case transport driver can free the
    memory for iSCSI hdr after transmitting the pdu so task->hdr can be NULL or
    invalid.
    
    This patch fixes this issue by removing task->hdr->opcode from the printk
    statement.
    
    Signed-off-by: Varun Prakash <varun@chelsio.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Varun Prakash authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    0a04fdb View commit details
    Browse the repository at this point in the history
  8. drm/imx: imx-ldb: disable LDB on driver bind

    [ Upstream commit b582623 ]
    
    The LVDS signal integrity is only guaranteed when the correct enable
    sequence (first IPU DI, then LDB) is used. If the LDB display output was
    active before the imx-drm driver is loaded (like when a bootsplash was
    active) the DI will be disabled by the full IPU reset we do when loading
    the driver. The LDB control registers are not part of the IPU range and
    thus will remain unchanged.
    
    This leads to the LDB still being active when the DI is getting enabled,
    effectively reversing the required enable sequence. Fix this by also
    disabling the LDB on driver bind.
    
    Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
    Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lynxeye-dev authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    cb94b5e View commit details
    Browse the repository at this point in the history
  9. drm/imx: imx-ldb: check if channel is enabled before printing warning

    [ Upstream commit c80d673 ]
    
    If the second LVDS channel has been disabled in the DT when using dual-channel
    mode we should not print a warning.
    
    Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
    Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lynxeye-dev authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    13f03bd View commit details
    Browse the repository at this point in the history
  10. usb: gadget: r8a66597: Fix two possible sleep-in-atomic-context bugs …

    …in init_controller()
    
    [ Upstream commit 0602088 ]
    
    The driver may sleep with holding a spinlock.
    The function call paths (from bottom to top) in Linux-4.16.7 are:
    
    [FUNC] msleep
    drivers/usb/gadget/udc/r8a66597-udc.c, 839:
    		msleep in init_controller
    drivers/usb/gadget/udc/r8a66597-udc.c, 96:
    		init_controller in r8a66597_usb_disconnect
    drivers/usb/gadget/udc/r8a66597-udc.c, 93:
    		spin_lock in r8a66597_usb_disconnect
    
    [FUNC] msleep
    drivers/usb/gadget/udc/r8a66597-udc.c, 835:
    		msleep in init_controller
    drivers/usb/gadget/udc/r8a66597-udc.c, 96:
    		init_controller in r8a66597_usb_disconnect
    drivers/usb/gadget/udc/r8a66597-udc.c, 93:
    		spin_lock in r8a66597_usb_disconnect
    
    To fix these bugs, msleep() is replaced with mdelay().
    
    This bug is found by my static analysis tool (DSAC-2) and checked by
    my code review.
    
    Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    XidianGeneral authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    62dd6ed View commit details
    Browse the repository at this point in the history
  11. usb: gadget: r8a66597: Fix a possible sleep-in-atomic-context bugs in…

    … r8a66597_queue()
    
    [ Upstream commit f36b507 ]
    
    The driver may sleep in an interrupt handler.
    The function call path (from bottom to top) in Linux-4.16.7 is:
    
    [FUNC] r8a66597_queue(GFP_KERNEL)
    drivers/usb/gadget/udc/r8a66597-udc.c, 1193:
    		r8a66597_queue in get_status
    drivers/usb/gadget/udc/r8a66597-udc.c, 1301:
    		get_status in setup_packet
    drivers/usb/gadget/udc/r8a66597-udc.c, 1381:
    		setup_packet in irq_control_stage
    drivers/usb/gadget/udc/r8a66597-udc.c, 1508:
    		irq_control_stage in r8a66597_irq (interrupt handler)
    
    To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
    
    This bug is found by my static analysis tool (DSAC-2) and checked by
    my code review.
    
    Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    XidianGeneral authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    02e8b4f View commit details
    Browse the repository at this point in the history
  12. usb/phy: fix PPC64 build errors in phy-fsl-usb.c

    [ Upstream commit a39ba90 ]
    
    Fix build errors when built for PPC64:
    These variables are only used on PPC32 so they don't need to be
    initialized for PPC64.
    
    ../drivers/usb/phy/phy-fsl-usb.c: In function 'usb_otg_start':
    ../drivers/usb/phy/phy-fsl-usb.c:865:3: error: '_fsl_readl' undeclared (first use in this function); did you mean 'fsl_readl'?
       _fsl_readl = _fsl_readl_be;
    ../drivers/usb/phy/phy-fsl-usb.c:865:16: error: '_fsl_readl_be' undeclared (first use in this function); did you mean 'fsl_readl'?
       _fsl_readl = _fsl_readl_be;
    ../drivers/usb/phy/phy-fsl-usb.c:866:3: error: '_fsl_writel' undeclared (first use in this function); did you mean 'fsl_writel'?
       _fsl_writel = _fsl_writel_be;
    ../drivers/usb/phy/phy-fsl-usb.c:866:17: error: '_fsl_writel_be' undeclared (first use in this function); did you mean 'fsl_writel'?
       _fsl_writel = _fsl_writel_be;
    ../drivers/usb/phy/phy-fsl-usb.c:868:16: error: '_fsl_readl_le' undeclared (first use in this function); did you mean 'fsl_readl'?
       _fsl_readl = _fsl_readl_le;
    ../drivers/usb/phy/phy-fsl-usb.c:869:17: error: '_fsl_writel_le' undeclared (first use in this function); did you mean 'fsl_writel'?
       _fsl_writel = _fsl_writel_le;
    
    and the sysfs "show" function return type should be ssize_t, not int:
    
    ../drivers/usb/phy/phy-fsl-usb.c:1042:49: error: initialization of 'ssize_t (*)(struct device *, struct device_attribute *, char *)' {aka 'long int (*)(struct device *, struct device_attribute *, char *)'} from incompatible pointer type 'int (*)(struct device *, struct device_attribute *, char *)' [-Werror=incompatible-pointer-types]
     static DEVICE_ATTR(fsl_usb2_otg_state, S_IRUGO, show_fsl_usb2_otg_state, NULL);
    
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Cc: Felipe Balbi <balbi@kernel.org>
    Cc: linux-usb@vger.kernel.org
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: linuxppc-dev@lists.ozlabs.org
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rddunlap authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    2b4fd19 View commit details
    Browse the repository at this point in the history
  13. tools: usb: ffs-test: Fix build on big endian systems

    [ Upstream commit a2b22dd ]
    
    The tools/usb/ffs-test.c file defines cpu_to_le16/32 by using the C
    library htole16/32 function calls. However, cpu_to_le16/32 are used when
    initializing structures, i.e in a context where a function call is not
    allowed.
    
    It works fine on little endian systems because htole16/32 are defined by
    the C library as no-ops. But on big-endian systems, they are actually
    doing something, which might involve calling a function, causing build
    failures, such as:
    
       ffs-test.c:48:25: error: initializer element is not constant
        #define cpu_to_le32(x)  htole32(x)
                                ^~~~~~~
       ffs-test.c:128:12: note: in expansion of macro ‘cpu_to_le32’
          .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
                   ^~~~~~~~~~~
    
    To solve this, we code cpu_to_le16/32 in a way that allows them to be
    used when initializing structures. This fix was imported from
    meta-openembedded/android-tools/fix-big-endian-build.patch written by
    Thomas Petazzoni <thomas.petazzoni@free-electrons.com>.
    
    CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    petersenna authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    3b7c96a View commit details
    Browse the repository at this point in the history
  14. usb: gadget: f_uac2: fix endianness of 'struct cntrl_*_lay3'

    [ Upstream commit eec24f2 ]
    
    The list [1] of commits doing endianness fixes in USB subsystem is long
    due to below quote from USB spec Revision 2.0 from April 27, 2000:
    
    ------------
    8.1 Byte/Bit Ordering
    
    Multiple byte fields in standard descriptors, requests, and responses
    are interpreted as and moved over the bus in little-endian order, i.e.
    LSB to MSB.
    ------------
    
    This commit belongs to the same family.
    
    [1] Example of endianness fixes in USB subsystem:
    commit 14e1d56 ("usb: gadget: f_uac2: endianness fixes.")
    commit 42370b8 ("usb: gadget: f_uac1: endianness fixes.")
    commit 63afd5c ("USB: chaoskey: fix Alea quirk on big-endian hosts")
    commit 74098c4 ("usb: gadget: acm: fix endianness in notifications")
    commit cdd7928 ("ACM gadget: fix endianness in notifications")
    commit 323ece5 ("cdc-wdm: fix endianness bug in debug statements")
    commit e102609 ("usb: gadget: uvc: Fix endianness mismatches")
           list goes on
    
    Fixes: 132fcb4 ("usb: gadget: Add Audio Class 2.0 Driver")
    Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
    Reviewed-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    erosca authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    e2838a2 View commit details
    Browse the repository at this point in the history
  15. bpf, ppc64: fix unexpected r0=0 exit path inside bpf_xadd

    [ Upstream commit b9c1e60 ]
    
    None of the JITs is allowed to implement exit paths from the BPF
    insn mappings other than BPF_JMP | BPF_EXIT. In the BPF core code
    we have a couple of rewrites in eBPF (e.g. LD_ABS / LD_IND) and
    in eBPF to cBPF translation to retain old existing behavior where
    exceptions may occur; they are also tightly controlled by the
    verifier where it disallows some of the features such as BPF to
    BPF calls when legacy LD_ABS / LD_IND ops are present in the BPF
    program. During recent review of all BPF_XADD JIT implementations
    I noticed that the ppc64 one is buggy in that it contains two
    jumps to exit paths. This is problematic as this can bypass verifier
    expectations e.g. pointed out in commit f6b1b3b ("bpf: fix
    subprog verifier bypass by div/mod by 0 exception"). The first
    exit path is obsoleted by the fix in ca36960 ("bpf: allow xadd
    only on aligned memory") anyway, and for the second one we need to
    do a fetch, add and store loop if the reservation from lwarx/ldarx
    was lost in the meantime.
    
    Fixes: 156d0e2 ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF")
    Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
    Reviewed-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
    Tested-by: Sandipan Das <sandipan@linux.vnet.ibm.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    borkmann authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    6e9261a View commit details
    Browse the repository at this point in the history
  16. tools/power turbostat: fix -S on UP systems

    [ Upstream commit 9d83601 ]
    
    The -S (system summary) option failed to print any data on a 1-processor system.
    
    Reported-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    lenb authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    354d5a3 View commit details
    Browse the repository at this point in the history
  17. net: caif: Add a missing rcu_read_unlock() in caif_flow_cb

    [ Upstream commit 64119e0 ]
    
    Add a missing rcu_read_unlock in the error path
    
    Fixes: c95567c ("caif: added check for potential null return")
    Signed-off-by: YueHaibing <yuehaibing@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    YueHaibing authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    eca9953 View commit details
    Browse the repository at this point in the history
  18. qed: Fix possible race for the link state value.

    [ Upstream commit 58874c7 ]
    
    There's a possible race where driver can read link status in mid-transition
    and see that virtual-link is up yet speed is 0. Since in this
    mid-transition we're guaranteed to see a mailbox from MFW soon, we can
    afford to treat this as link down.
    
    Fixes: cc875c2 ("qed: Add link support")
    Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
    Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
    Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Sudarsana Reddy Kalluru authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    4646860 View commit details
    Browse the repository at this point in the history
  19. qed: Correct Multicast API to reflect existence of 256 approximate bu…

    …ckets.
    
    [ Upstream commit 25c020a ]
    
    FW hsi contains 256 approximation buckets which are split in ramrod into
    eight u32 values, but driver is using eight 'unsigned long' variables.
    
    This patch fixes the mcast logic by making the API utilize u32.
    
    Fixes: 83aeb93 ("qed*: Trivial modifications")
    Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
    Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
    Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Sudarsana Reddy Kalluru authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    13afaae View commit details
    Browse the repository at this point in the history
  20. atl1c: reserve min skb headroom

    [ Upstream commit 6e56830 ]
    
    Got crash report with following backtrace:
    BUG: unable to handle kernel paging request at ffff8801869daffe
    RIP: 0010:[<ffffffff816429c4>]  [<ffffffff816429c4>] ip6_finish_output2+0x394/0x4c0
    RSP: 0018:ffff880186c83a98  EFLAGS: 00010283
    RAX: ffff8801869db00e ...
      [<ffffffff81644cdc>] ip6_finish_output+0x8c/0xf0
      [<ffffffff81644d97>] ip6_output+0x57/0x100
      [<ffffffff81643dc9>] ip6_forward+0x4b9/0x840
      [<ffffffff81645566>] ip6_rcv_finish+0x66/0xc0
      [<ffffffff81645db9>] ipv6_rcv+0x319/0x530
      [<ffffffff815892ac>] netif_receive_skb+0x1c/0x70
      [<ffffffffc0060bec>] atl1c_clean+0x1ec/0x310 [atl1c]
      ...
    
    The bad access is in neigh_hh_output(), at skb->data - 16 (HH_DATA_MOD).
    atl1c driver provided skb with no headroom, so 14 bytes (ethernet
    header) got pulled, but then 16 are copied.
    
    Reserve NET_SKB_PAD bytes headroom, like netdev_alloc_skb().
    
    Compile tested only; I lack hardware.
    
    Fixes: 7b70176 ("atl1c: Fix misuse of netdev_alloc_skb in refilling rx ring")
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Florian Westphal authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    0924ac4 View commit details
    Browse the repository at this point in the history
  21. net: prevent ISA drivers from building on PPC32

    [ Upstream commit c9ce1fa ]
    
    Prevent drivers from building on PPC32 if they use isa_bus_to_virt(),
    isa_virt_to_bus(), or isa_page_to_bus(), which are not available and
    thus cause build errors.
    
    ../drivers/net/ethernet/3com/3c515.c: In function 'corkscrew_open':
    ../drivers/net/ethernet/3com/3c515.c:824:9: error: implicit declaration of function 'isa_virt_to_bus'; did you mean 'virt_to_bus'? [-Werror=implicit-function-declaration]
    
    ../drivers/net/ethernet/amd/lance.c: In function 'lance_rx':
    ../drivers/net/ethernet/amd/lance.c:1203:23: error: implicit declaration of function 'isa_bus_to_virt'; did you mean 'bus_to_virt'? [-Werror=implicit-function-declaration]
    
    ../drivers/net/ethernet/amd/ni65.c: In function 'ni65_init_lance':
    ../drivers/net/ethernet/amd/ni65.c:585:20: error: implicit declaration of function 'isa_virt_to_bus'; did you mean 'virt_to_bus'? [-Werror=implicit-function-declaration]
    
    ../drivers/net/ethernet/cirrus/cs89x0.c: In function 'net_open':
    ../drivers/net/ethernet/cirrus/cs89x0.c:897:20: error: implicit declaration of function 'isa_virt_to_bus'; did you mean 'virt_to_bus'? [-Werror=implicit-function-declaration]
    
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rddunlap authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    76a4e0e View commit details
    Browse the repository at this point in the history
  22. can: mpc5xxx_can: check of_iomap return before use

    [ Upstream commit b5c1a23 ]
    
    of_iomap() can return NULL so that return needs to be checked and NULL
    treated as failure. While at it also take care of the missing
    of_node_put() in the error path.
    
    Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
    Fixes: commit afa17a5 ("net/can: add driver for mscan family & mpc52xx_mscan")
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Nicholas Mc Guire authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    82ad267 View commit details
    Browse the repository at this point in the history
  23. i2c: davinci: Avoid zero value of CLKH

    [ Upstream commit cc8de9a ]
    
    If CLKH is set to 0 I2C clock is not generated at all, so avoid this value
    and stretch the clock in this case.
    
    Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
    Acked-by: Sekhar Nori <nsekhar@ti.com>
    Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    asverdlin authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    c5d7e5e View commit details
    Browse the repository at this point in the history
  24. perf/x86/amd/ibs: Don't access non-started event

    [ Upstream commit d2753e6 ]
    
    Paul Menzel reported the following bug:
    
    > Enabling the undefined behavior sanitizer and building GNU/Linux 4.18-rc5+
    > (with some unrelated commits) with GCC 8.1.0 from Debian Sid/unstable, the
    > warning below is shown.
    >
    > > [    2.111913]
    > > ================================================================================
    > > [    2.111917] UBSAN: Undefined behaviour in arch/x86/events/amd/ibs.c:582:24
    > > [    2.111919] member access within null pointer of type 'struct perf_event'
    > > [    2.111926] CPU: 0 PID: 144 Comm: udevadm Not tainted 4.18.0-rc5-00316-g4864b68cedf2 Freescale#104
    > > [    2.111928] Hardware name: ASROCK E350M1/E350M1, BIOS TIMELESS 01/01/1970
    > > [    2.111930] Call Trace:
    > > [    2.111943]  dump_stack+0x55/0x89
    > > [    2.111949]  ubsan_epilogue+0xb/0x33
    > > [    2.111953]  handle_null_ptr_deref+0x7f/0x90
    > > [    2.111958]  __ubsan_handle_type_mismatch_v1+0x55/0x60
    > > [    2.111964]  perf_ibs_handle_irq+0x596/0x620
    
    The code dereferences event before checking the STARTED bit. Patch
    below should cure the issue.
    
    The warning should not trigger, if I analyzed the thing correctly.
    (And Paul's testing confirms this.)
    
    Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Paul Menzel <pmenzel+linux-x86@molgen.mpg.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Vince Weaver <vincent.weaver@maine.edu>
    Link: http://lkml.kernel.org/r/alpine.DEB.2.21.1807200958390.1580@nanos.tec.linutronix.de
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    KAGA-KOKO authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    b3c2509 View commit details
    Browse the repository at this point in the history
  25. media: staging: omap4iss: Include asm/cacheflush.h after generic incl…

    …udes
    
    [ Upstream commit 0894da8 ]
    
    Including asm/cacheflush.h first results in the following build error
    when trying to build sparc32:allmodconfig, because 'struct page' has not
    been declared, and the function declaration ends up creating a separate
    (private) declaration of struct page (as a result of function arguments
    being in the scope of the function declaration and definition, not in
    global scope).
    
    The C scoping rules do not just affect variable visibility, they also
    affect type declaration visibility.
    
    The end result is that when the actual call site is seen in
    <linux/highmem.h>, the 'struct page' type in the caller is not the same
    'struct page' that the function was declared with, resulting in:
    
      In file included from arch/sparc/include/asm/page.h:10:0,
                       ...
                       from drivers/staging/media/omap4iss/iss_video.c:15:
      include/linux/highmem.h: In function 'clear_user_highpage':
      include/linux/highmem.h:137:31: error:
    	passing argument 1 of 'sparc_flush_page_to_ram' from incompatible
    	pointer type
    
    Include generic includes files first to fix the problem.
    
    Fixes: fc96d58 ("[media] v4l: omap4iss: Add support for OMAP4 camera interface - Video devices")
    Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
    Acked-by: David S. Miller <davem@davemloft.net>
    Cc: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    [ Added explanation of C scope rules - Linus ]
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    groeck authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    d3313fe View commit details
    Browse the repository at this point in the history
  26. bnx2x: Fix invalid memory access in rss hash config path.

    [ Upstream commit ae2dcb2 ]
    
    Rx hash/filter table configuration uses rss_conf_obj to configure filters
    in the hardware. This object is initialized only when the interface is
    brought up.
    This patch adds driver changes to configure rss params only when the device
    is in opened state. In port disabled case, the config will be cached in the
    driver structure which will be applied in the successive load path.
    
    Please consider applying it to 'net' branch.
    
    Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Sudarsana Reddy Kalluru authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    32680dc View commit details
    Browse the repository at this point in the history
  27. qmi_wwan: fix interface number for DW5821e production firmware

    [ Upstream commit f25e139 ]
    
    The original mapping for the DW5821e was done using a development
    version of the firmware. Confirmed with the vendor that the final
    USB layout ends up exposing the QMI control/data ports in USB
    config Freescale#1, interface #0, not in interface Freescale#1 (which is now a HID
    interface).
    
    T:  Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0
    D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  2
    P:  Vendor=413c ProdID=81d7 Rev=03.18
    S:  Manufacturer=DELL
    S:  Product=DW5821e Snapdragon X20 LTE
    S:  SerialNumber=0123456789ABCDEF
    C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    I:  If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    I:  If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    
    Fixes: e7e197e ("qmi_wwan: add support for the Dell Wireless 5821e module")
    Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
    Acked-by: Bjørn Mork <bjorn@mork.no>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aleksander0m authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    d638725 View commit details
    Browse the repository at this point in the history
  28. net: axienet: Fix double deregister of mdio

    [ Upstream commit 03bc7ca ]
    
    If the registration fails then mdio_unregister is called.
    However at unbind the unregister ia attempted again resulting
    in the below crash
    
    [   73.544038] kernel BUG at drivers/net/phy/mdio_bus.c:415!
    [   73.549362] Internal error: Oops - BUG: 0 [Freescale#1] SMP
    [   73.554127] Modules linked in:
    [   73.557168] CPU: 0 PID: 2249 Comm: sh Not tainted 4.14.0 Freescale#183
    [   73.562895] Hardware name: xlnx,zynqmp (DT)
    [   73.567062] task: ffffffc879e41180 task.stack: ffffff800cbe0000
    [   73.572973] PC is at mdiobus_unregister+0x84/0x88
    [   73.577656] LR is at axienet_mdio_teardown+0x18/0x30
    [   73.582601] pc : [<ffffff80085fa4cc>] lr : [<ffffff8008616858>]
    pstate: 20000145
    [   73.589981] sp : ffffff800cbe3c30
    [   73.593277] x29: ffffff800cbe3c30 x28: ffffffc879e41180
    [   73.598573] x27: ffffff8008a21000 x26: 0000000000000040
    [   73.603868] x25: 0000000000000124 x24: ffffffc879efe920
    [   73.609164] x23: 0000000000000060 x22: ffffffc879e02000
    [   73.614459] x21: ffffffc879e02800 x20: ffffffc87b0b8870
    [   73.619754] x19: ffffffc879e02800 x18: 000000000000025d
    [   73.625050] x17: 0000007f9a719ad0 x16: ffffff8008195bd8
    [   73.630345] x15: 0000007f9a6b3d00 x14: 0000000000000010
    [   73.635640] x13: 74656e7265687465 x12: 0000000000000030
    [   73.640935] x11: 0000000000000030 x10: 0101010101010101
    [   73.646231] x9 : 241f394f42533300 x8 : ffffffc8799f6e98
    [   73.651526] x7 : ffffffc8799f6f18 x6 : ffffffc87b0ba318
    [   73.656822] x5 : ffffffc87b0ba498 x4 : 0000000000000000
    [   73.662117] x3 : 0000000000000000 x2 : 0000000000000008
    [   73.667412] x1 : 0000000000000004 x0 : ffffffc8799f4000
    [   73.672708] Process sh (pid: 2249, stack limit = 0xffffff800cbe0000)
    
    Fix the same by making the bus NULL on unregister.
    
    Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Shubhrajyoti Datta authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    88adb09 View commit details
    Browse the repository at this point in the history
  29. x86/boot: Fix if_changed build flip/flop bug

    [ Upstream commit 92a4728 ]
    
    Dirk Gouders reported that two consecutive "make" invocations on an
    already compiled tree will show alternating behaviors:
    
    $ make
      CALL    scripts/checksyscalls.sh
      DESCEND  objtool
      CHK     include/generated/compile.h
      DATAREL arch/x86/boot/compressed/vmlinux
    Kernel: arch/x86/boot/bzImage is ready  (Freescale#48)
      Building modules, stage 2.
      MODPOST 165 modules
    
    $ make
      CALL    scripts/checksyscalls.sh
      DESCEND  objtool
      CHK     include/generated/compile.h
      LD      arch/x86/boot/compressed/vmlinux
      ZOFFSET arch/x86/boot/zoffset.h
      AS      arch/x86/boot/header.o
      LD      arch/x86/boot/setup.elf
      OBJCOPY arch/x86/boot/setup.bin
      OBJCOPY arch/x86/boot/vmlinux.bin
      BUILD   arch/x86/boot/bzImage
    Setup is 15644 bytes (padded to 15872 bytes).
    System is 6663 kB
    CRC 3eb90f40
    Kernel: arch/x86/boot/bzImage is ready  (Freescale#48)
      Building modules, stage 2.
      MODPOST 165 modules
    
    He bisected it back to:
    
        commit 98f7852 ("x86/boot: Refuse to build with data relocations")
    
    The root cause was the use of the "if_changed" kbuild function multiple
    times for the same target. It was designed to only be used once per
    target, otherwise it will effectively always trigger, flipping back and
    forth between the two commands getting recorded by "if_changed". Instead,
    this patch merges the two commands into a single function to get stable
    build artifacts (i.e. .vmlinux.cmd), and a single build behavior.
    
    Bisected-and-Reported-by: Dirk Gouders <dirk@gouders.net>
    Fix-Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Link: http://lkml.kernel.org/r/20180724230827.GA37823@beast
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    kees authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    f3c2846 View commit details
    Browse the repository at this point in the history
  30. fscache: Allow cancelled operations to be enqueued

    [ Upstream commit d0eb06a ]
    
    Alter the state-check assertion in fscache_enqueue_operation() to allow
    cancelled operations to be given processing time so they can be cleaned up.
    
    Also fix a debugging statement that was requiring such operations to have
    an object assigned.
    
    Fixes: 9ae326a ("CacheFiles: A cache that backs onto a mounted filesystem")
    Reported-by: Kiran Kumar Modukuri <kiran.modukuri@gmail.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    kiran-modukuri authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    1a0ffb5 View commit details
    Browse the repository at this point in the history
  31. cachefiles: Fix refcounting bug in backing-file read monitoring

    [ Upstream commit 934140a ]
    
    cachefiles_read_waiter() has the right to access a 'monitor' object by
    virtue of being called under the waitqueue lock for one of the pages in its
    purview.  However, it has no ref on that monitor object or on the
    associated operation.
    
    What it is allowed to do is to move the monitor object to the operation's
    to_do list, but once it drops the work_lock, it's actually no longer
    permitted to access that object.  However, it is trying to enqueue the
    retrieval operation for processing - but it can only do this via a pointer
    in the monitor object, something it shouldn't be doing.
    
    If it doesn't enqueue the operation, the operation may not get processed.
    If the order is flipped so that the enqueue is first, then it's possible
    for the work processor to look at the to_do list before the monitor is
    enqueued upon it.
    
    Fix this by getting a ref on the operation so that we can trust that it
    will still be there once we've added the monitor to the to_do list and
    dropped the work_lock.  The op can then be enqueued after the lock is
    dropped.
    
    The bug can manifest in one of a couple of ways.  The first manifestation
    looks like:
    
     FS-Cache:
     FS-Cache: Assertion failed
     FS-Cache: 6 == 5 is false
     ------------[ cut here ]------------
     kernel BUG at fs/fscache/operation.c:494!
     RIP: 0010:fscache_put_operation+0x1e3/0x1f0
     ...
     fscache_op_work_func+0x26/0x50
     process_one_work+0x131/0x290
     worker_thread+0x45/0x360
     kthread+0xf8/0x130
     ? create_worker+0x190/0x190
     ? kthread_cancel_work_sync+0x10/0x10
     ret_from_fork+0x1f/0x30
    
    This is due to the operation being in the DEAD state (6) rather than
    INITIALISED, COMPLETE or CANCELLED (5) because it's already passed through
    fscache_put_operation().
    
    The bug can also manifest like the following:
    
     kernel BUG at fs/fscache/operation.c:69!
     ...
        [exception RIP: fscache_enqueue_operation+246]
     ...
     Freescale#7 [ffff883fff083c10] fscache_enqueue_operation at ffffffffa0b793c6
     Freescale#8 [ffff883fff083c28] cachefiles_read_waiter at ffffffffa0b15a48
     Freescale#9 [ffff883fff083c48] __wake_up_common at ffffffff810af028
    
    I'm not entirely certain as to which is line 69 in Lei's kernel, so I'm not
    entirely clear which assertion failed.
    
    Fixes: 9ae326a ("CacheFiles: A cache that backs onto a mounted filesystem")
    Reported-by: Lei Xue <carmark.dlut@gmail.com>
    Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
    Reported-by: Anthony DeRobertis <aderobertis@metrics.net>
    Reported-by: NeilBrown <neilb@suse.com>
    Reported-by: Daniel Axtens <dja@axtens.net>
    Reported-by: Kiran Kumar Modukuri <kiran.modukuri@gmail.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Reviewed-by: Daniel Axtens <dja@axtens.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    kiran-modukuri authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    75960a4 View commit details
    Browse the repository at this point in the history
  32. cachefiles: Wait rather than BUG'ing on "Unexpected object collision"

    [ Upstream commit c2412ac ]
    
    If we meet a conflicting object that is marked FSCACHE_OBJECT_IS_LIVE in
    the active object tree, we have been emitting a BUG after logging
    information about it and the new object.
    
    Instead, we should wait for the CACHEFILES_OBJECT_ACTIVE flag to be cleared
    on the old object (or return an error).  The ACTIVE flag should be cleared
    after it has been removed from the active object tree.  A timeout of 60s is
    used in the wait, so we shouldn't be able to get stuck there.
    
    Fixes: 9ae326a ("CacheFiles: A cache that backs onto a mounted filesystem")
    Signed-off-by: Kiran Kumar Modukuri <kiran.modukuri@gmail.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    kiran-modukuri authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    6194fba View commit details
    Browse the repository at this point in the history
  33. selftests/ftrace: Add snapshot and tracing_on test case

    [ Upstream commit 82f4f3e ]
    
    Add a testcase for checking snapshot and tracing_on
    relationship. This ensures that the snapshotting doesn't
    affect current tracing on/off settings.
    
    Link: http://lkml.kernel.org/r/153149932412.11274.15289227592627901488.stgit@devbox
    
    Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
    Cc: Hiraku Toyooka <hiraku.toyooka@cybertrust.co.jp>
    Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: linux-kselftest@vger.kernel.org
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mhiramat authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    579381f View commit details
    Browse the repository at this point in the history
  34. zswap: re-check zswap_is_full() after do zswap_shrink()

    [ Upstream commit 16e536e ]
    
    /sys/../zswap/stored_pages keeps rising in a zswap test with
    "zswap.max_pool_percent=0" parameter.  But it should not compress or
    store pages any more since there is no space in the compressed pool.
    
    Reproduce steps:
      1. Boot kernel with "zswap.enabled=1"
      2. Set the max_pool_percent to 0
          # echo 0 > /sys/module/zswap/parameters/max_pool_percent
      3. Do memory stress test to see if some pages have been compressed
          # stress --vm 1 --vm-bytes $mem_available"M" --timeout 60s
      4. Watching the 'stored_pages' number increasing or not
    
    The root cause is:
    
      When zswap_max_pool_percent is set to 0 via kernel parameter,
      zswap_is_full() will always return true due to zswap_shrink().  But if
      the shinking is able to reclain a page successfully the code then
      proceeds to compressing/storing another page, so the value of
      stored_pages will keep changing.
    
    To solve the issue, this patch adds a zswap_is_full() check again after
      zswap_shrink() to make sure it's now under the max_pool_percent, and to
      not compress/store if we reached the limit.
    
    Link: http://lkml.kernel.org/r/20180530103936.17812-1-liwang@redhat.com
    Signed-off-by: Li Wang <liwang@redhat.com>
    Acked-by: Dan Streetman <ddstreet@ieee.org>
    Cc: Seth Jennings <sjenning@redhat.com>
    Cc: Huang Ying <huang.ying.caritas@gmail.com>
    Cc: Yu Zhao <yuzhao@google.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    wangli5665 authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    b55993f View commit details
    Browse the repository at this point in the history
  35. tools/power turbostat: Read extended processor family from CPUID

    [ Upstream commit 5aa3d1a ]
    
    This fixes the reported family on modern AMD processors (e.g. Ryzen,
    which is family 0x17). Previously these processors all showed up as
    family 0xf.
    
    See the document
    https://support.amd.com/TechDocs/56255_OSRR.pdf
    section CPUID_Fn00000001_EAX for how to calculate the family
    from the BaseFamily and ExtFamily values.
    
    This matches the code in arch/x86/lib/cpu.c
    
    Signed-off-by: Calvin Walton <calvin.walton@kepstin.ca>
    Signed-off-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    kepstin authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    d0995e1 View commit details
    Browse the repository at this point in the history
  36. Revert "MIPS: BCM47XX: Enable 74K Core ExternalSync for PCIe erratum"

    [ Upstream commit d5ea019 ]
    
    This reverts commit 2a027b4 ("MIPS: BCM47XX: Enable 74K Core
    ExternalSync for PCIe erratum").
    
    Enabling ExternalSync caused a regression for BCM4718A1 (used e.g. in
    Netgear E3000 and ASUS RT-N16): it simply hangs during PCIe
    initialization. It's likely that BCM4717A1 is also affected.
    
    I didn't notice that earlier as the only BCM47XX devices with PCIe I
    own are:
    1) BCM4706 with 2 x 14e4:4331
    2) BCM4706 with 14e4:4360 and 14e4:4331
    it appears that BCM4706 is unaffected.
    
    While BCM5300X-ES300-RDS.pdf seems to document that erratum and its
    workarounds (according to quotes provided by Tokunori) it seems not even
    Broadcom follows them.
    
    According to the provided info Broadcom should define CONF7_ES in their
    SDK's mipsinc.h and implement workaround in the si_mips_init(). Checking
    both didn't reveal such code. It *could* mean Broadcom also had some
    problems with the given workaround.
    
    Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
    Signed-off-by: Paul Burton <paul.burton@mips.com>
    Reported-by: Michael Marley <michael@michaelmarley.com>
    Patchwork: https://patchwork.linux-mips.org/patch/20032/
    URL: https://bugs.openwrt.org/index.php?do=details&task_id=1688
    Cc: Tokunori Ikegami <ikegami@allied-telesis.co.jp>
    Cc: Hauke Mehrtens <hauke@hauke-m.de>
    Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
    Cc: James Hogan <jhogan@kernel.org>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: linux-mips@linux-mips.org
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Rafał Miłecki authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    5f56ddc View commit details
    Browse the repository at this point in the history
  37. enic: handle mtu change for vf properly

    [ Upstream commit ab123fe ]
    
    When driver gets notification for mtu change, driver does not handle it for
    all RQs. It handles only RQ[0].
    
    Fix is to use enic_change_mtu() interface to change mtu for vf.
    
    Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Govindarajulu Varadarajan authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    9bf9e4a View commit details
    Browse the repository at this point in the history
  38. arc: [plat-eznps] fix data type errors in platform headers

    [ Upstream commit b1f32ce ]
    
    Add <linux/types.h> to fix build errors.
    Both ctop.h and <soc/nps/common.h> use u32 types and cause many
    errors.
    
    Examples:
    ../include/soc/nps/common.h:71:4: error: unknown type name 'u32'
        u32 __reserved:20, cluster:4, core:4, thread:4;
    ../include/soc/nps/common.h:76:3: error: unknown type name 'u32'
       u32 value;
    ../include/soc/nps/common.h:124:4: error: unknown type name 'u32'
        u32 base:8, cl_x:4, cl_y:4,
    ../include/soc/nps/common.h:127:3: error: unknown type name 'u32'
       u32 value;
    
    ../arch/arc/plat-eznps/include/plat/ctop.h:83:4: error: unknown type name 'u32'
        u32 gen:1, gdis:1, clk_gate_dis:1, asb:1,
    ../arch/arc/plat-eznps/include/plat/ctop.h:86:3: error: unknown type name 'u32'
       u32 value;
    ../arch/arc/plat-eznps/include/plat/ctop.h:93:4: error: unknown type name 'u32'
        u32 csa:22, dmsid:6, __reserved:3, cs:1;
    ../arch/arc/plat-eznps/include/plat/ctop.h:95:3: error: unknown type name 'u32'
       u32 value;
    
    Cc: linux-snps-arc@lists.infradead.org
    Cc: Ofer Levi <oferle@mellanox.com>
    Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rddunlap authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    fcc80f8 View commit details
    Browse the repository at this point in the history
  39. arc: fix build errors in arc/include/asm/delay.h

    [ Upstream commit 2423665 ]
    
    Fix build errors in arch/arc/'s delay.h:
    - add "extern unsigned long loops_per_jiffy;"
    - add <asm-generic/types.h> for "u64"
    
    In file included from ../drivers/infiniband/hw/cxgb3/cxio_hal.c:32:
    ../arch/arc/include/asm/delay.h: In function '__udelay':
    ../arch/arc/include/asm/delay.h:61:12: error: 'u64' undeclared (first use in this function)
      loops = ((u64) usecs * 4295 * HZ * loops_per_jiffy) >> 32;
                ^~~
    
    In file included from ../drivers/infiniband/hw/cxgb3/cxio_hal.c:32:
    ../arch/arc/include/asm/delay.h: In function '__udelay':
    ../arch/arc/include/asm/delay.h:63:37: error: 'loops_per_jiffy' undeclared (first use in this function)
      loops = ((u64) usecs * 4295 * HZ * loops_per_jiffy) >> 32;
                                         ^~~~~~~~~~~~~~~
    
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Cc: Vineet Gupta <vgupta@synopsys.com>
    Cc: linux-snps-arc@lists.infradead.org
    Cc: Elad Kanfi <eladkan@mellanox.com>
    Cc: Leon Romanovsky <leonro@mellanox.com>
    Cc: Ofer Levi <oferle@mellanox.com>
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rddunlap authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    6e64609 View commit details
    Browse the repository at this point in the history
  40. arc: fix type warnings in arc/mm/cache.c

    [ Upstream commit ec837d6 ]
    
    Fix type warnings in arch/arc/mm/cache.c.
    
    ../arch/arc/mm/cache.c: In function 'flush_anon_page':
    ../arch/arc/mm/cache.c:1062:55: warning: passing argument 2 of '__flush_dcache_page' makes integer from pointer without a cast [-Wint-conversion]
      __flush_dcache_page((phys_addr_t)page_address(page), page_address(page));
                                                           ^~~~~~~~~~~~~~~~~~
    ../arch/arc/mm/cache.c:1013:59: note: expected 'long unsigned int' but argument is of type 'void *'
     void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr)
                                                 ~~~~~~~~~~~~~~^~~~~
    
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Cc: Vineet Gupta <vgupta@synopsys.com>
    Cc: linux-snps-arc@lists.infradead.org
    Cc: Elad Kanfi <eladkan@mellanox.com>
    Cc: Leon Romanovsky <leonro@mellanox.com>
    Cc: Ofer Levi <oferle@mellanox.com>
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rddunlap authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    8620db8 View commit details
    Browse the repository at this point in the history
  41. squashfs metadata 2: electric boogaloo

    [ Upstream commit cdbb65c ]
    
    Anatoly continues to find issues with fuzzed squashfs images.
    
    This time, corrupt, missing, or undersized data for the page filling
    wasn't checked for, because the squashfs_{copy,read}_cache() functions
    did the squashfs_copy_data() call without checking the resulting data
    size.
    
    Which could result in the page cache pages being incompletely filled in,
    and no error indication to the user space reading garbage data.
    
    So make a helper function for the "fill in pages" case, because the
    exact same incomplete sequence existed in two places.
    
    [ I should have made a squashfs branch for these things, but I didn't
      intend to start doing them in the first place.
    
      My historical connection through cramfs is why I got into looking at
      these issues at all, and every time I (continue to) think it's a
      one-off.
    
      Because _this_ time is always the last time. Right?   - Linus ]
    
    Reported-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
    Tested-by: Willy Tarreau <w@1wt.eu>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Phillip Lougher <phillip@squashfs.org.uk>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    torvalds authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    ab99a2b View commit details
    Browse the repository at this point in the history
  42. Squashfs: Compute expected length from inode size rather than block l…

    …ength
    
    [ Upstream commit a3f94cb ]
    
    Previously in squashfs_readpage() when copying data into the page
    cache, it used the length of the datablock read from the filesystem
    (after decompression).  However, if the filesystem has been corrupted
    this data block may be short, which will leave pages unfilled.
    
    The fix for this is to compute the expected number of bytes to copy
    from the inode size, and use this to detect if the block is short.
    
    Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
    Tested-by: Willy Tarreau <w@1wt.eu>
    Cc: Анатолий Тросиненко <anatoly.trosinenko@gmail.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    plougher authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    6b9882c View commit details
    Browse the repository at this point in the history
  43. drivers: net: lmc: fix case value for target abort error

    [ Upstream commit afb41bb ]
    
    Current value for a target abort error is 0x010, however, this value
    should in fact be 0x002.  As it stands, the range of error is 0..7 so
    it is currently never being detected.  This bug has been in the driver
    since the early 2.6.12 days (or before).
    
    Detected by CoverityScan, CID#744290 ("Logically dead code")
    
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Colin Ian King authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a6c6516 View commit details
    Browse the repository at this point in the history
  44. memcg: remove memcg_cgroup::id from IDR on mem_cgroup_css_alloc() fai…

    …lure
    
    [ Upstream commit 7e97de0 ]
    
    In case of memcg_online_kmem() failure, memcg_cgroup::id remains hashed
    in mem_cgroup_idr even after memcg memory is freed.  This leads to leak
    of ID in mem_cgroup_idr.
    
    This patch adds removal into mem_cgroup_css_alloc(), which fixes the
    problem.  For better readability, it adds a generic helper which is used
    in mem_cgroup_alloc() and mem_cgroup_id_put_many() as well.
    
    Link: http://lkml.kernel.org/r/152354470916.22460.14397070748001974638.stgit@localhost.localdomain
    Fixes 73f576c ("mm: memcontrol: fix cgroup creation failure after many small jobs")
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Acked-by: Vladimir Davydov <vdavydov.dev@gmail.com>
    Cc: Michal Hocko <mhocko@kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Kirill Tkhai authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    f108e46 View commit details
    Browse the repository at this point in the history
  45. scsi: fcoe: drop frames in ELS LOGO error path

    [ Upstream commit 63d0e3d ]
    
    Drop the frames in the ELS LOGO error path instead of just returning an
    error.
    
    This fixes the following kmemleak report:
    unreferenced object 0xffff880064cb1000 (size 424):
      comm "kworker/0:2", pid 24, jiffies 4294904293 (age 68.504s)
      hex dump (first 32 bytes):
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
      backtrace:
        [<(____ptrval____)>] _fc_frame_alloc+0x2c/0x180 [libfc]
        [<(____ptrval____)>] fc_lport_enter_logo+0x106/0x360 [libfc]
        [<(____ptrval____)>] fc_fabric_logoff+0x8c/0xc0 [libfc]
        [<(____ptrval____)>] fcoe_if_destroy+0x79/0x3b0 [fcoe]
        [<(____ptrval____)>] fcoe_destroy_work+0xd2/0x170 [fcoe]
        [<(____ptrval____)>] process_one_work+0x7ff/0x1420
        [<(____ptrval____)>] worker_thread+0x87/0xef0
        [<(____ptrval____)>] kthread+0x2db/0x390
        [<(____ptrval____)>] ret_from_fork+0x35/0x40
        [<(____ptrval____)>] 0xffffffffffffffff
    
    which can be triggered by issuing
    echo eth0 > /sys/bus/fcoe/ctlr_destroy
    
    Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: Hannes Reinecke <hare@suse.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Johannes Thumshirn authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    cfbe3ca View commit details
    Browse the repository at this point in the history
  46. scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO

    [ Upstream commit 1550ec4 ]
    
    When receiving a LOGO request we forget to clear the FC_RP_STARTED flag
    before starting the rport delete routine.
    
    As the started flag was not cleared, we're not deleting the rport but
    waiting for a restart and thus are keeping the reference count of the rdata
    object at 1.
    
    This leads to the following kmemleak report:
    unreferenced object 0xffff88006542aa00 (size 512):
      comm "kworker/0:2", pid 24, jiffies 4294899222 (age 226.880s)
      hex dump (first 32 bytes):
        68 96 fe 65 00 88 ff ff 00 00 00 00 00 00 00 00  h..e............
        01 00 00 00 08 00 00 00 02 c5 45 24 ac b8 00 10  ..........E$....
      backtrace:
        [<(____ptrval____)>] fcoe_ctlr_vn_add.isra.5+0x7f/0x770 [libfcoe]
        [<(____ptrval____)>] fcoe_ctlr_vn_recv+0x12af/0x27f0 [libfcoe]
        [<(____ptrval____)>] fcoe_ctlr_recv_work+0xd01/0x32f0 [libfcoe]
        [<(____ptrval____)>] process_one_work+0x7ff/0x1420
        [<(____ptrval____)>] worker_thread+0x87/0xef0
        [<(____ptrval____)>] kthread+0x2db/0x390
        [<(____ptrval____)>] ret_from_fork+0x35/0x40
        [<(____ptrval____)>] 0xffffffffffffffff
    
    Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
    Reported-by: ard <ard@kwaak.net>
    Reviewed-by: Hannes Reinecke <hare@suse.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Johannes Thumshirn authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a887157 View commit details
    Browse the repository at this point in the history
  47. scsi: vmw_pvscsi: Return DID_RESET for status SAM_STAT_COMMAND_TERMIN…

    …ATED
    
    [ Upstream commit e95153b ]
    
    Commands that are reset are returned with status
    SAM_STAT_COMMAND_TERMINATED. PVSCSI currently returns DID_OK |
    SAM_STAT_COMMAND_TERMINATED which fails the command. Instead, set hostbyte
    to DID_RESET to allow upper layers to retry.
    
    Tested by copying a large file between two pvscsi disks on same adapter
    while performing a bus reset at 1-second intervals. Before fix, commands
    sometimes fail with DID_OK. After fix, commands observed to fail with
    DID_RESET.
    
    Signed-off-by: Jim Gill <jgill@vmware.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Jim Gill authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    b88f17e View commit details
    Browse the repository at this point in the history
  48. mm/memory.c: check return value of ioremap_prot

    [ Upstream commit 24eee1e ]
    
    ioremap_prot() can return NULL which could lead to an oops.
    
    Link: http://lkml.kernel.org/r/1533195441-58594-1-git-send-email-chenjie6@huawei.com
    Signed-off-by: chen jie <chenjie6@huawei.com>
    Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
    Cc: Li Zefan <lizefan@huawei.com>
    Cc: chenjie <chenjie6@huawei.com>
    Cc: Yang Shi <shy828301@gmail.com>
    Cc: Alexey Dobriyan <adobriyan@gmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jie@chenjie6@huwei.com authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    af669a0 View commit details
    Browse the repository at this point in the history
  49. sched/sysctl: Check user input value of sysctl_sched_time_avg

    commit 5ccba44 upstream.
    
    System will hang if user set sysctl_sched_time_avg to 0:
    
      [root@XXX ~]# sysctl kernel.sched_time_avg_ms=0
    
      Stack traceback for pid 0
      0xffff883f6406c600 0 0 1 3 R 0xffff883f6406cf50 *swapper/3
      ffff883f7ccc3ae8 0000000000000018 ffffffff810c4dd0 0000000000000000
      0000000000017800 ffff883f7ccc3d78 0000000000000003 ffff883f7ccc3bf8
      ffffffff810c4fc9 ffff883f7ccc3c08 00000000810c5043 ffff883f7ccc3c08
      Call Trace:
      <IRQ> [<ffffffff810c4dd0>] ? update_group_capacity+0x110/0x200
      [<ffffffff810c4fc9>] ? update_sd_lb_stats+0x109/0x600
      [<ffffffff810c5507>] ? find_busiest_group+0x47/0x530
      [<ffffffff810c5b84>] ? load_balance+0x194/0x900
      [<ffffffff810ad5ca>] ? update_rq_clock.part.83+0x1a/0xe0
      [<ffffffff810c6d42>] ? rebalance_domains+0x152/0x290
      [<ffffffff810c6f5c>] ? run_rebalance_domains+0xdc/0x1d0
      [<ffffffff8108a75b>] ? __do_softirq+0xfb/0x320
      [<ffffffff8108ac85>] ? irq_exit+0x125/0x130
      [<ffffffff810b3a17>] ? scheduler_ipi+0x97/0x160
      [<ffffffff81052709>] ? smp_reschedule_interrupt+0x29/0x30
      [<ffffffff8173a1be>] ? reschedule_interrupt+0x6e/0x80
       <EOI> [<ffffffff815bc83c>] ? cpuidle_enter_state+0xcc/0x230
      [<ffffffff815bc80c>] ? cpuidle_enter_state+0x9c/0x230
      [<ffffffff815bc9d7>] ? cpuidle_enter+0x17/0x20
      [<ffffffff810cd6dc>] ? cpu_startup_entry+0x38c/0x420
      [<ffffffff81053373>] ? start_secondary+0x173/0x1e0
    
    Because divide-by-zero error happens in function:
    
    update_group_capacity()
      update_cpu_capacity()
        scale_rt_capacity()
         {
              ...
              total = sched_avg_period() + delta;
              used = div_u64(avg, total);
              ...
         }
    
    To fix this issue, check user input value of sysctl_sched_time_avg, keep
    it unchanged when hitting invalid input, and set the minimum limit of
    sysctl_sched_time_avg to 1 ms.
    
    Reported-by: James Puthukattukaran <james.puthukattukaran@oracle.com>
    Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: efault@gmx.de
    Cc: ethan.kernel@gmail.com
    Cc: keescook@chromium.org
    Cc: mcgrof@kernel.org
    Cc: <stable@vger.kernel.org>
    Link: http://lkml.kernel.org/r/1504504774-18253-1-git-send-email-ethan.zhao@oracle.com
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Cc: Steve Muckle <smuckle@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Ethan Zhao authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    fe0034a View commit details
    Browse the repository at this point in the history
  50. Cipso: cipso_v4_optptr enter infinite loop

    commit 4041395 upstream.
    
    in for(),if((optlen > 0) && (optptr[1] == 0)), enter infinite loop.
    
    Test: receive a packet which the ip length > 20 and the first byte of ip option is 0, produce this issue
    
    Signed-off-by: yujuan.qi <yujuan.qi@mediatek.com>
    Acked-by: Paul Moore <paul@paul-moore.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    yujuan.qi authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    e8e519f View commit details
    Browse the repository at this point in the history
  51. mei: don't update offset in write

    commit a103af1 upstream.
    
    MEI enables writes of complete messages only
    while read can be performed in parts, hence
    write should not update the file offset to
    not break interleaving partial reads with writes.
    
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
    Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ausyskin authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    b653d47 View commit details
    Browse the repository at this point in the history
  52. cifs: add missing debug entries for kconfig options

    commit 950132a upstream.
    
    /proc/fs/cifs/DebugData displays the features (Kconfig options)
    used to build cifs.ko but it was missing some, and needed comma
    separator.  These can be useful in debugging certain problems
    so we know which optional features were enabled in the user's build.
    Also clarify them, by making them more closely match the
    corresponding CONFIG_CIFS_* parm.
    
    Old format:
    Features: dfs fscache posix spnego xattr acl
    
    New format:
    Features: DFS,FSCACHE,SMB_DIRECT,STATS,DEBUG2,ALLOW_INSECURE_LEGACY,CIFS_POSIX,UPCALL(SPNEGO),XATTR,ACL
    
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
    Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
    Reviewed-by: Paulo Alcantara <palcantara@suse.de>
    CC: Stable <stable@vger.kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Steve French authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    fbd314e View commit details
    Browse the repository at this point in the history
  53. cifs: check kmalloc before use

    commit 126c97f upstream.
    
    The kmalloc was not being checked - if it fails issue a warning
    and return -ENOMEM to the caller.
    
    Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
    Fixes: b8da344 ("cifs: dynamic allocation of ntlmssp blob")
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
    cc: Stable <stable@vger.kernel.org>`
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Nicholas Mc Guire authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    c773c4f View commit details
    Browse the repository at this point in the history
  54. smb3: enumerating snapshots was leaving part of the data off end

    commit e02789a upstream.
    
    When enumerating snapshots, the last few bytes of the final
    snapshot could be left off since we were miscalculating the
    length returned (leaving off the sizeof struct SRV_SNAPSHOT_ARRAY)
    See MS-SMB2 section 2.2.32.2. In addition fixup the length used
    to allow smaller buffer to be passed in, in order to allow
    returning the size of the whole snapshot array more easily.
    
    Sample userspace output with a kernel patched with this
    (mounted to a Windows volume with two snapshots).
    Before this patch, the second snapshot would be missing a
    few bytes at the end.
    
    ~/cifs-2.6# ~/enum-snapshots /mnt/file
    press enter to issue the ioctl to retrieve snapshot information ...
    
    size of snapshot array = 102
    Num snapshots: 2 Num returned: 2 Array Size: 102
    
    Snapshot 0:@GMT-2018.06.30-19.34.17
    Snapshot 1:@GMT-2018.06.30-19.33.37
    
    CC: Stable <stable@vger.kernel.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Steve French authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a94703f View commit details
    Browse the repository at this point in the history
  55. smb3: Do not send SMB3 SET_INFO if nothing changed

    commit fd09b7d upstream.
    
    An earlier commit had a typo which prevented the
    optimization from working:
    
    commit 18dd8e1 ("Do not send SMB3 SET_INFO request if nothing is changing")
    
    Thank you to Metze for noticing this.  Also clear a
    reserved field in the FILE_BASIC_INFO struct we send
    that should be zero (all the other fields in that
    struct were set or cleared explicitly already in
    cifs_set_file_info).
    
    Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
    CC: Stable <stable@vger.kernel.org> # 4.9.x+
    Reported-by: Stefan Metzmacher <metze@samba.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Steve French authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    707b0d2 View commit details
    Browse the repository at this point in the history
  56. smb3: don't request leases in symlink creation and query

    commit 2278315 upstream.
    
    Fixes problem pointed out by Pavel in discussions about commit
    729c0c9
    
    Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
    CC: Stable <stable@vger.kernel.org> # 3.18.x+
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Steve French authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    893b282 View commit details
    Browse the repository at this point in the history
  57. kprobes/arm64: Fix %p uses in error messages

    commit 0722867 upstream.
    
    Fix %p uses in error messages by removing it because
    those are redundant or meaningless.
    
    Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
    Acked-by: Will Deacon <will.deacon@arm.com>
    Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
    Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: David Howells <dhowells@redhat.com>
    Cc: David S . Miller <davem@davemloft.net>
    Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
    Cc: Jon Medhurst <tixy@linaro.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Thomas Richter <tmricht@linux.ibm.com>
    Cc: Tobin C . Harding <me@tobin.cc>
    Cc: acme@kernel.org
    Cc: akpm@linux-foundation.org
    Cc: brueckner@linux.vnet.ibm.com
    Cc: linux-arch@vger.kernel.org
    Cc: rostedt@goodmis.org
    Cc: schwidefsky@de.ibm.com
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/lkml/152491908405.9916.12425053035317241111.stgit@devbox
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mhiramat authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    52ea94f View commit details
    Browse the repository at this point in the history
  58. arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

    commit 5ad356e upstream.
    
    ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input
    before seeing if the PFN is valid.  This leads to false positives when
    some of the upper bits are set, but the lower bits match a valid PFN.
    
    For example, the following userspace code looks up a bogus entry in
    /proc/kpageflags:
    
        int pagemap = open("/proc/self/pagemap", O_RDONLY);
        int pageflags = open("/proc/kpageflags", O_RDONLY);
        uint64_t pfn, val;
    
        lseek64(pagemap, [...], SEEK_SET);
        read(pagemap, &pfn, sizeof(pfn));
        if (pfn & (1UL << 63)) {        /* valid PFN */
            pfn &= ((1UL << 55) - 1);   /* clear flag bits */
            pfn |= (1UL << 55);
            lseek64(pageflags, pfn * sizeof(uint64_t), SEEK_SET);
            read(pageflags, &val, sizeof(val));
        }
    
    On ARM64 this causes the userspace process to crash with SIGSEGV rather
    than reading (1 << KPF_NOPAGE).  kpageflags_read() treats the offset as
    valid, and stable_page_flags() will try to access an address between the
    user and kernel address ranges.
    
    Fixes: c1cc155 ("arm64: MMU initialisation")
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Hackmann <ghackmann@google.com>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    greghackmann authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a963711 View commit details
    Browse the repository at this point in the history
  59. s390/kvm: fix deadlock when killed by oom

    commit 306d6c4 upstream.
    
    When the oom killer kills a userspace process in the page fault handler
    while in guest context, the fault handler fails to release the mm_sem
    if the FAULT_FLAG_RETRY_NOWAIT option is set. This leads to a deadlock
    when tearing down the mm when the process terminates. This bug can only
    happen when pfault is enabled, so only KVM clients are affected.
    
    The problem arises in the rare cases in which handle_mm_fault does not
    release the mm_sem. This patch fixes the issue by manually releasing
    the mm_sem when needed.
    
    Fixes: 24eb3a8 ("KVM: s390: Add FAULT_FLAG_RETRY_NOWAIT for guest fault")
    Cc: <stable@vger.kernel.org> # 3.15+
    Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Claudio Imbrenda authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    1ad4098 View commit details
    Browse the repository at this point in the history
  60. ext4: check for NUL characters in extended attribute's name

    commit 7d95178 upstream.
    
    Extended attribute names are defined to be NUL-terminated, so the name
    must not contain a NUL character.  This is important because there are
    places when remove extended attribute, the code uses strlen to
    determine the length of the entry.  That should probably be fixed at
    some point, but code is currently really messy, so the simplest fix
    for now is to simply validate that the extended attributes are sane.
    
    https://bugzilla.kernel.org/show_bug.cgi?id=200401
    
    Reported-by: Wen Xu <wen.xu@gatech.edu>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tytso authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    9c2860f View commit details
    Browse the repository at this point in the history
  61. ext4: sysfs: print ext4_super_block fields as little-endian

    commit a4d2aad upstream.
    
    While working on extended rand for last_error/first_error timestamps,
    I noticed that the endianess is wrong; we access the little-endian
    fields in struct ext4_super_block as native-endian when we print them.
    
    This adds a special case in ext4_attr_show() and ext4_attr_store()
    to byteswap the superblock fields if needed.
    
    In older kernels, this code was part of super.c, it got moved to
    sysfs.c in linux-4.4.
    
    Cc: stable@vger.kernel.org
    Fixes: 52c198c ("ext4: add sysfs entry showing whether the fs contains errors")
    Reviewed-by: Andreas Dilger <adilger@dilger.ca>
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    arndb authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    e0cfc1c View commit details
    Browse the repository at this point in the history
  62. ext4: reset error code in ext4_find_entry in fallback

    commit f39b3f4 upstream.
    
    When ext4_find_entry() falls back to "searching the old fashioned
    way" due to a corrupt dx dir, it needs to reset the error code
    to NULL so that the nonstandard ERR_BAD_DX_DIR code isn't returned
    to userspace.
    
    https://bugzilla.kernel.org/show_bug.cgi?id=199947
    
    Reported-by: Anatoly Trosinenko <anatoly.trosinenko@yandex.com>
    Reviewed-by: Andreas Dilger <adilger@dilger.ca>
    Signed-off-by: Eric Sandeen <sandeen@redhat.com>
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Eric Sandeen authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    e85b9fb View commit details
    Browse the repository at this point in the history
  63. staging: android: ion: fix ION_IOC_{MAP,SHARE} use-after-free

    This patch is 4.9.y only.  Kernels 4.12 and later are unaffected, since
    all the underlying ion_handle infrastructure has been ripped out.
    
    The ION_IOC_{MAP,SHARE} ioctls drop and reacquire client->lock several
    times while operating on one of the client's ion_handles.  This creates
    windows where userspace can call ION_IOC_FREE on the same client with
    the same handle, and effectively make the kernel drop its own reference.
    For example:
    
    - thread A: ION_IOC_ALLOC creates an ion_handle with refcount 1
    - thread A: starts ION_IOC_MAP and increments the refcount to 2
    - thread B: ION_IOC_FREE decrements the refcount to 1
    - thread B: ION_IOC_FREE decrements the refcount to 0 and frees the
                handle
    - thread A: continues ION_IOC_MAP with a dangling ion_handle * to
                freed memory
    
    Fix this by holding client->lock for the duration of
    ION_IOC_{MAP,SHARE}, preventing the concurrent ION_IOC_FREE.  Also
    remove ion_handle_get_by_id(), since there's literally no way to use it
    safely.
    
    Cc: stable@vger.kernel.org # v4.11-
    Signed-off-by: Greg Hackmann <ghackmann@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    greghackmann authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    3fedc0c View commit details
    Browse the repository at this point in the history
  64. KVM: arm/arm64: Skip updating PTE entry if no change

    commit 976d34e upstream.
    
    When there is contention on faulting in a particular page table entry
    at stage 2, the break-before-make requirement of the architecture can
    lead to additional refaulting due to TLB invalidation.
    
    Avoid this by skipping a page table update if the new value of the PTE
    matches the previous value.
    
    Cc: stable@vger.kernel.org
    Fixes: d5d8184 ("KVM: ARM: Memory virtualization setup")
    Reviewed-by: Suzuki Poulose <suzuki.poulose@arm.com>
    Acked-by: Christoffer Dall <christoffer.dall@arm.com>
    Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
    Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    punitagrawal authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a22bdef View commit details
    Browse the repository at this point in the history
  65. KVM: arm/arm64: Skip updating PMD entry if no change

    commit 86658b8 upstream.
    
    Contention on updating a PMD entry by a large number of vcpus can lead
    to duplicate work when handling stage 2 page faults. As the page table
    update follows the break-before-make requirement of the architecture,
    it can lead to repeated refaults due to clearing the entry and
    flushing the tlbs.
    
    This problem is more likely when -
    
    * there are large number of vcpus
    * the mapping is large block mapping
    
    such as when using PMD hugepages (512MB) with 64k pages.
    
    Fix this by skipping the page table update if there is no change in
    the entry being updated.
    
    Cc: stable@vger.kernel.org
    Fixes: ad361f0 ("KVM: ARM: Support hugetlbfs backed huge pages")
    Reviewed-by: Suzuki Poulose <suzuki.poulose@arm.com>
    Acked-by: Christoffer Dall <christoffer.dall@arm.com>
    Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
    Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    punitagrawal authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    7fb227e View commit details
    Browse the repository at this point in the history
  66. sparc: kernel/pcic: silence gcc 7.x warning in pcibios_fixup_bus()

    commit 2dc7753 upstream.
    
    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 <thomas.petazzoni@free-electrons.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tpetazzoni authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    cd4fdbb View commit details
    Browse the repository at this point in the history
  67. x86/speculation/l1tf: Fix overflow in l1tf_pfn_limit() on 32bit

    commit 9df9516 upstream.
    
    On 32bit PAE kernels on 64bit hardware with enough physical bits,
    l1tf_pfn_limit() will overflow unsigned long. This in turn affects
    max_swapfile_size() and can lead to swapon returning -EINVAL. This has been
    observed in a 32bit guest with 42 bits physical address size, where
    max_swapfile_size() overflows exactly to 1 << 32, thus zero, and produces
    the following warning to dmesg:
    
    [    6.396845] Truncating oversized swap area, only using 0k out of 2047996k
    
    Fix this by using unsigned long long instead.
    
    Fixes: 17dbca1 ("x86/speculation/l1tf: Add sysfs reporting for l1tf")
    Fixes: 377eeaa ("x86/speculation/l1tf: Limit swap file size to MAX_PA/2")
    Reported-by: Dominique Leuenberger <dimstar@suse.de>
    Reported-by: Adrian Schroeter <adrian@suse.de>
    Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Acked-by: Andi Kleen <ak@linux.intel.com>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Cc: "H . Peter Anvin" <hpa@zytor.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Dave Hansen <dave.hansen@intel.com>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180820095835.5298-1-vbabka@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tehcaster authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    fe0f404 View commit details
    Browse the repository at this point in the history
  68. x86/speculation/l1tf: Fix off-by-one error when warning that system h…

    …as too much RAM
    
    commit b0a182f upstream.
    
    Two users have reported [1] that they have an "extremely unlikely" system
    with more than MAX_PA/2 memory and L1TF mitigation is not effective. In
    fact it's a CPU with 36bits phys limit (64GB) and 32GB memory, but due to
    holes in the e820 map, the main region is almost 500MB over the 32GB limit:
    
    [    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000081effffff] usable
    
    Suggestions to use 'mem=32G' to enable the L1TF mitigation while losing the
    500MB revealed, that there's an off-by-one error in the check in
    l1tf_select_mitigation().
    
    l1tf_pfn_limit() returns the last usable pfn (inclusive) and the range
    check in the mitigation path does not take this into account.
    
    Instead of amending the range check, make l1tf_pfn_limit() return the first
    PFN which is over the limit which is less error prone. Adjust the other
    users accordingly.
    
    [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536
    
    Fixes: 17dbca1 ("x86/speculation/l1tf: Add sysfs reporting for l1tf")
    Reported-by: George Anchev <studio@anchev.net>
    Reported-by: Christopher Snowhill <kode54@gmail.com>
    Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: "H . Peter Anvin" <hpa@zytor.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Dave Hansen <dave.hansen@intel.com>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180823134418.17008-1-vbabka@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tehcaster authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    f8d42d5 View commit details
    Browse the repository at this point in the history
  69. x86/speculation/l1tf: Suggest what to do on systems with too much RAM

    commit 6a01228 upstream.
    
    Two users have reported [1] that they have an "extremely unlikely" system
    with more than MAX_PA/2 memory and L1TF mitigation is not effective.
    
    Make the warning more helpful by suggesting the proper mem=X kernel boot
    parameter to make it effective and a link to the L1TF document to help
    decide if the mitigation is worth the unusable RAM.
    
    [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536
    
    Suggested-by: Michal Hocko <mhocko@suse.com>
    Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Cc: "H . Peter Anvin" <hpa@zytor.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Dave Hansen <dave.hansen@intel.com>
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/966571f0-9d7f-43dc-92c6-a10eec7a1254@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tehcaster authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    2421738 View commit details
    Browse the repository at this point in the history
  70. x86/process: Re-export start_thread()

    commit dc76803 upstream.
    
    The consolidation of the start_thread() functions removed the export
    unintentionally. This breaks binfmt handlers built as a module.
    
    Add it back.
    
    Fixes: e634d8f ("x86-64: merge the standard and compat start_thread() functions")
    Signed-off-by: Rian Hunter <rian@alum.mit.edu>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Borislav Petkov <bpetkov@suse.de>
    Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
    Cc: Joerg Roedel <jroedel@suse.de>
    Cc: Dmitry Safonov <dima@arista.com>
    Cc: Josh Poimboeuf <jpoimboe@redhat.com>
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180819230854.7275-1-rian@alum.mit.edu
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rianhunter authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    62cfd81 View commit details
    Browse the repository at this point in the history
  71. KVM: x86: SVM: Call x86_spec_ctrl_set_guest/host() with interrupts di…

    …sabled
    
    commit 024d83c upstream.
    
    Mikhail reported the following lockdep splat:
    
    WARNING: possible irq lock inversion dependency detected
    CPU 0/KVM/10284 just changed the state of lock:
      000000000d538a88 (&st->lock){+...}, at:
      speculative_store_bypass_update+0x10b/0x170
    
    but this lock was taken by another, HARDIRQ-safe lock
    in the past:
    
    (&(&sighand->siglock)->rlock){-.-.}
    
       and interrupts could create inverse lock ordering between them.
    
    Possible interrupt unsafe locking scenario:
    
        CPU0                    CPU1
        ----                    ----
       lock(&st->lock);
                               local_irq_disable();
                               lock(&(&sighand->siglock)->rlock);
                               lock(&st->lock);
        <Interrupt>
         lock(&(&sighand->siglock)->rlock);
         *** DEADLOCK ***
    
    The code path which connects those locks is:
    
       speculative_store_bypass_update()
       ssb_prctl_set()
       do_seccomp()
       do_syscall_64()
    
    In svm_vcpu_run() speculative_store_bypass_update() is called with
    interupts enabled via x86_virt_spec_ctrl_set_guest/host().
    
    This is actually a false positive, because GIF=0 so interrupts are
    disabled even if IF=1; however, we can easily move the invocations of
    x86_virt_spec_ctrl_set_guest/host() into the interrupt disabled region to
    cure it, and it's a good idea to keep the GIF=0/IF=1 area as small
    and self-contained as possible.
    
    Fixes: 1f50ddb ("x86/speculation: Handle HT correctly on AMD")
    Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
    Cc: Joerg Roedel <joro@8bytes.org>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Radim Krčmář <rkrcmar@redhat.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Borislav Petkov <bp@suse.de>
    Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Tom Lendacky <thomas.lendacky@amd.com>
    Cc: kvm@vger.kernel.org
    Cc: x86@kernel.org
    Cc: stable@vger.kernel.org
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Thomas Gleixner authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    cd4574c View commit details
    Browse the repository at this point in the history
  72. x86/kvm/vmx: Remove duplicate l1d flush definitions

    commit 94d7a86 upstream.
    
    These are already defined higher up in the file.
    
    Fixes: 7db92e1 ("x86/kvm: Move l1tf setup function")
    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/d7ca03ae210d07173452aeed85ffe344301219a5.1534253536.git.jpoimboe@redhat.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jpoimboe authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    6a2346f View commit details
    Browse the repository at this point in the history
  73. fuse: Don't access pipe->buffers without pipe_lock()

    commit a2477b0 upstream.
    
    fuse_dev_splice_write() reads pipe->buffers to determine the size of
    'bufs' array before taking the pipe_lock(). This is not safe as
    another thread might change the 'pipe->buffers' between the allocation
    and taking the pipe_lock(). So we end up with too small 'bufs' array.
    
    Move the bufs allocations inside pipe_lock()/pipe_unlock() to fix this.
    
    Fixes: dd3bb14 ("fuse: support splice() writing to fuse device")
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
    Cc: <stable@vger.kernel.org> # v2.6.35
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    aryabinin authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    67a9e48 View commit details
    Browse the repository at this point in the history
  74. fuse: fix initial parallel dirops

    commit 63576c1 upstream.
    
    If parallel dirops are enabled in FUSE_INIT reply, then first operation may
    leave fi->mutex held.
    
    Reported-by: syzbot <syzbot+3f7b29af1baa9d0a55be@syzkaller.appspotmail.com>
    Fixes: 5c672ab ("fuse: serialize dirops by default")
    Cc: <stable@vger.kernel.org> # v4.7
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Miklos Szeredi authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    68fbfcb View commit details
    Browse the repository at this point in the history
  75. fuse: fix double request_end()

    commit 8711437 upstream.
    
    Refcounting of request is broken when fuse_abort_conn() is called and
    request is on the fpq->io list:
    
     - ref is taken too late
     - then it is not dropped
    
    Fixes: 0d8e84b ("fuse: simplify request abort")
    Cc: <stable@vger.kernel.org> # v4.2
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Miklos Szeredi authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    501c4ca View commit details
    Browse the repository at this point in the history
  76. fuse: fix unlocked access to processing queue

    commit 45ff350 upstream.
    
    fuse_dev_release() assumes that it's the only one referencing the
    fpq->processing list, but that's not true, since fuse_abort_conn() can be
    doing the same without any serialization between the two.
    
    Fixes: c369604 ("fuse: separate pqueue for clones")
    Cc: <stable@vger.kernel.org> # v4.2
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Miklos Szeredi authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    c66025c View commit details
    Browse the repository at this point in the history
  77. fuse: umount should wait for all requests

    commit b8f95e5 upstream.
    
    fuse_abort_conn() does not guarantee that all async requests have actually
    finished aborting (i.e. their ->end() function is called).  This could
    actually result in still used inodes after umount.
    
    Add a helper to wait until all requests are fully done.  This is done by
    looking at the "num_waiting" counter.  When this counter drops to zero, we
    can be sure that no more requests are outstanding.
    
    Fixes: 0d8e84b ("fuse: simplify request abort")
    Cc: <stable@vger.kernel.org> # v4.2
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Miklos Szeredi authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    6465d76 View commit details
    Browse the repository at this point in the history
  78. fuse: Fix oops at process_init_reply()

    commit e8f3bd7 upstream.
    
    syzbot is hitting NULL pointer dereference at process_init_reply().
    This is because deactivate_locked_super() is called before response for
    initial request is processed.
    
    Fix this by aborting and waiting for all requests (including FUSE_INIT)
    before resetting fc->sb.
    
    Original patch by Tetsuo Handa <penguin-kernel@I-love.SKAURA.ne.jp>.
    
    Reported-by: syzbot <syzbot+b62f08f4d5857755e3bc@syzkaller.appspotmail.com>
    Fixes: e27c9d3 ("fuse: fuse: add time_gran to INIT_OUT")
    Cc: <stable@vger.kernel.org> # v3.19
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Miklos Szeredi authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    263508c View commit details
    Browse the repository at this point in the history
  79. fuse: Add missed unlock_page() to fuse_readpages_fill()

    commit 109728c upstream.
    
    The above error path returns with page unlocked, so this place seems also
    to behave the same.
    
    Fixes: f8dbdf8 ("fuse: rework fuse_readpages()")
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Kirill Tkhai authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    01f0772 View commit details
    Browse the repository at this point in the history
  80. udl-kms: change down_interruptible to down

    commit 8456b99 upstream.
    
    If we leave urbs around, it causes not only leak, but also memory
    corruption. This patch fixes the function udl_free_urb_list, so that it
    always waits for all urbs that are in progress.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Mikulas Patocka authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    e0d786f View commit details
    Browse the repository at this point in the history
  81. udl-kms: handle allocation failure

    commit 542bb97 upstream.
    
    Allocations larger than PAGE_ALLOC_COSTLY_ORDER are unreliable and they
    may fail anytime. This patch fixes the udl kms driver so that when a large
    alloactions fails, it tries to do multiple smaller allocations.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Mikulas Patocka authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    73aa57a View commit details
    Browse the repository at this point in the history
  82. udl-kms: fix crash due to uninitialized memory

    commit 09a00ab upstream.
    
    We must use kzalloc when allocating the fb_deferred_io structure.
    Otherwise, the field first_io is undefined and it causes a crash.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Mikulas Patocka authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    268143e View commit details
    Browse the repository at this point in the history
  83. b43legacy/leds: Ensure NUL-termination of LED name string

    commit 4d77a89 upstream.
    
    strncpy might not NUL-terminate the string, if the name equals the buffer size.
    Use strlcpy instead.
    
    Signed-off-by: Michael Buesch <m@bues.ch>
    Cc: stable@vger.kernel.org
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mbuesch authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a8625b1 View commit details
    Browse the repository at this point in the history
  84. b43/leds: Ensure NUL-termination of LED name string

    commit 2aa650d upstream.
    
    strncpy might not NUL-terminate the string, if the name equals the buffer size.
    Use strlcpy instead.
    
    Signed-off-by: Michael Buesch <m@bues.ch>
    Cc: stable@vger.kernel.org
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mbuesch authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    4a92d74 View commit details
    Browse the repository at this point in the history
  85. ASoC: dpcm: don't merge format from invalid codec dai

    commit 4febced upstream.
    
    When merging codec formats, dpcm_runtime_base_format() should skip
    the codecs which are not supporting the current stream direction.
    
    At the moment, if a BE link has more than one codec, and only one
    of these codecs has no capture DAI, it becomes impossible to start
    a capture stream because the merged format would be 0.
    
    Skipping invalid codec DAI solves the problem.
    
    Fixes: b073ed4 ("ASoC: soc-pcm: DPCM cares BE format")
    Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jbrun3t authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    5304f2a View commit details
    Browse the repository at this point in the history
  86. ASoC: sirf: Fix potential NULL pointer dereference

    commit ae1c696 upstream.
    
    There is a potential execution path in which function
    platform_get_resource() returns NULL. If this happens,
    we will end up having a NULL pointer dereference.
    
    Fix this by replacing devm_ioremap with devm_ioremap_resource,
    which has the NULL check and the memory region request.
    
    This code was detected with the help of Coccinelle.
    
    Cc: stable@vger.kernel.org
    Fixes: 2bd8d1d ("ASoC: sirf: Add audio usp interface driver")
    Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    GustavoARSilva authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    b71230c View commit details
    Browse the repository at this point in the history
  87. pinctrl: freescale: off by one in imx1_pinconf_group_dbg_show()

    commit 19da44c upstream.
    
    The info->groups[] array is allocated in imx1_pinctrl_parse_dt().  It
    has info->ngroups elements.  Thus the > here should be >= to prevent
    reading one element beyond the end of the array.
    
    Cc: stable@vger.kernel.org
    Fixes: 30612cd ("pinctrl: imx1 core driver")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Uwe Kleine-König <u.kleine-könig@pengutronix.de>
    Acked-by: Dong Aisheng <Aisheng.dong@nxp.com>
    Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Dan Carpenter authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    597ea10 View commit details
    Browse the repository at this point in the history
  88. x86/irqflags: Mark native_restore_fl extern inline

    commit 1f59a45 upstream.
    
    This should have been marked extern inline in order to pick up the out
    of line definition in arch/x86/kernel/irqflags.S.
    
    Fixes: 208cbb3 ("x86/irqflags: Provide a declaration for native_save_fl")
    Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
    Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180827214011.55428-1-ndesaulniers@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    nickdesaulniers authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    c148246 View commit details
    Browse the repository at this point in the history
  89. x86/spectre: Add missing family 6 check to microcode check

    commit 1ab534e upstream.
    
    The check for Spectre microcodes does not check for family 6, only the
    model numbers.
    
    Add a family 6 check to avoid ambiguity with other families.
    
    Fixes: a5b2966 ("x86/cpufeature: Blacklist SPEC_CTRL/PRED_CMD on early Spectre v2 microcodes")
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: x86@kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180824170351.34874-2-andi@firstfloor.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Andi Kleen authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    d8fa9ed View commit details
    Browse the repository at this point in the history
  90. x86/speculation/l1tf: Increase l1tf memory limit for Nehalem+

    commit cc51e54 upstream.
    
    On Nehalem and newer core CPUs the CPU cache internally uses 44 bits
    physical address space. The L1TF workaround is limited by this internal
    cache address width, and needs to have one bit free there for the
    mitigation to work.
    
    Older client systems report only 36bit physical address space so the range
    check decides that L1TF is not mitigated for a 36bit phys/32GB system with
    some memory holes.
    
    But since these actually have the larger internal cache width this warning
    is bogus because it would only really be needed if the system had more than
    43bits of memory.
    
    Add a new internal x86_cache_bits field. Normally it is the same as the
    physical bits field reported by CPUID, but for Nehalem and newerforce it to
    be at least 44bits.
    
    Change the L1TF memory size warning to use the new cache_bits field to
    avoid bogus warnings and remove the bogus comment about memory size.
    
    Fixes: 17dbca1 ("x86/speculation/l1tf: Add sysfs reporting for l1tf")
    Reported-by: George Anchev <studio@anchev.net>
    Reported-by: Christopher Snowhill <kode54@gmail.com>
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Cc: x86@kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: Michael Hocko <mhocko@suse.com>
    Cc: vbabka@suse.cz
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180824170351.34874-1-andi@firstfloor.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Andi Kleen authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    ef3d45c View commit details
    Browse the repository at this point in the history
  91. x86/entry/64: Wipe KASAN stack shadow before rewind_stack_do_exit()

    commit f12d11c upstream.
    
    Reset the KASAN shadow state of the task stack before rewinding RSP.
    Without this, a kernel oops will leave parts of the stack poisoned, and
    code running under do_exit() can trip over such poisoned regions and cause
    nonsensical false-positive KASAN reports about stack-out-of-bounds bugs.
    
    This does not wipe the exception stacks; if an oops happens on an exception
    stack, it might result in random KASAN false-positives from other tasks
    afterwards. This is probably relatively uninteresting, since if the kernel
    oopses on an exception stack, there are most likely bigger things to worry
    about. It'd be more interesting if vmapped stacks and KASAN were
    compatible, since then handle_stack_overflow() would oops from exception
    stack context.
    
    Fixes: 2deb4be ("x86/dumpstack: When OOPSing, rewind the stack before do_exit()")
    Signed-off-by: Jann Horn <jannh@google.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: Alexander Potapenko <glider@google.com>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: kasan-dev@googlegroups.com
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180828184033.93712-1-jannh@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    thejh authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    ba064e8 View commit details
    Browse the repository at this point in the history
  92. s390: fix br_r1_trampoline for machines without exrl

    commit 26f8438 upstream.
    
    For machines without the exrl instruction the BFP jit generates
    code that uses an "br %r1" instruction located in the lowcore page.
    Unfortunately there is a cut & paste error that puts an additional
    "larl %r1,.+14" instruction in the code that clobbers the branch
    target address in %r1. Remove the larl instruction.
    
    Cc: <stable@vger.kernel.org> # v4.17+
    Fixes: de5cb6e ("s390: use expoline thunks in the BPF JIT")
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Martin Schwidefsky authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    33a9081 View commit details
    Browse the repository at this point in the history
  93. s390/qdio: reset old sbal_state flags

    commit 64e03ff upstream.
    
    When allocating a new AOB fails, handle_outbound() is still capable of
    transmitting the selected buffer (just without async completion).
    
    But if a previous transfer on this queue slot used async completion, its
    sbal_state flags field is still set to QDIO_OUTBUF_STATE_FLAG_PENDING.
    So when the upper layer driver sees this stale flag, it expects an async
    completion that never happens.
    
    Fix this by unconditionally clearing the flags field.
    
    Fixes: 104ea55 ("qdio: support asynchronous delivery of storage blocks")
    Cc: <stable@vger.kernel.org> #v3.2+
    Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    julianwiedmann authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    b9f66a2 View commit details
    Browse the repository at this point in the history
  94. s390/numa: move initial setup of node_to_cpumask_map

    commit fb7d751 upstream.
    
    The numa_init_early initcall sets the node_to_cpumask_map[0] to the
    full cpu_possible_mask. Unfortunately this early_initcall is too late,
    the NUMA setup for numa=emu is done even earlier. The order of calls
    is numa_setup() -> emu_update_cpu_topology(), then the early_initcalls(),
    followed by sched_init_domains().
    
    Starting with git commit 051f3ca
    "sched/topology: Introduce NUMA identity node sched domain"
    the incorrect node_to_cpumask_map[0] really screws up the domain
    setup and the kernel panics with the follow oops:
    
    Cc: <stable@vger.kernel.org> # v4.15+
    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Martin Schwidefsky authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    d519aab View commit details
    Browse the repository at this point in the history
  95. s390/pci: fix out of bounds access during irq setup

    commit 866f357 upstream.
    
    During interrupt setup we allocate interrupt vectors, walk the list of msi
    descriptors, and fill in the message data. Requesting more interrupts than
    supported on s390 can lead to an out of bounds access.
    
    When we restrict the number of interrupts we should also stop walking the
    msi list after all supported interrupts are handled.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
    Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    sebott authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    664a64b View commit details
    Browse the repository at this point in the history
  96. kprobes: Make list and blacklist root user read only

    commit f2a3ab3 upstream.
    
    Since the blacklist and list files on debugfs indicates
    a sensitive address information to reader, it should be
    restricted to the root user.
    
    Suggested-by: Thomas Richter <tmricht@linux.ibm.com>
    Suggested-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
    Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: David Howells <dhowells@redhat.com>
    Cc: David S . Miller <davem@davemloft.net>
    Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
    Cc: Jon Medhurst <tixy@linaro.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Tobin C . Harding <me@tobin.cc>
    Cc: Will Deacon <will.deacon@arm.com>
    Cc: acme@kernel.org
    Cc: akpm@linux-foundation.org
    Cc: brueckner@linux.vnet.ibm.com
    Cc: linux-arch@vger.kernel.org
    Cc: rostedt@goodmis.org
    Cc: schwidefsky@de.ibm.com
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/lkml/152491890171.9916.5183693615601334087.stgit@devbox
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    mhiramat authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    5749cd6 View commit details
    Browse the repository at this point in the history
  97. MIPS: Correct the 64-bit DSP accumulator register size

    commit f5958b4 upstream.
    
    Use the `unsigned long' rather than `__u32' type for DSP accumulator
    registers, like with the regular MIPS multiply/divide accumulator and
    general-purpose registers, as all are 64-bit in 64-bit implementations
    and using a 32-bit data type leads to contents truncation on context
    saving.
    
    Update `arch_ptrace' and `compat_arch_ptrace' accordingly, removing
    casts that are similarly not used with multiply/divide accumulator or
    general-purpose register accesses.
    
    Signed-off-by: Maciej W. Rozycki <macro@mips.com>
    Signed-off-by: Paul Burton <paul.burton@mips.com>
    Fixes: e50c0a8 ("Support the MIPS32 / MIPS64 DSP ASE.")
    Patchwork: https://patchwork.linux-mips.org/patch/19329/
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: James Hogan <jhogan@kernel.org>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: linux-fsdevel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: stable@vger.kernel.org # 2.6.15+
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Maciej W. Rozycki authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    eb3717f View commit details
    Browse the repository at this point in the history
  98. MIPS: lib: Provide MIPS64r6 __multi3() for GCC < 7

    commit 690d916 upstream.
    
    Some versions of GCC suboptimally generate calls to the __multi3()
    intrinsic for MIPS64r6 builds, resulting in link failures due to the
    missing function:
    
        LD      vmlinux.o
        MODPOST vmlinux.o
      kernel/bpf/verifier.o: In function `kmalloc_array':
      include/linux/slab.h:631: undefined reference to `__multi3'
      fs/select.o: In function `kmalloc_array':
      include/linux/slab.h:631: undefined reference to `__multi3'
      ...
    
    We already have a workaround for this in which we provide the
    instrinsic, but we do so selectively for GCC 7 only. Unfortunately the
    issue occurs with older GCC versions too - it has been observed with
    both GCC 5.4.0 & GCC 6.4.0.
    
    MIPSr6 support was introduced in GCC 5, so all major GCC versions prior
    to GCC 8 are affected and we extend our workaround accordingly to all
    MIPS64r6 builds using GCC versions older than GCC 8.
    
    Signed-off-by: Paul Burton <paul.burton@mips.com>
    Reported-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
    Fixes: ebabcf1 ("MIPS: Implement __multi3 for GCC7 MIPS64r6 builds")
    Patchwork: https://patchwork.linux-mips.org/patch/20297/
    Cc: James Hogan <jhogan@kernel.org>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: linux-mips@linux-mips.org
    Cc: stable@vger.kernel.org # 4.15+
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    paulburton authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a6b728b View commit details
    Browse the repository at this point in the history
  99. scsi: sysfs: Introduce sysfs_{un,}break_active_protection()

    commit 2afc916 upstream.
    
    Introduce these two functions and export them such that the next patch
    can add calls to these functions from the SCSI core.
    
    Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
    Acked-by: Tejun Heo <tj@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    KAGA-KOKO authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    8a5e02a View commit details
    Browse the repository at this point in the history
  100. scsi: core: Avoid that SCSI device removal through sysfs triggers a d…

    …eadlock
    
    commit 0ee223b upstream.
    
    A long time ago the unfortunate decision was taken to add a self-deletion
    attribute to the sysfs SCSI device directory. That decision was unfortunate
    because self-deletion is really tricky. We can't drop that attribute
    because widely used user space software depends on it, namely the
    rescan-scsi-bus.sh script. Hence this patch that avoids that writing into
    that attribute triggers a deadlock. See also commit 7973cbd ("[PATCH]
    add sysfs attributes to scan and delete scsi_devices").
    
    This patch avoids that self-removal triggers the following deadlock:
    
    ======================================================
    WARNING: possible circular locking dependency detected
    4.18.0-rc2-dbg+ Freescale#5 Not tainted
    ------------------------------------------------------
    modprobe/6539 is trying to acquire lock:
    000000008323c4cd (kn->count#202){++++}, at: kernfs_remove_by_name_ns+0x45/0x90
    
    but task is already holding lock:
    00000000a6ec2c69 (&shost->scan_mutex){+.+.}, at: scsi_remove_host+0x21/0x150 [scsi_mod]
    
    which lock already depends on the new lock.
    
    the existing dependency chain (in reverse order) is:
    
    -> Freescale#1 (&shost->scan_mutex){+.+.}:
           __mutex_lock+0xfe/0xc70
           mutex_lock_nested+0x1b/0x20
           scsi_remove_device+0x26/0x40 [scsi_mod]
           sdev_store_delete+0x27/0x30 [scsi_mod]
           dev_attr_store+0x3e/0x50
           sysfs_kf_write+0x87/0xa0
           kernfs_fop_write+0x190/0x230
           __vfs_write+0xd2/0x3b0
           vfs_write+0x101/0x270
           ksys_write+0xab/0x120
           __x64_sys_write+0x43/0x50
           do_syscall_64+0x77/0x230
           entry_SYSCALL_64_after_hwframe+0x49/0xbe
    
    -> #0 (kn->count#202){++++}:
           lock_acquire+0xd2/0x260
           __kernfs_remove+0x424/0x4a0
           kernfs_remove_by_name_ns+0x45/0x90
           remove_files.isra.1+0x3a/0x90
           sysfs_remove_group+0x5c/0xc0
           sysfs_remove_groups+0x39/0x60
           device_remove_attrs+0x82/0xb0
           device_del+0x251/0x580
           __scsi_remove_device+0x19f/0x1d0 [scsi_mod]
           scsi_forget_host+0x37/0xb0 [scsi_mod]
           scsi_remove_host+0x9b/0x150 [scsi_mod]
           sdebug_driver_remove+0x4b/0x150 [scsi_debug]
           device_release_driver_internal+0x241/0x360
           device_release_driver+0x12/0x20
           bus_remove_device+0x1bc/0x290
           device_del+0x259/0x580
           device_unregister+0x1a/0x70
           sdebug_remove_adapter+0x8b/0xf0 [scsi_debug]
           scsi_debug_exit+0x76/0xe8 [scsi_debug]
           __x64_sys_delete_module+0x1c1/0x280
           do_syscall_64+0x77/0x230
           entry_SYSCALL_64_after_hwframe+0x49/0xbe
    
    other info that might help us debug this:
    
     Possible unsafe locking scenario:
    
           CPU0                    CPU1
           ----                    ----
      lock(&shost->scan_mutex);
                                   lock(kn->count#202);
                                   lock(&shost->scan_mutex);
      lock(kn->count#202);
    
     *** DEADLOCK ***
    
    2 locks held by modprobe/6539:
     #0: 00000000efaf9298 (&dev->mutex){....}, at: device_release_driver_internal+0x68/0x360
     Freescale#1: 00000000a6ec2c69 (&shost->scan_mutex){+.+.}, at: scsi_remove_host+0x21/0x150 [scsi_mod]
    
    stack backtrace:
    CPU: 10 PID: 6539 Comm: modprobe Not tainted 4.18.0-rc2-dbg+ Freescale#5
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
    Call Trace:
     dump_stack+0xa4/0xf5
     print_circular_bug.isra.34+0x213/0x221
     __lock_acquire+0x1a7e/0x1b50
     lock_acquire+0xd2/0x260
     __kernfs_remove+0x424/0x4a0
     kernfs_remove_by_name_ns+0x45/0x90
     remove_files.isra.1+0x3a/0x90
     sysfs_remove_group+0x5c/0xc0
     sysfs_remove_groups+0x39/0x60
     device_remove_attrs+0x82/0xb0
     device_del+0x251/0x580
     __scsi_remove_device+0x19f/0x1d0 [scsi_mod]
     scsi_forget_host+0x37/0xb0 [scsi_mod]
     scsi_remove_host+0x9b/0x150 [scsi_mod]
     sdebug_driver_remove+0x4b/0x150 [scsi_debug]
     device_release_driver_internal+0x241/0x360
     device_release_driver+0x12/0x20
     bus_remove_device+0x1bc/0x290
     device_del+0x259/0x580
     device_unregister+0x1a/0x70
     sdebug_remove_adapter+0x8b/0xf0 [scsi_debug]
     scsi_debug_exit+0x76/0xe8 [scsi_debug]
     __x64_sys_delete_module+0x1c1/0x280
     do_syscall_64+0x77/0x230
     entry_SYSCALL_64_after_hwframe+0x49/0xbe
    
    See also https://www.mail-archive.com/linux-scsi@vger.kernel.org/msg54525.html.
    
    Fixes: ac0ece9 ("scsi: use device_remove_file_self() instead of device_schedule_callback()")
    Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Acked-by: Tejun Heo <tj@kernel.org>
    Cc: Johannes Thumshirn <jthumshirn@suse.de>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    KAGA-KOKO authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    6d70dea View commit details
    Browse the repository at this point in the history
  101. iscsi target: fix session creation failure handling

    commit 26abc91 upstream.
    
    The problem is that iscsi_login_zero_tsih_s1 sets conn->sess early in
    iscsi_login_set_conn_values. If the function fails later like when we
    alloc the idr it does kfree(sess) and leaves the conn->sess pointer set.
    iscsi_login_zero_tsih_s1 then returns -Exyz and we then call
    iscsi_target_login_sess_out and access the freed memory.
    
    This patch has iscsi_login_zero_tsih_s1 either completely setup the
    session or completely tear it down, so later in
    iscsi_target_login_sess_out we can just check for it being set to the
    connection.
    
    Cc: stable@vger.kernel.org
    Fixes: 0957627 ("iscsi-target: Fix sess allocation leak in...")
    Signed-off-by: Mike Christie <mchristi@redhat.com>
    Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Matthew Wilcox <willy@infradead.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Mike Christie authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    00ee0e0 View commit details
    Browse the repository at this point in the history
  102. clk: rockchip: fix clk_i2sout parent selection bits on rk3399

    commit a64ad00 upstream.
    
    Register, shift and mask were wrong according to datasheet.
    
    Fixes: 1155100 ("clk: rockchip: add clock controller for the RK3399")
    Cc: stable@vger.kernel.org
    Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com>
    Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
    Signed-off-by: Heiko Stuebner <heiko@sntech.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    amsalby authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    072555e View commit details
    Browse the repository at this point in the history
  103. PM / clk: signedness bug in of_pm_clk_add_clks()

    commit 5e2e2f9 upstream.
    
    "count" needs to be signed for the error handling to work.  I made "i"
    signed as well so they match.
    
    Fixes: 02113ba (PM / clk: Add support for obtaining clocks from device-tree)
    Cc: 4.6+ <stable@vger.kernel.org> # 4.6+
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Dan Carpenter authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    d8467a6 View commit details
    Browse the repository at this point in the history
  104. power: generic-adc-battery: fix out-of-bounds write when copying chan…

    …nel properties
    
    commit 932d474 upstream.
    
    We did have sporadic problems in the pinctrl framework during boot
    where a pin group name unexpectedly became NULL leading to a NULL
    dereference in strcmp.
    
    Detailled analysis of the failing cases did reveal that there were
    two devm allocated objects close to each other. The second one was
    the affected group_desc in pinmux and the first one was the
    psy_desc->properties buffer of the gab driver.
    
    Review of the gab code showed that the address calculation for
    one memcpy() is wrong. It does
    
    	properties + sizeof(type) * index
    
    but C is defined to do the index multiplication already for
    pointer + integer additions. Hence the factor was applied twice
    and the memcpy() does write outside of the properties buffer.
    Sometimes it happened to be the pinctrl and triggered the strcmp(NULL).
    
    Anyways, it is overkill to use a memcpy() here instead of a simple
    assignment, which is easier to read and has less risk for wrong
    address calculations. So we change code to a simple assignment.
    
    If we initialize the index to the first free location, we can even
    remove the local variable 'properties'.
    
    This bug seems to exist right from the beginning in 3.7-rc1 in
    
    commit e60fea7 ("power: battery: Generic battery driver using IIO")
    
    Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
    Cc: stable@vger.kernel.org
    Fixes: e60fea7 ("power: battery: Generic battery driver using IIO")
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    goldelico authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    a3702bb View commit details
    Browse the repository at this point in the history
  105. power: generic-adc-battery: check for duplicate properties copied fro…

    …m iio channels
    
    commit a427503 upstream.
    
    If an iio channel defines a basic property, there are duplicate entries
    in /sys/class/power/*/uevent.
    
    So add a check to avoid duplicates. Since all channels may be duplicates,
    we have to modify the related error check.
    
    Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
    Cc: stable@vger.kernel.org
    Fixes: e60fea7 ("power: battery: Generic battery driver using IIO")
    Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    goldelico authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    c1ebdbe View commit details
    Browse the repository at this point in the history
  106. cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status

    commit 8f3fafc upstream.
    
    Like d88b6d0: "cdrom: information leak in cdrom_ioctl_media_changed()"
    
    There is another cast from unsigned long to int which causes
    a bounds check to fail with specially crafted input. The value is
    then used as an index in the slot array in cdrom_slot_status().
    
    Signed-off-by: Scott Bauer <scott.bauer@intel.com>
    Signed-off-by: Scott Bauer <sbauer@plzdonthack.me>
    Cc: stable@vger.kernel.org
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Scott Bauer authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    b8c0e15 View commit details
    Browse the repository at this point in the history
  107. staging: android: ion: check for kref overflow

    This patch is against 4.9. It does not apply to master due to a large
    rework of ion in 4.12 which removed the affected functions altogther.
    4c23cbf ("staging: android: ion: Remove import interface")
    
    Userspace can cause the kref to handles to increment
    arbitrarily high. Ensure it does not overflow.
    
    Signed-off-by: Daniel Rosenberg <drosen@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    drosen-google authored and gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    3af20bd View commit details
    Browse the repository at this point in the history
  108. Linux 4.9.125

    gregkh committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    9eabaca View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2018

  1. net: 6lowpan: fix reserved space for single frames

    commit ac74f87 upstream.
    
    This patch fixes patch add handling to take care tail and headroom for
    single 6lowpan frames. We need to be sure we have a skb with the right
    head and tailroom for single frames. This patch do it by using
    skb_copy_expand() if head and tailroom is not enough allocated by upper
    layer.
    
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195059
    Reported-by: David Palma <david.palma@ntnu.no>
    Reported-by: Rabi Narayan Sahoo <rabinarayans0828@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Alexander Aring <aring@mojatatu.com>
    Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Alexander Aring authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    6aa4a72 View commit details
    Browse the repository at this point in the history
  2. net: mac802154: tx: expand tailroom if necessary

    commit f9c5283 upstream.
    
    This patch is necessary if case of AF_PACKET or other socket interface
    which I am aware of it and didn't allocated the necessary room.
    
    Reported-by: David Palma <david.palma@ntnu.no>
    Reported-by: Rabi Narayan Sahoo <rabinarayans0828@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Alexander Aring <aring@mojatatu.com>
    Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Alexander Aring authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    41b2e6e View commit details
    Browse the repository at this point in the history
  3. 9p/net: Fix zero-copy path in the 9p virtio transport

    commit d28c756 upstream.
    
    The zero-copy optimization when reading or writing large chunks of data
    is quite useful.  However, the 9p messages created through the zero-copy
    write path have an incorrect message size: it should be the size of the
    header + size of the data being written but instead it's just the size
    of the header.
    
    This only works if the server ignores the size field of the message and
    otherwise breaks the framing of the protocol. Fix this by re-writing the
    message size field with the correct value.
    
    Tested by running `dd if=/dev/zero of=out bs=4k count=1` inside a
    virtio-9p mount.
    
    Link: http://lkml.kernel.org/r/20180717003529.114368-1-chirantan@chromium.org
    Signed-off-by: Chirantan Ekbote <chirantan@chromium.org>
    Reviewed-by: Greg Kurz <groug@kaod.org>
    Tested-by: Greg Kurz <groug@kaod.org>
    Cc: Dylan Reid <dgreid@chromium.org>
    Cc: Guenter Roeck <groeck@chromium.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jynnantonix authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    5c45154 View commit details
    Browse the repository at this point in the history
  4. spi: davinci: fix a NULL pointer dereference

    commit 563a53f upstream.
    
    On non-OF systems spi->controlled_data may be NULL. This causes a NULL
    pointer derefence on dm365-evm.
    
    Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    brgl authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    ae8f22e View commit details
    Browse the repository at this point in the history
  5. spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe

    commit d8ffee2 upstream.
    
    Registers of DSPI should not be accessed before enabling its clock.  On
    Toradex Colibri VF50 on Iris carrier board this could be seen during
    bootup as imprecise abort:
    
        Unhandled fault: imprecise external abort (0x1c06) at 0x00000000
        Internal error: : 1c06 [Freescale#1] ARM
        Modules linked in:
        CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.39-dirty Freescale#97
        Hardware name: Freescale Vybrid VF5xx/VF6xx (Device Tree)
        Backtrace:
        [<804166a8>] (regmap_write) from [<80466b5c>] (dspi_probe+0x1f0/0x8dc)
        [<8046696c>] (dspi_probe) from [<8040107c>] (platform_drv_probe+0x54/0xb8)
        [<80401028>] (platform_drv_probe) from [<803ff53c>] (driver_probe_device+0x280/0x2f8)
        [<803ff2bc>] (driver_probe_device) from [<803ff674>] (__driver_attach+0xc0/0xc4)
        [<803ff5b4>] (__driver_attach) from [<803fd818>] (bus_for_each_dev+0x70/0xa4)
        [<803fd7a8>] (bus_for_each_dev) from [<803fee74>] (driver_attach+0x24/0x28)
        [<803fee50>] (driver_attach) from [<803fe980>] (bus_add_driver+0x1a0/0x218)
        [<803fe7e0>] (bus_add_driver) from [<803fffe8>] (driver_register+0x80/0x100)
        [<803fff68>] (driver_register) from [<80400fdc>] (__platform_driver_register+0x48/0x50)
        [<80400f94>] (__platform_driver_register) from [<8091cf7c>] (fsl_dspi_driver_init+0x1c/0x20)
        [<8091cf60>] (fsl_dspi_driver_init) from [<8010195c>] (do_one_initcall+0x4c/0x174)
        [<80101910>] (do_one_initcall) from [<80900e8c>] (kernel_init_freeable+0x144/0x1d8)
        [<80900d48>] (kernel_init_freeable) from [<805ff6a8>] (kernel_init+0x10/0x114)
        [<805ff698>] (kernel_init) from [<80107be8>] (ret_from_fork+0x14/0x2c)
    
    Cc: <stable@vger.kernel.org>
    Fixes: 5ee67b5 ("spi: dspi: clear SPI_SR before enable interrupt")
    Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    krzk authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    9f16a87 View commit details
    Browse the repository at this point in the history
  6. drm/i915/userptr: reject zero user_size

    commit c11c7bf upstream.
    
    Operating on a zero sized GEM userptr object will lead to explosions.
    
    Fixes: 5cc9ed4 ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
    Testcase: igt/gem_userptr_blits/input-checking
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Link: https://patchwork.freedesktop.org/patch/msgid/20180502195021.30900-1-matthew.auld@intel.com
    Cc: Loic <hackurx@opensec.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    matt-auld authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    f916daa View commit details
    Browse the repository at this point in the history
  7. libertas: fix suspend and resume for SDIO connected cards

    commit 7444a80 upstream.
    
    Prior to commit 573185c ("mmc: core: Invoke sdio func driver's PM
    callbacks from the sdio bus"), the MMC core used to call into the power
    management functions of SDIO clients itself and removed the card if the
    return code was non-zero. IOW, the mmc handled errors gracefully and didn't
    upchain them to the pm core.
    
    Since this change, the mmc core relies on generic power management
    functions which treat all errors as a reason to cancel the suspend
    immediately. This causes suspend attempts to fail when the libertas
    driver is loaded.
    
    To fix this, power down the card explicitly in if_sdio_suspend() when we
    know we're about to lose power and return success. Also set a flag in these
    cases, and power up the card again in if_sdio_resume().
    
    Fixes: 573185c ("mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus")
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Daniel Mack <daniel@zonque.org>
    Reviewed-by: Chris Ball <chris@printf.net>
    Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    zonque authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    64a2af0 View commit details
    Browse the repository at this point in the history
  8. mailbox: xgene-slimpro: Fix potential NULL pointer dereference

    commit 3512a18 upstream.
    
    There is a potential execution path in which function
    platform_get_resource() returns NULL. If this happens,
    we will end up having a NULL pointer dereference.
    
    Fix this by replacing devm_ioremap with devm_ioremap_resource,
    which has the NULL check and the memory region request.
    
    This code was detected with the help of Coccinelle.
    
    Cc: stable@vger.kernel.org
    Fixes: f700e84 ("mailbox: Add support for APM X-Gene platform mailbox driver")
    Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
    Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    GustavoARSilva authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    0fdb739 View commit details
    Browse the repository at this point in the history
  9. powerpc/fadump: handle crash memory ranges array index overflow

    commit 1bd6a1c upstream.
    
    Crash memory ranges is an array of memory ranges of the crashing kernel
    to be exported as a dump via /proc/vmcore file. The size of the array
    is set based on INIT_MEMBLOCK_REGIONS, which works alright in most cases
    where memblock memory regions count is less than INIT_MEMBLOCK_REGIONS
    value. But this count can grow beyond INIT_MEMBLOCK_REGIONS value since
    commit 142b45a ("memblock: Add array resizing support").
    
    On large memory systems with a few DLPAR operations, the memblock memory
    regions count could be larger than INIT_MEMBLOCK_REGIONS value. On such
    systems, registering fadump results in crash or other system failures
    like below:
    
      task: c00007f39a290010 ti: c00000000b738000 task.ti: c00000000b738000
      NIP: c000000000047df4 LR: c0000000000f9e58 CTR: c00000000010f180
      REGS: c00000000b73b570 TRAP: 0300   Tainted: G          L   X  (4.4.140+)
      MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE>  CR: 22004484  XER: 20000000
      CFAR: c000000000008500 DAR: 000007a450000000 DSISR: 40000000 SOFTE: 0
      ...
      NIP [c000000000047df4] smp_send_reschedule+0x24/0x80
      LR [c0000000000f9e58] resched_curr+0x138/0x160
      Call Trace:
        resched_curr+0x138/0x160 (unreliable)
        check_preempt_curr+0xc8/0xf0
        ttwu_do_wakeup+0x38/0x150
        try_to_wake_up+0x224/0x4d0
        __wake_up_common+0x94/0x100
        ep_poll_callback+0xac/0x1c0
        __wake_up_common+0x94/0x100
        __wake_up_sync_key+0x70/0xa0
        sock_def_readable+0x58/0xa0
        unix_stream_sendmsg+0x2dc/0x4c0
        sock_sendmsg+0x68/0xa0
        ___sys_sendmsg+0x2cc/0x2e0
        __sys_sendmsg+0x5c/0xc0
        SyS_socketcall+0x36c/0x3f0
        system_call+0x3c/0x100
    
    as array index overflow is not checked for while setting up crash memory
    ranges causing memory corruption. To resolve this issue, dynamically
    allocate memory for crash memory ranges and resize it incrementally,
    in units of pagesize, on hitting array size limit.
    
    Fixes: 2df173d ("fadump: Initialize elfcore header and add PT_LOAD program headers.")
    Cc: stable@vger.kernel.org # v3.4+
    Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
    Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
    [mpe: Just use PAGE_SIZE directly, fixup variable placement]
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    hbathini authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    1ae3174 View commit details
    Browse the repository at this point in the history
  10. powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.

    commit cd813e1 upstream.
    
    During Machine Check interrupt on pseries platform, register r3 points
    RTAS extended event log passed by hypervisor. Since hypervisor uses r3
    to pass pointer to rtas log, it stores the original r3 value at the
    start of the memory (first 8 bytes) pointed by r3. Since hypervisor
    stores this info and rtas log is in BE format, linux should make
    sure to restore r3 value in correct endian format.
    
    Without this patch when MCE handler, after recovery, returns to code that
    that caused the MCE may end up with Data SLB access interrupt for invalid
    address followed by kernel panic or hang.
    
      Severe Machine check interrupt [Recovered]
        NIP [d00000000ca301b8]: init_module+0x1b8/0x338 [bork_kernel]
        Initiator: CPU
        Error type: SLB [Multihit]
          Effective address: d00000000ca70000
      cpu 0xa: Vector: 380 (Data SLB Access) at [c0000000fc7775b0]
          pc: c0000000009694c0: vsnprintf+0x80/0x480
          lr: c0000000009698e0: vscnprintf+0x20/0x60
          sp: c0000000fc777830
         msr: 8000000002009033
         dar: a803a30c000000d0
        current = 0xc00000000bc9ef00
        paca    = 0xc00000001eca5c00	 softe: 3	 irq_happened: 0x01
          pid   = 8860, comm = insmod
      vscnprintf+0x20/0x60
      vprintk_emit+0xb4/0x4b0
      vprintk_func+0x5c/0xd0
      printk+0x38/0x4c
      init_module+0x1c0/0x338 [bork_kernel]
      do_one_initcall+0x54/0x230
      do_init_module+0x8c/0x248
      load_module+0x12b8/0x15b0
      sys_finit_module+0xa8/0x110
      system_call+0x58/0x6c
      --- Exception: c00 (System Call) at 00007fff8bda0644
      SP (7fffdfbfe980) is in userspace
    
    This patch fixes this issue.
    
    Fixes: a08a53e ("powerpc/le: Enable RTAS events support")
    Cc: stable@vger.kernel.org # v3.15+
    Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
    Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    maheshsal authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    89bdde2 View commit details
    Browse the repository at this point in the history
  11. PCI: Add wrappers for dev_printk()

    commit 7506dc7 upstream.
    
    Add PCI-specific dev_printk() wrappers and use them to simplify the code
    slightly.  No functional change intended.
    
    Signed-off-by: Frederick Lawler <fred@fredlawl.com>
    [bhelgaas: squash into one patch]
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    [only take the pci.h portion of this patch, to make backporting stuff
    easier over time - gregkh]
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    fredlawl authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    0eb725c View commit details
    Browse the repository at this point in the history
  12. powerpc/powernv/pci: Work around races in PCI bridge enabling

    commit db21731 upstream.
    
    The generic code is racy when multiple children of a PCI bridge try to
    enable it simultaneously.
    
    This leads to drivers trying to access a device through a
    not-yet-enabled bridge, and this EEH errors under various
    circumstances when using parallel driver probing.
    
    There is work going on to fix that properly in the PCI core but it
    will take some time.
    
    x86 gets away with it because (outside of hotplug), the BIOS enables
    all the bridges at boot time.
    
    This patch does the same thing on powernv by enabling all bridges that
    have child devices at boot time, thus avoiding subsequent races. It's
    suitable for backporting to stable and distros, while the proper PCI
    fix will probably be significantly more invasive.
    
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ozbenh authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    f8700e0 View commit details
    Browse the repository at this point in the history
  13. cxl: Fix wrong comparison in cxl_adapter_context_get()

    commit ef6cb5f upstream.
    
    Function atomic_inc_unless_negative() returns a bool to indicate
    success/failure. However cxl_adapter_context_get() wrongly compares
    the return value against '>=0' which will always be true. The patch
    fixes this comparison to '==0' there by also fixing this compile time
    warning:
    
    	drivers/misc/cxl/main.c:290 cxl_adapter_context_get()
    	warn: 'atomic_inc_unless_negative(&adapter->contexts_num)' is unsigned
    
    Fixes: 70b565b ("cxl: Prevent adapter reset if an active context exists")
    Cc: stable@vger.kernel.org # v4.9+
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Vaibhav Jain <vaibhav@linux.ibm.com>
    Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
    Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    vaibhav92 authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    6f329f2 View commit details
    Browse the repository at this point in the history
  14. ib_srpt: Fix a use-after-free in srpt_close_ch()

    commit 9952509 upstream.
    
    Avoid that KASAN reports the following:
    
    BUG: KASAN: use-after-free in srpt_close_ch+0x4f/0x1b0 [ib_srpt]
    Read of size 4 at addr ffff880151180cb8 by task check/4681
    
    CPU: 15 PID: 4681 Comm: check Not tainted 4.18.0-rc2-dbg+ Freescale#4
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
    Call Trace:
     dump_stack+0xa4/0xf5
     print_address_description+0x6f/0x270
     kasan_report+0x241/0x360
     __asan_load4+0x78/0x80
     srpt_close_ch+0x4f/0x1b0 [ib_srpt]
     srpt_set_enabled+0xf7/0x1e0 [ib_srpt]
     srpt_tpg_enable_store+0xb8/0x120 [ib_srpt]
     configfs_write_file+0x14e/0x1d0 [configfs]
     __vfs_write+0xd2/0x3b0
     vfs_write+0x101/0x270
     ksys_write+0xab/0x120
     __x64_sys_write+0x43/0x50
     do_syscall_64+0x77/0x230
     entry_SYSCALL_64_after_hwframe+0x49/0xbe
    
    Fixes: aaf45bd ("IB/srpt: Detect session shutdown reliably")
    Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    KAGA-KOKO authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    2c3c284 View commit details
    Browse the repository at this point in the history
  15. RDMA/rxe: Set wqe->status correctly if an unexpected response is rece…

    …ived
    
    commit 61b717d upstream.
    
    Every function that returns COMPST_ERROR must set wqe->status to another
    value than IB_WC_SUCCESS before returning COMPST_ERROR. Fix the only code
    path for which this is not yet the case.
    
    Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
    Cc: <stable@vger.kernel.org>
    Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
    Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    KAGA-KOKO authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    e4f5312 View commit details
    Browse the repository at this point in the history
  16. fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr …

    …failed
    
    commit 3111784 upstream.
    
    In my testing, v9fs_fid_xattr_set will return successfully even if the
    backend ext4 filesystem has no space to store xattr key-value. That will
    cause inconsistent behavior between front end and back end. The reason is
    that lsetxattr will be triggered by p9_client_clunk, and unfortunately we
    did not catch the error. This patch will catch the error to notify upper
    caller.
    
    p9_client_clunk (in 9p)
      p9_client_rpc(clnt, P9_TCLUNK, "d", fid->fid);
        v9fs_clunk (in qemu)
          put_fid
            free_fid
              v9fs_xattr_fid_clunk
                v9fs_co_lsetxattr
                  s->ops->lsetxattr
                    ext4_xattr_user_set (in host ext4 filesystem)
    
    Link: http://lkml.kernel.org/r/5B57EACC.2060900@huawei.com
    Signed-off-by: Jun Piao <piaojun@huawei.com>
    Cc: Eric Van Hensbergen <ericvh@gmail.com>
    Cc: Ron Minnich <rminnich@sandia.gov>
    Cc: Latchesar Ionkov <lucho@ionkov.net>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    JunPiaoHW authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    684f5d9 View commit details
    Browse the repository at this point in the history
  17. 9p/virtio: fix off-by-one error in sg list bounds check

    commit 23cba9c upstream.
    
    Because the value of limit is VIRTQUEUE_NUM, if index is equal to
    limit, it will cause sg array out of bounds, so correct the judgement
    of BUG_ON.
    
    Link: http://lkml.kernel.org/r/5B63D5F6.6080109@huawei.com
    Signed-off-by: Yiwen Jiang <jiangyiwen@huawei.com>
    Reported-By: Dan Carpenter <dan.carpenter@oracle.com>
    Acked-by: Jun Piao <piaojun@huawei.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jiangyiwen123 authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    b69ef7c View commit details
    Browse the repository at this point in the history
  18. net/9p/client.c: version pointer uninitialized

    commit 7913690 upstream.
    
    The p9_client_version() does not initialize the version pointer. If the
    call to p9pdu_readf() returns an error and version has not been allocated
    in p9pdu_readf(), then the program will jump to the "error" label and will
    try to free the version pointer. If version is not initialized, free()
    will be called with uninitialized, garbage data and will provoke a crash.
    
    Link: http://lkml.kernel.org/r/20180709222943.19503-1-tomasbortoli@gmail.com
    Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
    Reported-by: syzbot+65c6b72f284a39d416b4@syzkaller.appspotmail.com
    Reviewed-by: Jun Piao <piaojun@huawei.com>
    Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
    Cc: Eric Van Hensbergen <ericvh@gmail.com>
    Cc: Ron Minnich <rminnich@sandia.gov>
    Cc: Latchesar Ionkov <lucho@ionkov.net>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Tomas Bortoli authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    c53310d View commit details
    Browse the repository at this point in the history
  19. net/9p/trans_fd.c: fix race-condition by flushing workqueue before th…

    …e kfree()
    
    commit 430ac66 upstream.
    
    The patch adds the flush in p9_mux_poll_stop() as it the function used by
    p9_conn_destroy(), in turn called by p9_fd_close() to stop the async
    polling associated with the data regarding the connection.
    
    Link: http://lkml.kernel.org/r/20180720092730.27104-1-tomasbortoli@gmail.com
    Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
    Reported-by: syzbot+39749ed7d9ef6dfb23f6@syzkaller.appspotmail.com
    To: Eric Van Hensbergen <ericvh@gmail.com>
    To: Ron Minnich <rminnich@sandia.gov>
    To: Latchesar Ionkov <lucho@ionkov.net>
    Cc: Yiwen Jiang <jiangyiwen@huwei.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Tomas Bortoli authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    35c740d View commit details
    Browse the repository at this point in the history
  20. dm thin: stop no_space_timeout worker when switching to write-mode

    commit 7529444 upstream.
    
    Now both check_for_space() and do_no_space_timeout() will read & write
    pool->pf.error_if_no_space.  If these functions run concurrently, as
    shown in the following case, the default setting of "queue_if_no_space"
    can get lost.
    
    precondition:
        * error_if_no_space = false (aka "queue_if_no_space")
        * pool is in Out-of-Data-Space (OODS) mode
        * no_space_timeout worker has been queued
    
    CPU 0:                          CPU 1:
    // delete a thin device
    process_delete_mesg()
    // check_for_space() invoked by commit()
    set_pool_mode(pool, PM_WRITE)
        pool->pf.error_if_no_space = \
         pt->requested_pf.error_if_no_space
    
    				// timeout, pool is still in OODS mode
    				do_no_space_timeout
    				    // "queue_if_no_space" config is lost
    				    pool->pf.error_if_no_space = true
        pool->pf.mode = new_mode
    
    Fix it by stopping no_space_timeout worker when switching to write mode.
    
    Fixes: bcc696f ("dm thin: stay in out-of-data-space mode once no_space_timeout expires")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hou Tao <houtao1@huawei.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Hou Tao authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    9a3f8fd View commit details
    Browse the repository at this point in the history
  21. dm cache metadata: save in-core policy_hint_size to on-disk superblock

    commit fd2fa95 upstream.
    
    policy_hint_size starts as 0 during __write_initial_superblock().  It
    isn't until the policy is loaded that policy_hint_size is set in-core
    (cmd->policy_hint_size).  But it never got recorded in the on-disk
    superblock because __commit_transaction() didn't deal with transfering
    the in-core cmd->policy_hint_size to the on-disk superblock.
    
    The in-core cmd->policy_hint_size gets initialized by metadata_open()'s
    __begin_transaction_flags() which re-reads all superblock fields.
    Because the superblock's policy_hint_size was never properly stored, when
    the cache was created, hints_array_available() would always return false
    when re-activating a previously created cache.  This means
    __load_mappings() always considered the hints invalid and never made use
    of the hints (these hints served to optimize).
    
    Another detremental side-effect of this oversight is the cache_check
    utility would fail with: "invalid hint width: 0"
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    snitm authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    d08b58b View commit details
    Browse the repository at this point in the history
  22. uart: fix race between uart_put_char() and uart_shutdown()

    commit a5ba1d9 upstream.
    
    We have reports of the following crash:
    
        PID: 7 TASK: ffff88085c6d61c0 CPU: 1 COMMAND: "kworker/u25:0"
        #0 [ffff88085c6db710] machine_kexec at ffffffff81046239
        Freescale#1 [ffff88085c6db760] crash_kexec at ffffffff810fc248
        Freescale#2 [ffff88085c6db830] oops_end at ffffffff81008ae7
        Freescale#3 [ffff88085c6db860] no_context at ffffffff81050b8f
        Freescale#4 [ffff88085c6db8b0] __bad_area_nosemaphore at ffffffff81050d75
        Freescale#5 [ffff88085c6db900] bad_area_nosemaphore at ffffffff81050e83
        Freescale#6 [ffff88085c6db910] __do_page_fault at ffffffff8105132e
        Freescale#7 [ffff88085c6db9b0] do_page_fault at ffffffff8105152c
        Freescale#8 [ffff88085c6db9c0] page_fault at ffffffff81a3f122
        [exception RIP: uart_put_char+149]
        RIP: ffffffff814b67b5 RSP: ffff88085c6dba78 RFLAGS: 00010006
        RAX: 0000000000000292 RBX: ffffffff827c5120 RCX: 0000000000000081
        RDX: 0000000000000000 RSI: 000000000000005f RDI: ffffffff827c5120
        RBP: ffff88085c6dba98 R8: 000000000000012c R9: ffffffff822ea320
        R10: ffff88085fe4db04 R11: 0000000000000001 R12: ffff881059f9c000
        R13: 0000000000000001 R14: 000000000000005f R15: 0000000000000fba
        ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
        Freescale#9 [ffff88085c6dbaa0] tty_put_char at ffffffff81497544
        Freescale#10 [ffff88085c6dbac0] do_output_char at ffffffff8149c91c
        Freescale#11 [ffff88085c6dbae0] __process_echoes at ffffffff8149cb8b
        Freescale#12 [ffff88085c6dbb30] commit_echoes at ffffffff8149cdc2
        Freescale#13 [ffff88085c6dbb60] n_tty_receive_buf_fast at ffffffff8149e49b
        Freescale#14 [ffff88085c6dbbc0] __receive_buf at ffffffff8149ef5a
        Freescale#15 [ffff88085c6dbc20] n_tty_receive_buf_common at ffffffff8149f016
        Freescale#16 [ffff88085c6dbca0] n_tty_receive_buf2 at ffffffff8149f194
        Freescale#17 [ffff88085c6dbcb0] flush_to_ldisc at ffffffff814a238a
        Freescale#18 [ffff88085c6dbd50] process_one_work at ffffffff81090be2
        Freescale#19 [ffff88085c6dbe20] worker_thread at ffffffff81091b4d
        Freescale#20 [ffff88085c6dbeb0] kthread at ffffffff81096384
        Freescale#21 [ffff88085c6dbf50] ret_from_fork at ffffffff81a3d69f​
    
    after slogging through some dissasembly:
    
    ffffffff814b6720 <uart_put_char>:
    ffffffff814b6720:	55                   	push   %rbp
    ffffffff814b6721:	48 89 e5             	mov    %rsp,%rbp
    ffffffff814b6724:	48 83 ec 20          	sub    $0x20,%rsp
    ffffffff814b6728:	48 89 1c 24          	mov    %rbx,(%rsp)
    ffffffff814b672c:	4c 89 64 24 08       	mov    %r12,0x8(%rsp)
    ffffffff814b6731:	4c 89 6c 24 10       	mov    %r13,0x10(%rsp)
    ffffffff814b6736:	4c 89 74 24 18       	mov    %r14,0x18(%rsp)
    ffffffff814b673b:	e8 b0 8e 58 00       	callq  ffffffff81a3f5f0 <mcount>
    ffffffff814b6740:	4c 8b a7 88 02 00 00 	mov    0x288(%rdi),%r12
    ffffffff814b6747:	45 31 ed             	xor    %r13d,%r13d
    ffffffff814b674a:	41 89 f6             	mov    %esi,%r14d
    ffffffff814b674d:	49 83 bc 24 70 01 00 	cmpq   $0x0,0x170(%r12)
    ffffffff814b6754:	00 00
    ffffffff814b6756:	49 8b 9c 24 80 01 00 	mov    0x180(%r12),%rbx
    ffffffff814b675d:	00
    ffffffff814b675e:	74 2f                	je     ffffffff814b678f <uart_put_char+0x6f>
    ffffffff814b6760:	48 89 df             	mov    %rbx,%rdi
    ffffffff814b6763:	e8 a8 67 58 00       	callq  ffffffff81a3cf10 <_raw_spin_lock_irqsave>
    ffffffff814b6768:	41 8b 8c 24 78 01 00 	mov    0x178(%r12),%ecx
    ffffffff814b676f:	00
    ffffffff814b6770:	89 ca                	mov    %ecx,%edx
    ffffffff814b6772:	f7 d2                	not    %edx
    ffffffff814b6774:	41 03 94 24 7c 01 00 	add    0x17c(%r12),%edx
    ffffffff814b677b:	00
    ffffffff814b677c:	81 e2 ff 0f 00 00    	and    $0xfff,%edx
    ffffffff814b6782:	75 23                	jne    ffffffff814b67a7 <uart_put_char+0x87>
    ffffffff814b6784:	48 89 c6             	mov    %rax,%rsi
    ffffffff814b6787:	48 89 df             	mov    %rbx,%rdi
    ffffffff814b678a:	e8 e1 64 58 00       	callq  ffffffff81a3cc70 <_raw_spin_unlock_irqrestore>
    ffffffff814b678f:	44 89 e8             	mov    %r13d,%eax
    ffffffff814b6792:	48 8b 1c 24          	mov    (%rsp),%rbx
    ffffffff814b6796:	4c 8b 64 24 08       	mov    0x8(%rsp),%r12
    ffffffff814b679b:	4c 8b 6c 24 10       	mov    0x10(%rsp),%r13
    ffffffff814b67a0:	4c 8b 74 24 18       	mov    0x18(%rsp),%r14
    ffffffff814b67a5:	c9                   	leaveq
    ffffffff814b67a6:	c3                   	retq
    ffffffff814b67a7:	49 8b 94 24 70 01 00 	mov    0x170(%r12),%rdx
    ffffffff814b67ae:	00
    ffffffff814b67af:	48 63 c9             	movslq %ecx,%rcx
    ffffffff814b67b2:	41 b5 01             	mov    $0x1,%r13b
    ffffffff814b67b5:	44 88 34 0a          	mov    %r14b,(%rdx,%rcx,1)
    ffffffff814b67b9:	41 8b 94 24 78 01 00 	mov    0x178(%r12),%edx
    ffffffff814b67c0:	00
    ffffffff814b67c1:	83 c2 01             	add    $0x1,%edx
    ffffffff814b67c4:	81 e2 ff 0f 00 00    	and    $0xfff,%edx
    ffffffff814b67ca:	41 89 94 24 78 01 00 	mov    %edx,0x178(%r12)
    ffffffff814b67d1:	00
    ffffffff814b67d2:	eb b0                	jmp    ffffffff814b6784 <uart_put_char+0x64>
    ffffffff814b67d4:	66 66 66 2e 0f 1f 84 	data32 data32 nopw %cs:0x0(%rax,%rax,1)
    ffffffff814b67db:	00 00 00 00 00
    
    for our build, this is crashing at:
    
        circ->buf[circ->head] = c;
    
    Looking in uart_port_startup(), it seems that circ->buf (state->xmit.buf)
    protected by the "per-port mutex", which based on uart_port_check() is
    state->port.mutex. Indeed, the lock acquired in uart_put_char() is
    uport->lock, i.e. not the same lock.
    
    Anyway, since the lock is not acquired, if uart_shutdown() is called, the
    last chunk of that function may release state->xmit.buf before its assigned
    to null, and cause the race above.
    
    To fix it, let's lock uport->lock when allocating/deallocating
    state->xmit.buf in addition to the per-port mutex.
    
    v2: switch to locking uport->lock on allocation/deallocation instead of
        locking the per-port mutex in uart_put_char. Note that since
        uport->lock is a spin lock, we have to switch the allocation to
        GFP_ATOMIC.
    v3: move the allocation outside the lock, so we can switch back to
        GFP_KERNEL
    
    Signed-off-by: Tycho Andersen <tycho@tycho.ws>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    tych0 authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    e5147bb View commit details
    Browse the repository at this point in the history
  23. iio: ad9523: Fix displayed phase

    commit 5a4e33c upstream.
    
    Fix the displayed phase for the ad9523 driver. Currently the most
    significant decimal place is dropped and all other digits are shifted one
    to the left. This is due to a multiplication by 10, which is not necessary,
    so remove it.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
    Fixes: cd1678f ("iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator")
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    larsclausen authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    4e834c7 View commit details
    Browse the repository at this point in the history
  24. iio: ad9523: Fix return value for ad952x_store()

    commit 9a5094c upstream.
    
    A sysfs write callback function needs to either return the number of
    consumed characters or an error.
    
    The ad952x_store() function currently returns 0 if the input value was "0",
    this will signal that no characters have been consumed and the function
    will be called repeatedly in a loop indefinitely. Fix this by returning
    number of supplied characters to indicate that the whole input string has
    been consumed.
    
    Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
    Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
    Fixes: cd1678f ("iio: frequency: New driver for AD9523 SPI Low Jitter Clock Generator")
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    larsclausen authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    d4e5a9e View commit details
    Browse the repository at this point in the history
  25. vmw_balloon: fix inflation of 64-bit GFNs

    commit 0975569 upstream.
    
    When balloon batching is not supported by the hypervisor, the guest
    frame number (GFN) must fit in 32-bit. However, due to a bug, this check
    was mistakenly ignored. In practice, when total RAM is greater than
    16TB, the balloon does not work currently, making this bug unlikely to
    happen.
    
    Fixes: ef0f8f1 ("VMware balloon: partially inline vmballoon_reserve_page.")
    Cc: stable@vger.kernel.org
    Reviewed-by: Xavier Deguillard <xdeguillard@vmware.com>
    Signed-off-by: Nadav Amit <namit@vmware.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    anadav authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    0e0dd1a View commit details
    Browse the repository at this point in the history
  26. vmw_balloon: do not use 2MB without batching

    commit 5081efd upstream.
    
    If the hypervisor sets 2MB batching is on, while batching is cleared,
    the balloon code breaks. In this case the legacy mechanism is used with
    2MB page. The VM would report a 2MB page is ballooned, and the
    hypervisor would only take the first 4KB.
    
    While the hypervisor should not report such settings, make the code more
    robust by not enabling 2MB support without batching.
    
    Fixes: 365bd7e ("VMware balloon: Support 2m page ballooning.")
    Cc: stable@vger.kernel.org
    Reviewed-by: Xavier Deguillard <xdeguillard@vmware.com>
    Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    anadav authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    fa51177 View commit details
    Browse the repository at this point in the history
  27. vmw_balloon: VMCI_DOORBELL_SET does not check status

    commit ce66433 upstream.
    
    When vmballoon_vmci_init() sets a doorbell using VMCI_DOORBELL_SET, for
    some reason it does not consider the status and looks at the result.
    However, the hypervisor does not update the result - it updates the
    status. This might cause VMCI doorbell not to be enabled, resulting in
    degraded performance.
    
    Fixes: 48e3d66 ("VMware balloon: Enable notification via VMCI")
    Cc: stable@vger.kernel.org
    Reviewed-by: Xavier Deguillard <xdeguillard@vmware.com>
    Signed-off-by: Nadav Amit <namit@vmware.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    anadav authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    1893974 View commit details
    Browse the repository at this point in the history
  28. vmw_balloon: fix VMCI use when balloon built into kernel

    commit c3cc1b0 upstream.
    
    Currently, when all modules, including VMCI and VMware balloon are built
    into the kernel, the initialization of the balloon happens before the
    VMCI is probed. As a result, the balloon fails to initialize the VMCI
    doorbell, which it uses to get asynchronous requests for balloon size
    changes.
    
    The problem can be seen in the logs, in the form of the following
    message:
    	"vmw_balloon: failed to initialize vmci doorbell"
    
    The driver would work correctly but slightly less efficiently, probing
    for requests periodically. This patch changes the balloon to be
    initialized using late_initcall() instead of module_init() to address
    this issue. It does not address a situation in which VMCI is built as a
    module and the balloon is built into the kernel.
    
    Fixes: 48e3d66 ("VMware balloon: Enable notification via VMCI")
    Cc: stable@vger.kernel.org
    Reviewed-by: Xavier Deguillard <xdeguillard@vmware.com>
    Signed-off-by: Nadav Amit <namit@vmware.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    anadav authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    604c801 View commit details
    Browse the repository at this point in the history
  29. rtc: omap: fix potential crash on power off

    commit 5c8b84f upstream.
    
    Do not set the system power-off callback and omap power-off rtc pointer
    until we're done setting up our device to avoid leaving stale pointers
    around after a late probe error.
    
    Fixes: 97ea190 ("rtc: omap: Support ext_wakeup configuration")
    Cc: stable <stable@vger.kernel.org>     # 4.9
    Cc: Marcin Niestroj <m.niestroj@grinn-global.com>
    Cc: Tony Lindgren <tony@atomide.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Tony Lindgren <tony@atomide.com>
    Reviewed-by: Marcin Niestroj <m.niestroj@grinn-global.com>
    Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jhovold authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    4e935c2 View commit details
    Browse the repository at this point in the history
  30. tracing: Do not call start/stop() functions when tracing_on does not …

    …change
    
    commit f143641 upstream.
    
    Currently, when one echo's in 1 into tracing_on, the current tracer's
    "start()" function is executed, even if tracing_on was already one. This can
    lead to strange side effects. One being that if the hwlat tracer is enabled,
    and someone does "echo 1 > tracing_on" into tracing_on, the hwlat tracer's
    start() function is called again which will recreate another kernel thread,
    and make it unable to remove the old one.
    
    Link: http://lkml.kernel.org/r/1533120354-22923-1-git-send-email-erica.bugden@linutronix.de
    
    Cc: stable@vger.kernel.org
    Fixes: 2df8f8a ("tracing: Fix regression with irqsoff tracer and tracing_on file")
    Reported-by: Erica Bugden <erica.bugden@linutronix.de>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rostedt authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    dc69731 View commit details
    Browse the repository at this point in the history
  31. tracing/blktrace: Fix to allow setting same value

    commit 757d914 upstream.
    
    Masami Hiramatsu reported:
    
      Current trace-enable attribute in sysfs returns an error
      if user writes the same setting value as current one,
      e.g.
    
        # cat /sys/block/sda/trace/enable
        0
        # echo 0 > /sys/block/sda/trace/enable
        bash: echo: write error: Invalid argument
        # echo 1 > /sys/block/sda/trace/enable
        # echo 1 > /sys/block/sda/trace/enable
        bash: echo: write error: Device or resource busy
    
      But this is not a preferred behavior, it should ignore
      if new setting is same as current one. This fixes the
      problem as below.
    
        # cat /sys/block/sda/trace/enable
        0
        # echo 0 > /sys/block/sda/trace/enable
        # echo 1 > /sys/block/sda/trace/enable
        # echo 1 > /sys/block/sda/trace/enable
    
    Link: http://lkml.kernel.org/r/20180816103802.08678002@gandalf.local.home
    
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jens Axboe <axboe@kernel.dk>
    Cc: linux-block@vger.kernel.org
    Cc: stable@vger.kernel.org
    Fixes: cd649b8 ("blktrace: remove sysfs_blk_trace_enable_show/store()")
    Reported-by: Masami Hiramatsu <mhiramat@kernel.org>
    Tested-by: Masami Hiramatsu <mhiramat@kernel.org>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rostedt authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    941ca8d View commit details
    Browse the repository at this point in the history
  32. uprobes: Use synchronize_rcu() not synchronize_sched()

    commit 016f8ff upstream.
    
    While debugging another bug, I was looking at all the synchronize*()
    functions being used in kernel/trace, and noticed that trace_uprobes was
    using synchronize_sched(), with a comment to synchronize with
    {u,ret}_probe_trace_func(). When looking at those functions, the data is
    protected with "rcu_read_lock()" and not with "rcu_read_lock_sched()". This
    is using the wrong synchronize_*() function.
    
    Link: http://lkml.kernel.org/r/20180809160553.469e1e32@gandalf.local.home
    
    Cc: stable@vger.kernel.org
    Fixes: 70ed91c ("tracing/uprobes: Support ftrace_event_file base multibuffer")
    Acked-by: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rostedt authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    0ef6063 View commit details
    Browse the repository at this point in the history
  33. mfd: hi655x: Fix regmap area declared size for hi655x

    commit 6afebb7 upstream.
    
    Fixes https://bugs.linaro.org/show_bug.cgi?id=3903
    
    LTP Functional tests have caused a bad paging request when triggering
    the regmap_read_debugfs() logic of the device PMIC Hi6553 (reading
    regmap/f8000000.pmic/registers file during read_all test):
    
    Unable to handle kernel paging request at virtual address ffff0
    [ffff00000984e000] pgd=0000000077ffe803, pud=0000000077ffd803,0
    Internal error: Oops: 96000007 [Freescale#1] SMP
    ...
    Hardware name: HiKey Development Board (DT)
    ...
    Call trace:
     regmap_mmio_read8+0x24/0x40
     regmap_mmio_read+0x48/0x70
     _regmap_bus_reg_read+0x38/0x48
     _regmap_read+0x68/0x170
     regmap_read+0x50/0x78
     regmap_read_debugfs+0x1a0/0x308
     regmap_map_read_file+0x48/0x58
     full_proxy_read+0x68/0x98
     __vfs_read+0x48/0x80
     vfs_read+0x94/0x150
     SyS_read+0x6c/0xd8
     el0_svc_naked+0x30/0x34
    Code: aa1e03e0 d503201f f9400280 8b334000 (39400000)
    
    Investigations have showed that, when triggered by debugfs read()
    handler, the mmio regmap logic was reading a bigger (16k) register area
    than the one mapped by devm_ioremap_resource() during hi655x-pmic probe
    time (4k).
    
    This commit changes hi655x's max register, according to HW specs, to be
    the same as the one declared in the pmic device in hi6220's dts, fixing
    the issue.
    
    Cc: <stable@vger.kernel.org> #v4.9 #v4.14 #v4.16 #v4.17
    Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
    Signed-off-by: Lee Jones <lee.jones@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Rafael David Tinoco authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    262f38f View commit details
    Browse the repository at this point in the history
  34. 9p: fix multiple NULL-pointer-dereferences

    commit 10aa145 upstream.
    
    Added checks to prevent GPFs from raising.
    
    Link: http://lkml.kernel.org/r/20180727110558.5479-1-tomasbortoli@gmail.com
    Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
    Reported-by: syzbot+1a262da37d3bead15c39@syzkaller.appspotmail.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Tomas Bortoli authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    3ac733e View commit details
    Browse the repository at this point in the history
  35. PM / sleep: wakeup: Fix build error caused by missing SRCU support

    commit 3df6f61 upstream.
    
    Commit ea0212f (power: auto select CONFIG_SRCU) made the code in
    drivers/base/power/wakeup.c use SRCU instead of RCU, but it forgot to
    select CONFIG_SRCU in Kconfig, which leads to the following build
    error if CONFIG_SRCU is not selected somewhere else:
    
    drivers/built-in.o: In function `wakeup_source_remove':
    (.text+0x3c6fc): undefined reference to `synchronize_srcu'
    drivers/built-in.o: In function `pm_print_active_wakeup_sources':
    (.text+0x3c7a8): undefined reference to `__srcu_read_lock'
    drivers/built-in.o: In function `pm_print_active_wakeup_sources':
    (.text+0x3c84c): undefined reference to `__srcu_read_unlock'
    drivers/built-in.o: In function `device_wakeup_arm_wake_irqs':
    (.text+0x3d1d8): undefined reference to `__srcu_read_lock'
    drivers/built-in.o: In function `device_wakeup_arm_wake_irqs':
    (.text+0x3d228): undefined reference to `__srcu_read_unlock'
    drivers/built-in.o: In function `device_wakeup_disarm_wake_irqs':
    (.text+0x3d24c): undefined reference to `__srcu_read_lock'
    drivers/built-in.o: In function `device_wakeup_disarm_wake_irqs':
    (.text+0x3d29c): undefined reference to `__srcu_read_unlock'
    drivers/built-in.o:(.data+0x4158): undefined reference to `process_srcu'
    
    Fix this error by selecting CONFIG_SRCU when PM_SLEEP is enabled.
    
    Fixes: ea0212f (power: auto select CONFIG_SRCU)
    Cc: 4.2+ <stable@vger.kernel.org> # 4.2+
    Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
    [ rjw: Minor subject/changelog fixups ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    zhangyi089 authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    18c5d28 View commit details
    Browse the repository at this point in the history
  36. KVM: VMX: fixes for vmentry_l1d_flush module parameter

    commit 0027ff2 upstream.
    
    Two bug fixes:
    
    1) missing entries in the l1d_param array; this can cause a host crash
    if an access attempts to reach the missing entry. Future-proof the get
    function against any overflows as well.  However, the two entries
    VMENTER_L1D_FLUSH_EPT_DISABLED and VMENTER_L1D_FLUSH_NOT_REQUIRED must
    not be accepted by the parse function, so disable them there.
    
    2) invalid values must be rejected even if the CPU does not have the
    bug, so test for them before checking boot_cpu_has(X86_BUG_L1TF)
    
    ... and a small refactoring, since the .cmd field is redundant with
    the index in the array.
    
    Reported-by: Bandan Das <bsd@redhat.com>
    Cc: stable@vger.kernel.org
    Fixes: a7b9020
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    bonzini authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    8729412 View commit details
    Browse the repository at this point in the history
  37. xtensa: limit offsets in __loop_cache_{all,page}

    commit be75de2 upstream.
    
    When building kernel for xtensa cores with big cache lines (e.g. 128
    bytes or more) __loop_cache_all and __loop_cache_page may generate
    assembly instructions with immediate fields that are too big. This
    results in the following build errors:
    
      arch/xtensa/mm/misc.S: Assembler messages:
      arch/xtensa/mm/misc.S:464: Error: operand 2 of 'diwbi' has invalid value '256'
      arch/xtensa/mm/misc.S:464: Error: operand 2 of 'diwbi' has invalid value '384'
      arch/xtensa/kernel/head.S: Assembler messages:
      arch/xtensa/kernel/head.S:172: Error: operand 2 of 'diu' has invalid value '256'
      arch/xtensa/kernel/head.S:172: Error: operand 2 of 'diu' has invalid value '384'
      arch/xtensa/kernel/head.S:176: Error: operand 2 of 'iiu' has invalid value '256'
      arch/xtensa/kernel/head.S:176: Error: operand 2 of 'iiu' has invalid value '384'
      arch/xtensa/kernel/head.S:255: Error: operand 2 of 'diwb' has invalid value '256'
      arch/xtensa/kernel/head.S:255: Error: operand 2 of 'diwb' has invalid value '384'
    
    Add parameter max_immed to these macros and use it to limit values of
    immediate operands. Extract common code of these macros into the new
    macro __loop_cache_unroll.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jcmvbkbc authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    e996a24 View commit details
    Browse the repository at this point in the history
  38. xtensa: increase ranges in ___invalidate_{i,d}cache_all

    commit fec3259 upstream.
    
    Cache invalidation macros use cache line size to iterate over
    invalidated cache lines, assuming that all cache ways are invalidated by
    single instruction, but xtensa ISA recommends to not assume that for
    future compatibility:
      In some implementations all ways at index Addry-1..z are invalidated
      regardless of the specified way, but for future compatibility this
      behavior should not be assumed.
    
    Iterate over all cache ways in ___invalidate_icache_all and
    ___invalidate_dcache_all.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jcmvbkbc authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    7f2163b View commit details
    Browse the repository at this point in the history
  39. pnfs/blocklayout: off by one in bl_map_stripe()

    commit 0914bb9 upstream.
    
    "dev->nr_children" is the number of children which were parsed
    successfully in bl_parse_stripe().  It could be all of them and then, in
    that case, it is equal to v->stripe.volumes_count.  Either way, the >
    should be >= so that we don't go beyond the end of what we're supposed
    to.
    
    Fixes: 5c83746 ("pnfs/blocklayout: in-kernel GETDEVICEINFO XDR parsing")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Cc: stable@vger.kernel.org # 3.17+
    Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Dan Carpenter authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    9ba1a9e View commit details
    Browse the repository at this point in the history
  40. NFSv4 client live hangs after live data migration recovery

    commit 0f90be1 upstream.
    
    After a live data migration event at the NFS server, the client may send
    I/O requests to the wrong server, causing a live hang due to repeated
    recovery events.  On the wire, this will appear as an I/O request failing
    with NFS4ERR_BADSESSION, followed by successful CREATE_SESSION, repeatedly.
    NFS4ERR_BADSSESSION is returned because the session ID being used was
    issued by the other server and is not valid at the old server.
    
    The failure is caused by async worker threads having cached the transport
    (xprt) in the rpc_task structure.  After the migration recovery completes,
    the task is redispatched and the task resends the request to the wrong
    server based on the old value still present in tk_xprt.
    
    The solution is to recompute the tk_xprt field of the rpc_task structure
    so that the request goes to the correct server.
    
    Signed-off-by: Bill Baker <bill.baker@oracle.com>
    Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
    Tested-by: Helen Chao <helen.chao@oracle.com>
    Fixes: fb43d17 ("SUNRPC: Use the multipath iterator to assign a ...")
    Cc: stable@vger.kernel.org # v4.9+
    Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    webbaker0226 authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    b5bc39d View commit details
    Browse the repository at this point in the history
  41. ARM: tegra: Fix Tegra30 Cardhu PCA954x reset

    commit 6e18119 upstream.
    
    On all versions of Tegra30 Cardhu, the reset signal to the NXP PCA9546
    I2C mux is connected to the Tegra GPIO BB0. Currently, this pin on the
    Tegra is not configured as a GPIO but as a special-function IO (SFIO)
    that is multiplexing the pin to an I2S controller. On exiting system
    suspend, I2C commands sent to the PCA9546 are failing because there is
    no ACK. Although it is not possible to see exactly what is happening
    to the reset during suspend, by ensuring it is configured as a GPIO
    and driven high, to de-assert the reset, the failures are no longer
    seen.
    
    Please note that this GPIO is also used to drive the reset signal
    going to the camera connector on the board. However, given that there
    is no camera support currently for Cardhu, this should not have any
    impact.
    
    Fixes: 40431d1 ("ARM: tegra: enable PCA9546 on Cardhu")
    Cc: stable@vger.kernel.org
    Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
    Signed-off-by: Thierry Reding <treding@nvidia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jonhunter authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    ba99ff7 View commit details
    Browse the repository at this point in the history
  42. Replace magic for trusting the secondary keyring with #define

    commit 817aef2 upstream.
    
    Replace the use of a magic number that indicates that verify_*_signature()
    should use the secondary keyring with a symbol.
    
    Signed-off-by: Yannik Sembritzki <yannik@sembritzki.me>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Cc: keyrings@vger.kernel.org
    Cc: linux-security-module@vger.kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Yannik authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    40b08cd View commit details
    Browse the repository at this point in the history
  43. Fix kexec forbidding kernels signed with keys in the secondary keyrin…

    …g to boot
    
    commit ea93102 upstream.
    
    The split of .system_keyring into .builtin_trusted_keys and
    .secondary_trusted_keys broke kexec, thereby preventing kernels signed by
    keys which are now in the secondary keyring from being kexec'd.
    
    Fix this by passing VERIFY_USE_SECONDARY_KEYRING to
    verify_pefile_signature().
    
    Fixes: d3bfe84 ("certs: Add a secondary system keyring that can be added to dynamically")
    Signed-off-by: Yannik Sembritzki <yannik@sembritzki.me>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Cc: kexec@lists.infradead.org
    Cc: keyrings@vger.kernel.org
    Cc: linux-security-module@vger.kernel.org
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Yannik authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    7c439bc View commit details
    Browse the repository at this point in the history
  44. mm/tlb: Remove tlb_remove_table() non-concurrent condition

    commit a6f5720 upstream.
    
    Will noted that only checking mm_users is incorrect; we should also
    check mm_count in order to cover CPUs that have a lazy reference to
    this mm (and could do speculative TLB operations).
    
    If removing this turns out to be a performance issue, we can
    re-instate a more complete check, but in tlb_table_flush() eliding the
    call_rcu_sched().
    
    Fixes: 2672391 ("mm, powerpc: move the RCU page-table freeing into generic code")
    Reported-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Acked-by: Rik van Riel <riel@surriel.com>
    Acked-by: Will Deacon <will.deacon@arm.com>
    Cc: Nicholas Piggin <npiggin@gmail.com>
    Cc: David Miller <davem@davemloft.net>
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Peter Zijlstra authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    04d1d58 View commit details
    Browse the repository at this point in the history
  45. iommu/vt-d: Add definitions for PFSID

    commit 0f72556 upstream.
    
    When SRIOV VF device IOTLB is invalidated, we need to provide
    the PF source ID such that IOMMU hardware can gauge the depth
    of invalidation queue which is shared among VFs. This is needed
    when device invalidation throttle (DIT) capability is supported.
    
    This patch adds bit definitions for checking and tracking PFSID.
    
    Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
    Cc: stable@vger.kernel.org
    Cc: "Ashok Raj" <ashok.raj@intel.com>
    Cc: "Lu Baolu" <baolu.lu@linux.intel.com>
    Signed-off-by: Joerg Roedel <jroedel@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Jacob Pan authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    eada1b2 View commit details
    Browse the repository at this point in the history
  46. iommu/vt-d: Fix dev iotlb pfsid use

    commit 1c48db4 upstream.
    
    PFSID should be used in the invalidation descriptor for flushing
    device IOTLBs on SRIOV VFs.
    
    Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
    Cc: stable@vger.kernel.org
    Cc: "Ashok Raj" <ashok.raj@intel.com>
    Cc: "Lu Baolu" <baolu.lu@linux.intel.com>
    Signed-off-by: Joerg Roedel <jroedel@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Jacob Pan authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    b68377c View commit details
    Browse the repository at this point in the history
  47. osf_getdomainname(): use copy_to_user()

    commit 9ba3eb5 upstream.
    
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Al Viro authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    d2f96e1 View commit details
    Browse the repository at this point in the history
  48. sys: don't hold uts_sem while accessing userspace memory

    commit 42a0cc3 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: 1da177e ("Linux-2.6.12-rc2")
    Signed-off-by: Jann Horn <jannh@google.com>
    Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    thejh authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    55463c6 View commit details
    Browse the repository at this point in the history
  49. userns: move user access out of the mutex

    commit 5820f14 upstream.
    
    The old code would hold the userns_state_mutex indefinitely if
    memdup_user_nul stalled due to e.g. a userfault region. Prevent that by
    moving the memdup_user_nul in front of the mutex_lock().
    
    Note: This changes the error precedence of invalid buf/count/*ppos vs
    map already written / capabilities missing.
    
    Fixes: 22d917d ("userns: Rework the user_namespace adding uid/gid...")
    Cc: stable@vger.kernel.org
    Signed-off-by: Jann Horn <jannh@google.com>
    Acked-by: Christian Brauner <christian@brauner.io>
    Acked-by: Serge Hallyn <serge@hallyn.com>
    Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    thejh authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    a56a154 View commit details
    Browse the repository at this point in the history
  50. ubifs: Fix memory leak in lprobs self-check

    commit eef1981 upstream.
    
    Allocate the buffer after we return early.
    Otherwise memory is being leaked.
    
    Cc: <stable@vger.kernel.org>
    Fixes: 1e51764 ("UBIFS: add new flash file system")
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    richardweinberger authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    0d1694b View commit details
    Browse the repository at this point in the history
  51. Revert "UBIFS: Fix potential integer overflow in allocation"

    commit 08acbdd upstream.
    
    This reverts commit 353748a.
    It bypassed the linux-mtd review process and fixes the issue not as it
    should.
    
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Silvio Cesare <silvio.cesare@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    richardweinberger authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    48e1148 View commit details
    Browse the repository at this point in the history
  52. ubifs: Check data node size before truncate

    commit 95a22d2 upstream.
    
    Check whether the size is within bounds before using it.
    If the size is not correct, abort and dump the bad data node.
    
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Silvio Cesare <silvio.cesare@gmail.com>
    Cc: stable@vger.kernel.org
    Fixes: 1e51764 ("UBIFS: add new flash file system")
    Reported-by: Silvio Cesare <silvio.cesare@gmail.com>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    richardweinberger authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    1bc1f0f View commit details
    Browse the repository at this point in the history
  53. ubifs: Fix synced_i_size calculation for xattr inodes

    commit 5996559 upstream.
    
    In ubifs_jnl_update() we sync parent and child inodes to the flash,
    in case of xattrs, the parent inode (AKA host inode) has a non-zero
    data_len. Therefore we need to adjust synced_i_size too.
    
    This issue was reported by ubifs self tests unter a xattr related work
    load.
    UBIFS error (ubi0:0 pid 1896): dbg_check_synced_i_size: ui_size is 4, synced_i_size is 0, but inode is clean
    UBIFS error (ubi0:0 pid 1896): dbg_check_synced_i_size: i_ino 65, i_mode 0x81a4, i_size 4
    
    Cc: <stable@vger.kernel.org>
    Fixes: 1e51764 ("UBIFS: add new flash file system")
    Signed-off-by: Richard Weinberger <richard@nod.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    richardweinberger authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    36ac3a0 View commit details
    Browse the repository at this point in the history
  54. pwm: tiehrpwm: Fix disabling of output of PWMs

    commit 38dabd9 upstream.
    
    pwm-tiehrpwm driver disables PWM output by putting it in low output
    state via active AQCSFRC register in ehrpwm_pwm_disable(). But, the
    AQCSFRC shadow register is not updated. Therefore, when shadow AQCSFRC
    register is re-enabled in ehrpwm_pwm_enable() (say to enable second PWM
    output), previous settings are lost as shadow register value is loaded
    into active register. This results in things like PWMA getting enabled
    automatically, when PWMB is enabled and vice versa. Fix this by
    updating AQCSFRC shadow register as well during ehrpwm_pwm_disable().
    
    Fixes: 19891b2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM")
    Cc: stable@vger.kernel.org
    Signed-off-by: Vignesh R <vigneshr@ti.com>
    Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    r-vignesh authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    8001317 View commit details
    Browse the repository at this point in the history
  55. fb: fix lost console when the user unplugs a USB adapter

    commit 8c5b044 upstream.
    
    I have a USB display adapter using the udlfb driver and I use it on an ARM
    board that doesn't have any graphics card. When I plug the adapter in, the
    console is properly displayed, however when I unplug and re-plug the
    adapter, the console is not displayed and I can't access it until I reboot
    the board.
    
    The reason is this:
    When the adapter is unplugged, dlfb_usb_disconnect calls
    unlink_framebuffer, then it waits until the reference count drops to zero
    and then it deallocates the framebuffer. However, the console that is
    attached to the framebuffer device keeps the reference count non-zero, so
    the framebuffer device is never destroyed. When the USB adapter is plugged
    again, it creates a new device /dev/fb1 and the console is not attached to
    it.
    
    This patch fixes the bug by unbinding the console from unlink_framebuffer.
    The code to unbind the console is moved from do_unregister_framebuffer to
    a function unbind_console. When the console is unbound, the reference
    count drops to zero and the udlfb driver frees the framebuffer. When the
    adapter is plugged back, a new framebuffer is created and the console is
    attached to it.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: Dave Airlie <airlied@redhat.com>
    Cc: Bernie Thompson <bernie@plugable.com>
    Cc: Ladislav Michl <ladis@linux-mips.org>
    Cc: stable@vger.kernel.org
    [b.zolnierkie: preserve old behavior for do_unregister_framebuffer()]
    Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Mikulas Patocka authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    3752de7 View commit details
    Browse the repository at this point in the history
  56. udlfb: set optimal write delay

    commit bb24153 upstream.
    
    The default delay 5 jiffies is too much when the kernel is compiled with
    HZ=100 - it results in jumpy cursor in Xwindow.
    
    In order to find out the optimal delay, I benchmarked the driver on
    1280x720x30fps video. I found out that with HZ=1000, 10ms is acceptable,
    but with HZ=250 or HZ=300, we need 4ms, so that the video is played
    without any frame skips.
    
    This patch changes the delay to this value.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Mikulas Patocka authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    a328c4c View commit details
    Browse the repository at this point in the history
  57. getxattr: use correct xattr length

    commit 82c9a92 upstream.
    
    When running in a container with a user namespace, if you call getxattr
    with name = "system.posix_acl_access" and size % 8 != 4, then getxattr
    silently skips the user namespace fixup that it normally does resulting in
    un-fixed-up data being returned.
    This is caused by posix_acl_fix_xattr_to_user() being passed the total
    buffer size and not the actual size of the xattr as returned by
    vfs_getxattr().
    This commit passes the actual length of the xattr as returned by
    vfs_getxattr() down.
    
    A reproducer for the issue is:
    
      touch acl_posix
    
      setfacl -m user:0:rwx acl_posix
    
    and the compile:
    
      #define _GNU_SOURCE
      #include <errno.h>
      #include <stdio.h>
      #include <stdlib.h>
      #include <string.h>
      #include <sys/types.h>
      #include <unistd.h>
      #include <attr/xattr.h>
    
      /* Run in user namespace with nsuid 0 mapped to uid != 0 on the host. */
      int main(int argc, void **argv)
      {
              ssize_t ret1, ret2;
              char buf1[128], buf2[132];
              int fret = EXIT_SUCCESS;
              char *file;
    
              if (argc < 2) {
                      fprintf(stderr,
                              "Please specify a file with "
                              "\"system.posix_acl_access\" permissions set\n");
                      _exit(EXIT_FAILURE);
              }
              file = argv[1];
    
              ret1 = getxattr(file, "system.posix_acl_access",
                              buf1, sizeof(buf1));
              if (ret1 < 0) {
                      fprintf(stderr, "%s - Failed to retrieve "
                                      "\"system.posix_acl_access\" "
                                      "from \"%s\"\n", strerror(errno), file);
                      _exit(EXIT_FAILURE);
              }
    
              ret2 = getxattr(file, "system.posix_acl_access",
                              buf2, sizeof(buf2));
              if (ret2 < 0) {
                      fprintf(stderr, "%s - Failed to retrieve "
                                      "\"system.posix_acl_access\" "
                                      "from \"%s\"\n", strerror(errno), file);
                      _exit(EXIT_FAILURE);
              }
    
              if (ret1 != ret2) {
                      fprintf(stderr, "The value of \"system.posix_acl_"
                                      "access\" for file \"%s\" changed "
                                      "between two successive calls\n", file);
                      _exit(EXIT_FAILURE);
              }
    
              for (ssize_t i = 0; i < ret2; i++) {
                      if (buf1[i] == buf2[i])
                              continue;
    
                      fprintf(stderr,
                              "Unexpected different in byte %zd: "
                              "%02x != %02x\n", i, buf1[i], buf2[i]);
                      fret = EXIT_FAILURE;
              }
    
              if (fret == EXIT_SUCCESS)
                      fprintf(stderr, "Test passed\n");
              else
                      fprintf(stderr, "Test failed\n");
    
              _exit(fret);
      }
    and run:
    
      ./tester acl_posix
    
    On a non-fixed up kernel this should return something like:
    
      root@c1:/# ./t
      Unexpected different in byte 16: ffffffa0 != 00
      Unexpected different in byte 17: ffffff86 != 00
      Unexpected different in byte 18: 01 != 00
    
    and on a fixed kernel:
    
      root@c1:~# ./t
      Test passed
    
    Cc: stable@vger.kernel.org
    Fixes: 2f6f065 ("userns: Convert vfs posix_acl support to use kuids and kgids")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=199945
    Reported-by: Colin Watson <cjwatson@ubuntu.com>
    Signed-off-by: Christian Brauner <christian@brauner.io>
    Acked-by: Serge Hallyn <serge@hallyn.com>
    Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    brauner authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    6fdad64 View commit details
    Browse the repository at this point in the history
  58. libnvdimm: fix ars_status output length calculation

    commit 286e877 upstream.
    
    Commit efda1b5 ("acpi, nfit, libnvdimm: fix / harden ars_status output length handling")
    Introduced additional hardening for ambiguity in the ACPI spec for
    ars_status output sizing. However, it had a couple of cases mixed up.
    Where it should have been checking for (and returning) "out_field[1] -
    4" it was using "out_field[1] - 8" and vice versa.
    
    This caused a four byte discrepancy in the buffer size passed on to
    the command handler, and in some cases, this caused memory corruption
    like:
    
      ./daxdev-errors.sh: line 76: 24104 Aborted   (core dumped) ./daxdev-errors $busdev $region
      malloc(): memory corruption
      Program received signal SIGABRT, Aborted.
      [...]
      Freescale#5  0x00007ffff7865a2e in calloc () from /lib64/libc.so.6
      Freescale#6  0x00007ffff7bc2970 in ndctl_bus_cmd_new_ars_status (ars_cap=ars_cap@entry=0x6153b0) at ars.c:136
      Freescale#7  0x0000000000401644 in check_ars_status (check=0x7fffffffdeb0, bus=0x604c20) at daxdev-errors.c:144
      Freescale#8  test_daxdev_clear_error (region_name=<optimized out>, bus_name=<optimized out>)
          at daxdev-errors.c:332
    
    Cc: <stable@vger.kernel.org>
    Cc: Dave Jiang <dave.jiang@intel.com>
    Cc: Keith Busch <keith.busch@intel.com>
    Cc: Lukasz Dorau <lukasz.dorau@intel.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Fixes: efda1b5 ("acpi, nfit, libnvdimm: fix / harden ars_status output length handling")
    Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
    Reviewed-by: Keith Busch <keith.busch@intel.com>
    Signed-of-by: Dave Jiang <dave.jiang@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    stellarhopper authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    05a085c View commit details
    Browse the repository at this point in the history
  59. printk/tracing: Do not trace printk_nmi_enter()

    commit d1c392c upstream.
    
    I hit the following splat in my tests:
    
    ------------[ cut here ]------------
    IRQs not enabled as expected
    WARNING: CPU: 3 PID: 0 at kernel/time/tick-sched.c:982 tick_nohz_idle_enter+0x44/0x8c
    Modules linked in: ip6t_REJECT nf_reject_ipv6 ip6table_filter ip6_tables ipv6
    CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.19.0-rc2-test+ Freescale#2
    Hardware name: MSI MS-7823/CSM-H87M-G43 (MS-7823), BIOS V1.6 02/22/2014
    EIP: tick_nohz_idle_enter+0x44/0x8c
    Code: ec 05 00 00 00 75 26 83 b8 c0 05 00 00 00 75 1d 80 3d d0 36 3e c1 00
    75 14 68 94 63 12 c1 c6 05 d0 36 3e c1 01 e8 04 ee f8 ff <0f> 0b 58 fa bb a0
    e5 66 c1 e8 25 0f 04 00 64 03 1d 28 31 52 c1 8b
    EAX: 0000001c EBX: f26e7f8c ECX: 00000006 EDX: 00000007
    ESI: f26dd1c0 EDI: 00000000 EBP: f26e7f40 ESP: f26e7f38
    DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010296
    CR0: 80050033 CR2: 0813c6b0 CR3: 2f342000 CR4: 001406f0
    Call Trace:
     do_idle+0x33/0x202
     cpu_startup_entry+0x61/0x63
     start_secondary+0x18e/0x1ed
     startup_32_smp+0x164/0x168
    irq event stamp: 18773830
    hardirqs last  enabled at (18773829): [<c040150c>] trace_hardirqs_on_thunk+0xc/0x10
    hardirqs last disabled at (18773830): [<c040151c>] trace_hardirqs_off_thunk+0xc/0x10
    softirqs last  enabled at (18773824): [<c0ddaa6f>] __do_softirq+0x25f/0x2bf
    softirqs last disabled at (18773767): [<c0416bbe>] call_on_stack+0x45/0x4b
    ---[ end trace b7c64aa79e17954a ]---
    
    After a bit of debugging, I found what was happening. This would trigger
    when performing "perf" with a high NMI interrupt rate, while enabling and
    disabling function tracer. Ftrace uses breakpoints to convert the nops at
    the start of functions to calls to the function trampolines. The breakpoint
    traps disable interrupts and this makes calls into lockdep via the
    trace_hardirqs_off_thunk in the entry.S code. What happens is the following:
    
      do_idle {
    
        [interrupts enabled]
    
        <interrupt> [interrupts disabled]
    	TRACE_IRQS_OFF [lockdep says irqs off]
    	[...]
    	TRACE_IRQS_IRET
    	    test if pt_regs say return to interrupts enabled [yes]
    	    TRACE_IRQS_ON [lockdep says irqs are on]
    
    	    <nmi>
    		nmi_enter() {
    		    printk_nmi_enter() [traced by ftrace]
    		    [ hit ftrace breakpoint ]
    		    <breakpoint exception>
    			TRACE_IRQS_OFF [lockdep says irqs off]
    			[...]
    			TRACE_IRQS_IRET [return from breakpoint]
    			   test if pt_regs say interrupts enabled [no]
    			   [iret back to interrupt]
    	   [iret back to code]
    
        tick_nohz_idle_enter() {
    
    	lockdep_assert_irqs_enabled() [lockdep say no!]
    
    Although interrupts are indeed enabled, lockdep thinks it is not, and since
    we now do asserts via lockdep, it gives a false warning. The issue here is
    that printk_nmi_enter() is called before lockdep_off(), which disables
    lockdep (for this reason) in NMIs. By simply not allowing ftrace to see
    printk_nmi_enter() (via notrace annotation) we keep lockdep from getting
    confused.
    
    Cc: stable@vger.kernel.org
    Fixes: 42a0bb3 ("printk/nmi: generic solution for safe printk in NMI")
    Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
    Acked-by: Petr Mladek <pmladek@suse.com>
    Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    rostedt authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    6c6d174 View commit details
    Browse the repository at this point in the history
  60. bcache: release dc->writeback_lock properly in bch_writeback_thread()

    commit 3943b04 upstream.
    
    The writeback thread would exit with a lock held when the cache device
    is detached via sysfs interface, fix it by releasing the held lock
    before exiting the while-loop.
    
    Fixes: fadd94e (bcache: quit dc->writeback_thread when BCACHE_DEV_DETACHING is set)
    Signed-off-by: Shan Hai <shan.hai@oracle.com>
    Signed-off-by: Coly Li <colyli@suse.de>
    Tested-by: Shenghui Wang <shhuiw@foxmail.com>
    Cc: stable@vger.kernel.org Freescale#4.17+
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Shan Hai authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    3ddf06c View commit details
    Browse the repository at this point in the history
  61. perf auxtrace: Fix queue resize

    commit 99cbbe5 upstream.
    
    When the number of queues grows beyond 32, the array of queues is
    resized but not all members were being copied. Fix by also copying
    'tid', 'cpu' and 'set'.
    
    Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: stable@vger.kernel.org
    Fixes: e502789 ("perf auxtrace: Add helpers for queuing AUX area tracing data")
    Link: http://lkml.kernel.org/r/20180814084608.6563-1-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ahunter6 authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    e0ec112 View commit details
    Browse the repository at this point in the history
  62. crypto: vmx - Fix sleep-in-atomic bugs

    commit 0522236 upstream.
    
    This patch fixes sleep-in-atomic bugs in AES-CBC and AES-XTS VMX
    implementations. The problem is that the blkcipher_* functions should
    not be called in atomic context.
    
    The bugs can be reproduced via the AF_ALG interface by trying to
    encrypt/decrypt sufficiently large buffers (at least 64 KiB) using the
    VMX implementations of 'cbc(aes)' or 'xts(aes)'. Such operations then
    trigger BUG in crypto_yield():
    
    [  891.863680] BUG: sleeping function called from invalid context at include/crypto/algapi.h:424
    [  891.864622] in_atomic(): 1, irqs_disabled(): 0, pid: 12347, name: kcapi-enc
    [  891.864739] 1 lock held by kcapi-enc/12347:
    [  891.864811]  #0: 00000000f5d42c46 (sk_lock-AF_ALG){+.+.}, at: skcipher_recvmsg+0x50/0x530
    [  891.865076] CPU: 5 PID: 12347 Comm: kcapi-enc Not tainted 4.19.0-0.rc0.git3.1.fc30.ppc64le Freescale#1
    [  891.865251] Call Trace:
    [  891.865340] [c0000003387578c0] [c000000000d67ea4] dump_stack+0xe8/0x164 (unreliable)
    [  891.865511] [c000000338757910] [c000000000172a58] ___might_sleep+0x2f8/0x310
    [  891.865679] [c000000338757990] [c0000000006bff74] blkcipher_walk_done+0x374/0x4a0
    [  891.865825] [c0000003387579e0] [d000000007e73e70] p8_aes_cbc_encrypt+0x1c8/0x260 [vmx_crypto]
    [  891.865993] [c000000338757ad0] [c0000000006c0ee0] skcipher_encrypt_blkcipher+0x60/0x80
    [  891.866128] [c000000338757b10] [c0000000006ec504] skcipher_recvmsg+0x424/0x530
    [  891.866283] [c000000338757bd0] [c000000000b00654] sock_recvmsg+0x74/0xa0
    [  891.866403] [c000000338757c10] [c000000000b00f64] ___sys_recvmsg+0xf4/0x2f0
    [  891.866515] [c000000338757d90] [c000000000b02bb8] __sys_recvmsg+0x68/0xe0
    [  891.866631] [c000000338757e30] [c00000000000bbe4] system_call+0x5c/0x70
    
    Fixes: 8c755ac ("crypto: vmx - Adding CBC routines for VMX module")
    Fixes: c07f5d3 ("crypto: vmx - Adding support for XTS")
    Cc: stable@vger.kernel.org
    Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    WOnder93 authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    4a219e4 View commit details
    Browse the repository at this point in the history
  63. crypto: caam/jr - fix descriptor DMA unmapping

    commit cc98963 upstream.
    
    Descriptor address needs to be swapped to CPU endianness before being
    DMA unmapped.
    
    Cc: <stable@vger.kernel.org> # 4.8+
    Fixes: 261ea05 ("crypto: caam - handle core endianness != caam endianness")
    Reported-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
    Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    horiag authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    ac61741 View commit details
    Browse the repository at this point in the history
  64. fs/quota: Fix spectre gadget in do_quotactl

    commit 7b6924d upstream.
    
    'type' is user-controlled, so sanitize it after the bounds check to
    avoid using it in speculative execution. This covers the following
    potential gadgets detected with the help of smatch:
    
    * fs/ext4/super.c:5741 ext4_quota_read() warn: potential spectre issue
      'sb_dqopt(sb)->files' [r]
    * fs/ext4/super.c:5778 ext4_quota_write() warn: potential spectre issue
      'sb_dqopt(sb)->files' [r]
    * fs/f2fs/super.c:1552 f2fs_quota_read() warn: potential spectre issue
      'sb_dqopt(sb)->files' [r]
    * fs/f2fs/super.c:1608 f2fs_quota_write() warn: potential spectre issue
      'sb_dqopt(sb)->files' [r]
    * fs/quota/dquot.c:412 mark_info_dirty() warn: potential spectre issue
      'sb_dqopt(sb)->info' [w]
    * fs/quota/dquot.c:933 dqinit_needed() warn: potential spectre issue
      'dquots' [r]
    * fs/quota/dquot.c:2112 dquot_commit_info() warn: potential spectre
      issue 'dqopt->ops' [r]
    * fs/quota/dquot.c:2362 vfs_load_quota_inode() warn: potential spectre
      issue 'dqopt->files' [w] (local cap)
    * fs/quota/dquot.c:2369 vfs_load_quota_inode() warn: potential spectre
      issue 'dqopt->ops' [w] (local cap)
    * fs/quota/dquot.c:2370 vfs_load_quota_inode() warn: potential spectre
      issue 'dqopt->info' [w] (local cap)
    * fs/quota/quota.c:110 quota_getfmt() warn: potential spectre issue
      'sb_dqopt(sb)->info' [r]
    * fs/quota/quota_v2.c:84 v2_check_quota_file() warn: potential spectre
      issue 'quota_magics' [w]
    * fs/quota/quota_v2.c:85 v2_check_quota_file() warn: potential spectre
      issue 'quota_versions' [w]
    * fs/quota/quota_v2.c:96 v2_read_file_info() warn: potential spectre
      issue 'dqopt->info' [r]
    * fs/quota/quota_v2.c:172 v2_write_file_info() warn: potential spectre
      issue 'dqopt->info' [r]
    
    Additionally, a quick inspection indicates there are array accesses with
    'type' in quota_on() and quota_off() functions which are also addressed
    by this.
    
    Cc: Josh Poimboeuf <jpoimboe@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Jeremy Cline <jcline@redhat.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    jeremycline authored and gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    0515258 View commit details
    Browse the repository at this point in the history
  65. Linux 4.9.126

    gregkh committed Sep 9, 2018
    Configuration menu
    Copy the full SHA
    66f5a87 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2018

  1. Merge tag 'v4.9.126' into 4.9-2.0.x-imx

    This is the 4.9.126 stable release
    
    Conflicts:
    	arch/arm/boot/dts/imx6sx.dtsi
    	arch/arm64/kernel/alternative.c
    	drivers/gpu/drm/imx/imx-ldb.c
    	drivers/staging/android/ion/ion_priv.h
    	include/linux/cpu.h
    gibsson committed Sep 12, 2018
    Configuration menu
    Copy the full SHA
    33446a9 View commit details
    Browse the repository at this point in the history