18 Feb, 2017

9 commits

  • [ Upstream commit bd4ce941c8d5b862b2f83364be5dbe8fc8ab48f8 ]

    mlx4 may schedule napi from a workqueue. Afterwards, softirqs are not run
    in a deterministic time frame and the following message may be logged:
    NOHZ: local_softirq_pending 08

    The problem is the same as what was described in commit ec13ee80145c
    ("virtio_net: invoke softirqs after __napi_schedule") and this patch
    applies the same fix to mlx4.

    Fixes: 07841f9d94c1 ("net/mlx4_en: Schedule napi when RX buffers allocation fails")
    Cc: Eric Dumazet
    Signed-off-by: Benjamin Poirier
    Acked-by: Eric Dumazet
    Reviewed-by: Tariq Toukan
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Poirier
     
  • [ Upstream commit 2d6a0e9de03ee658a9adc3bfb2f0ca55dff1e478 ]

    Allocating USB buffers on the stack is not portable, and no longer
    works on x86_64 (with VMAP_STACK enabled as per default).

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • [ Upstream commit d41149145f98fe26dcd0bfd1d6cc095e6e041418 ]

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • [ Upstream commit 7926aff5c57b577ab0f43364ff0c59d968f6a414 ]

    Allocating USB buffers on the stack is not portable, and no longer
    works on x86_64 (with VMAP_STACK enabled as per default).

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • [ Upstream commit 5593523f968bc86d42a035c6df47d5e0979b5ace ]

    Allocating USB buffers on the stack is not portable, and no longer
    works on x86_64 (with VMAP_STACK enabled as per default).

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    References: https://bugs.debian.org/852556
    Reported-by: Lisandro Damián Nicanor Pérez Meyer
    Tested-by: Lisandro Damián Nicanor Pérez Meyer
    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • [ Upstream commit 837585a5375c38d40361cfe64e6fd11e1addb936 ]

    When IFF_VNET_HDR is enabled, a virtio_net header must precede data.
    Data length is verified to be greater than or equal to expected header
    length tun->vnet_hdr_sz before copying.

    Macvtap functions read the value once, but unless READ_ONCE is used,
    the compiler may ignore this and read multiple times. Enforce a single
    read and locally cached value to avoid updates between test and use.

    Signed-off-by: Willem de Bruijn
    Suggested-by: Eric Dumazet
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Willem de Bruijn
     
  • [ Upstream commit e1edab87faf6ca30cd137e0795bc73aa9a9a22ec ]

    When IFF_VNET_HDR is enabled, a virtio_net header must precede data.
    Data length is verified to be greater than or equal to expected header
    length tun->vnet_hdr_sz before copying.

    Read this value once and cache locally, as it can be updated between
    the test and use (TOCTOU).

    Signed-off-by: Willem de Bruijn
    Reported-by: Dmitry Vyukov
    CC: Eric Dumazet
    Acked-by: Eric Dumazet
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Willem de Bruijn
     
  • [ Upstream commit 0a764db103376cf69d04449b10688f3516cc0b88 ]

    DW GMAC databook says the following about bits in "Register 15 (Interrupt
    Mask Register)":
    --------------------------->8-------------------------
    When set, this bit __disables_the_assertion_of_the_interrupt_signal__
    because of the setting of XXX bit in Register 14 (Interrupt
    Status Register).
    --------------------------->8-------------------------

    In fact even if we mask one bit in the mask register it doesn't prevent
    corresponding bit to appear in the status register, it only disables
    interrupt generation for corresponding event.

    But currently we expect a bit different behavior: status bits to be in
    sync with their masks, i.e. if mask for bit A is set in the mask
    register then bit A won't appear in the interrupt status register.

    This was proven to be incorrect assumption, see discussion here [1].
    That misunderstanding causes unexpected behaviour of the GMAC, for
    example we were happy enough to just see bogus messages about link
    state changes.

    So from now on we'll be only checking bits that really may trigger an
    interrupt.

    [1] https://lkml.org/lkml/2016/11/3/413

    Signed-off-by: Alexey Brodkin
    Cc: Giuseppe Cavallaro
    Cc: Fabrice Gasnier
    Cc: Joachim Eastwood
    Cc: Phil Reid
    Cc: David Miller
    Cc: Alexandre Torgue
    Cc: Vineet Gupta
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Alexey Brodkin
     
  • [ Upstream commit a100ff3eef193d2d79daf98dcd97a54776ffeb78 ]

    Modifying TIR hash should change selected fields bitmask in addition to
    the function and key.

    Formerly, Only on ethool mlx5e_set_rxfh "ethtoo -X" we would not set this
    field resulting in zeroing of its value, which means no packet fields are
    used for RX RSS hash calculation thus causing all traffic to arrive in
    RQ[0].

    On driver load out of the box we don't have this issue, since the TIR
    hash is fully created from scratch.

    Tested:
    ethtool -X ethX hkey
    ethtool -X ethX hfunc
    ethtool -X ethX equal

    All cases are verified with TCP Multi-Stream traffic over IPv4 & IPv6.

    Fixes: bdfc028de1b3 ("net/mlx5e: Fix ethtool RX hash func configuration change")
    Signed-off-by: Gal Pressman
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Greg Kroah-Hartman

    Gal Pressman
     

15 Feb, 2017

31 commits

  • commit 647bf3d8a8e5777319da92af672289b2a6c4dc66 upstream.

    Update the range check to avoid integer-overflow in edge case.
    Resolves CVE 2016-8636.

    Signed-off-by: Eyal Itkin
    Signed-off-by: Dan Carpenter
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Eyal Itkin
     
  • commit 628f07d33c1f2e7bf31e0a4a988bb07914bd5e73 upstream.

    Update the response's resid field when larger than MTU, instead of only
    updating the local resid variable.

    Fixes: 8700e3e7c485 ("Soft RoCE driver")
    Signed-off-by: Eyal Itkin
    Signed-off-by: Dan Carpenter
    Reviewed-by: Leon Romanovsky
    Signed-off-by: Doug Ledford
    Signed-off-by: Greg Kroah-Hartman

    Eyal Itkin
     
  • commit 74470954857c264168d2b5a113904cf0cfd27d18 upstream.

    rx_refill_timer should be deleted as soon as we disconnect from the
    backend since otherwise it is possible for the timer to go off before
    we get to xennet_destroy_queues(). If this happens we may dereference
    queue->rx.sring which is set to NULL in xennet_disconnect_backend().

    Signed-off-by: Boris Ostrovsky
    Reviewed-by: Juergen Gross
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Boris Ostrovsky
     
  • commit 2780f3c8f0233de90b6b47a23fc422b7780c5436 upstream.

    Avoid that issuing a LIP as follows:

    find /sys -name 'issue_lip'|while read f; do echo 1 > $f; done

    triggers the following:

    BUG: unable to handle kernel NULL pointer dereference at (null)
    Call Trace:
    qla2x00_abort_all_cmds+0xed/0x140 [qla2xxx]
    qla2x00_abort_isp_cleanup+0x1e3/0x280 [qla2xxx]
    qla2x00_abort_isp+0xef/0x690 [qla2xxx]
    qla2x00_do_dpc+0x36c/0x880 [qla2xxx]
    kthread+0x10c/0x140

    [mkp: consolidated Mauricio's and Bart's fixes]

    Signed-off-by: Mauricio Faria de Oliveira
    Reported-by: Bart Van Assche
    Fixes: 1535aa75a3d8 ("qla2xxx: fix invalid DMA access after command aborts in PCI device remove")
    Cc: Himanshu Madhani
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Mauricio Faria de Oliveira
     
  • commit ffdadd68af5a397b8a52289ab39d62e1acb39e63 upstream.

    MPI2 controllers sometimes got lost (i.e. disappear from
    /sys/bus/pci/devices) if ASMP is enabled.

    Signed-off-by: Slava Kardakov
    Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=60644
    Acked-by: Sreekanth Reddy
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    ojab
     
  • commit 8af8e1c22f9994bb1849c01d66c24fe23f9bc9a0 upstream.

    commit 78cbccd3bd68 ("aacraid: Fix for KDUMP driver hang")

    caused a problem on older controllers which do not support MSI-x (namely
    ASR3405,ASR3805). This patch conditionalizes the previous patch to
    controllers which support MSI-x

    Fixes: 78cbccd3bd68 ("aacraid: Fix for KDUMP driver hang")
    Reported-by: Arkadiusz Miskiewicz
    Signed-off-by: Dave Carroll
    Reviewed-by: Raghava Aditya Renukunta
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Dave Carroll
     
  • commit 2dfa6688aafdc3f74efeb1cf05fb871465d67f79 upstream.

    Dan Carpenter kindly reported:

    The patch d27a7cb91960: "zfcp: trace on request for open and close of
    WKA port" from Aug 10, 2016, leads to the following static checker
    warning:

    drivers/s390/scsi/zfcp_fsf.c:1615 zfcp_fsf_open_wka_port()
    warn: 'req' was already freed.

    drivers/s390/scsi/zfcp_fsf.c
    1609 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
    1610 retval = zfcp_fsf_req_send(req);
    1611 if (retval)
    1612 zfcp_fsf_req_free(req);
    ^^^
    Freed.

    1613 out:
    1614 spin_unlock_irq(&qdio->req_q_lock);
    1615 if (req && !IS_ERR(req))
    1616 zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req->req_id);
    ^^^^^^^^^^^
    Use after free.

    1617 return retval;
    1618 }

    Same thing for zfcp_fsf_close_wka_port() as well.

    Rather than relying on req being NULL (or ERR_PTR) for all cases where
    we don't want to trace or should not trace,
    simply check retval which is unconditionally initialized with -EIO != 0
    and it can only become 0 on successful retval = zfcp_fsf_req_send(req).
    With that we can also remove the then again unnecessary unconditional
    initialization of req which was introduced with that earlier commit.

    Reported-by: Dan Carpenter
    Suggested-by: Benjamin Block
    Signed-off-by: Steffen Maier
    Fixes: d27a7cb91960 ("zfcp: trace on request for open and close of WKA port")
    Reviewed-by: Benjamin Block
    Reviewed-by: Jens Remus
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Steffen Maier
     
  • commit 433e19cf33d34bb6751c874a9c00980552fe508c upstream.

    Commit a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in
    hv_need_to_signal_on_read()")
    added the proper mb(), but removed the test "prev_write_sz < pending_sz"
    when making the signal decision.

    As a result, the guest can signal the host unnecessarily,
    and then the host can throttle the guest because the host
    thinks the guest is buggy or malicious; finally the user
    running stress test can perceive intermittent freeze of
    the guest.

    This patch brings back the test, and properly handles the
    in-place consumption APIs used by NetVSC (see get_next_pkt_raw(),
    put_pkt_raw() and commit_rd_index()).

    Fixes: a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in
    hv_need_to_signal_on_read()")

    Signed-off-by: Dexuan Cui
    Reported-by: Rolf Neugebauer
    Tested-by: Rolf Neugebauer
    Cc: "K. Y. Srinivasan"
    Cc: Haiyang Zhang
    Cc: Stephen Hemminger
    Signed-off-by: K. Y. Srinivasan
    Cc: Rolf Neugebauer
    Signed-off-by: Greg Kroah-Hartman

    Dexuan Cui
     
  • commit 3372592a140db69fd63837e81f048ab4abf8111e upstream.

    Signal the host when we determine the host is to be signaled -
    on th read path. The currrent code determines the need to signal in the
    ringbuffer code and actually issues the signal elsewhere. This can result
    in the host viewing this interrupt as spurious since the host may also
    poll the channel. Make the necessary adjustments.

    Signed-off-by: K. Y. Srinivasan
    Cc: Rolf Neugebauer
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     
  • commit 1f6ee4e7d83586c8b10bd4f2f4346353d04ce884 upstream.

    Signal the host when we determine the host is to be signaled.
    The currrent code determines the need to signal in the ringbuffer
    code and actually issues the signal elsewhere. This can result
    in the host viewing this interrupt as spurious since the host may also
    poll the channel. Make the necessary adjustments.

    Signed-off-by: K. Y. Srinivasan
    Cc: Rolf Neugebauer
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     
  • commit 74198eb4a42c4a3c4fbef08fa01a291a282f7c2e upstream.

    One of the factors that can result in the host concluding that a given
    guest in mounting a DOS attack is if the guest generates interrupts
    to the host when the host is not expecting it. If these "spurious"
    interrupts reach a certain rate, the host can throttle the guest to
    minimize the impact. The host computation of the "expected number
    of interrupts" is strictly based on the ring transitions. Until
    the host logic is fixed, base the guest logic to interrupt solely
    on the ring state.

    Signed-off-by: K. Y. Srinivasan
    Cc: Rolf Neugebauer
    Signed-off-by: Greg Kroah-Hartman

    K. Y. Srinivasan
     
  • commit 1d3398facd08a7fd4202f269317a95668eb880b9 upstream.

    We don't need to modify our TIRs unless the user requested a change in
    the hash function/key, for example when changing indirection only.

    Tested:
    # Modify TIRs hash is needed
    ethtool -X ethX hkey
    ethtool -X ethX hfunc

    # Modify TIRs hash is not needed
    ethtool -X ethX equal

    All cases are verified with TCP Multi-Stream traffic over IPv4 & IPv6.

    Fixes: bdfc028de1b3 ("net/mlx5e: Fix ethtool RX hash func configuration change")
    Signed-off-by: Gal Pressman
    Signed-off-by: Saeed Mahameed
    Signed-off-by: Greg Kroah-Hartman

    Gal Pressman
     
  • commit 6e7eb1783be7f19eb071c96ddda0bbf22279ff46 upstream.

    We're using non-canonical addresses in drm_mm, and we're making sure that
    userspace is using canonical addressing - both in case of softpin
    (verifying incoming offset) and when relocating (converting to canonical
    when updating offset returned to userspace).
    Unfortunately when considering the need for relocations, we're comparing
    offset from userspace (in canonical form) with drm_mm node (in
    non-canonical form), and as a result, we end up always relocating if our
    offsets are in the "problematic" range.
    Let's always convert the offsets to avoid the performance impact of
    relocations.

    Fixes: a5f0edf63bdf ("drm/i915: Avoid writing relocs with addresses in non-canonical form")
    Cc: Chris Wilson
    Cc: Michel Thierry
    Reported-by: Michał Pyrzowski
    Signed-off-by: Michał Winiarski
    Link: http://patchwork.freedesktop.org/patch/msgid/20170207195559.18798-1-michal.winiarski@intel.com
    Reviewed-by: Chris Wilson
    Signed-off-by: Chris Wilson
    (cherry picked from commit 038c95a313e4ca954ee5ab8a0c7559a646b0f462)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Michał Winiarski
     
  • commit 9b2792c3da1e80f2d460167d319302a24c9ca2b7 upstream.

    This patch addresses a long standing bug where the commit phase
    of COMPARE_AND_WRITE would result in a se_cmd->cmd_kref reference
    leak if se_cmd->scsi_status returned non SAM_STAT_GOOD.

    This would manifest first as a lost SCSI response, and eventual
    hung task during fabric driver logout or re-login, as existing
    shutdown logic waited for the COMPARE_AND_WRITE se_cmd->cmd_kref
    to reach zero.

    To address this bug, compare_and_write_post() has been changed
    to drop the incorrect !cmd->scsi_status conditional that was
    preventing *post_ret = 1 for being set during non SAM_STAT_GOOD
    status.

    This patch has been tested with SAM_STAT_CHECK_CONDITION status
    from normal target_complete_cmd() callback path, as well as the
    incoming __target_execute_cmd() submission failure path when
    se_cmd->execute_cmd() returns non zero status.

    Reported-by: Donald White
    Cc: Donald White
    Tested-by: Gary Guo
    Cc: Gary Guo
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Greg Kroah-Hartman

    Nicholas Bellinger
     
  • commit 01d4d673558985d9a118e1e05026633c3e2ade9b upstream.

    This patch addresses a long-standing bug with multi-session
    (eg: iscsi-target + iser-target) se_node_acl dynamic free
    withini transport_deregister_session().

    This bug is caused when a storage endpoint is configured with
    demo-mode (generate_node_acls = 1 + cache_dynamic_acls = 1)
    initiators, and initiator login creates a new dynamic node acl
    and attaches two sessions to it.

    After that, demo-mode for the storage instance is disabled via
    configfs (generate_node_acls = 0 + cache_dynamic_acls = 0) and
    the existing dynamic acl is never converted to an explicit ACL.

    The end result is dynamic acl resources are released twice when
    the sessions are shutdown in transport_deregister_session().

    If the storage instance is not changed to disable demo-mode,
    or the dynamic acl is converted to an explict ACL, or there
    is only a single session associated with the dynamic ACL,
    the bug is not triggered.

    To address this big, move the release of dynamic se_node_acl
    memory into target_complete_nacl() so it's only freed once
    when se_node_acl->acl_kref reaches zero.

    (Drop unnecessary list_del_init usage - HCH)

    Reported-by: Rob Millner
    Tested-by: Rob Millner
    Cc: Rob Millner
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Greg Kroah-Hartman

    Nicholas Bellinger
     
  • commit c54eeffbe9338fa982dc853d816fda9202a13b5a upstream.

    This patch fixes a bug where incoming task management requests
    can be explicitly aborted during an active LUN_RESET, but who's
    struct work_struct are canceled in-flight before execution.

    This occurs when core_tmr_drain_tmr_list() invokes cancel_work_sync()
    for the incoming se_tmr_req->task_cmd->work, resulting in cmd->work
    for target_tmr_work() never getting invoked and the aborted TMR
    waiting indefinately within transport_wait_for_tasks().

    To address this case, perform a CMD_T_ABORTED check early in
    transport_generic_handle_tmr(), and invoke the normal path via
    transport_cmd_check_stop_to_fabric() to complete any TMR kthreads
    blocked waiting for CMD_T_STOP in transport_wait_for_tasks().

    Also, move the TRANSPORT_ISTATE_PROCESSING assignment earlier
    into transport_generic_handle_tmr() so the existing check in
    core_tmr_drain_tmr_list() avoids attempting abort the incoming
    se_tmr_req->task_cmd->work if it has already been queued into
    se_device->tmr_wq.

    Reported-by: Rob Millner
    Tested-by: Rob Millner
    Cc: Rob Millner
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Greg Kroah-Hartman

    Nicholas Bellinger
     
  • commit 0583c261e6325f392c1f7a1b9112e31298e1a4bd upstream.

    This patch adds the missing target_complete_cmd() SCSI status
    parameter change in target_xcopy_do_work(), that was originally
    missing in commit 926317de33.

    It correctly propigates up the correct SCSI status during
    EXTENDED_COPY exception cases, instead of always using the
    hardcoded SAM_STAT_CHECK_CONDITION from original code.

    This is required for ESX host environments that expect to
    hit SAM_STAT_RESERVATION_CONFLICT for certain scenarios,
    and SAM_STAT_CHECK_CONDITION results in non-retriable
    status for these cases.

    Reported-by: Nixon Vincent
    Tested-by: Nixon Vincent
    Cc: Nixon Vincent
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Greg Kroah-Hartman

    Nicholas Bellinger
     
  • commit 391e2a6de9781e4906dd7e0b1cc097050bf43e11 upstream.

    After the v4.2+ RCU conversion to se_node_acl->lun_entry_hlist,
    a BUG_ON() was added in core_enable_device_list_for_node() to
    detect when the located orig->se_lun_acl contains an existing
    se_lun_acl pointer reference.

    However, this scenario can happen when a dynamically generated
    NodeACL is being converted to an explicit NodeACL, when the
    explicit NodeACL contains a different LUN mapping than the
    default provided by the WWN endpoint.

    So instead of triggering BUG_ON(), go ahead and fail instead
    following the original pre RCU conversion logic.

    Reported-by: Benjamin ESTRABAUD
    Cc: Benjamin ESTRABAUD
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Greg Kroah-Hartman

    Nicholas Bellinger
     
  • commit 92c715fca907686f5298220ece53423e38ba3aed upstream.

    drm_atomic_helper_page_flip and drm_atomic_ioctl set their own events
    in crtc_state->event. But when it's set the event is freed in 2 places.

    Solve this by only freeing the event in the atomic ioctl when it
    allocated its own event.

    This has been broken twice. The first time when the code was introduced,
    but only in the corner case when an event is allocated, but more crtc's
    were included by atomic check and then failing. This can mostly
    happen when you do an atomic modeset in i915 and the display clock is
    changed, which forces all crtc's to be included to the state.

    This has been broken worse by adding in-fences support, which caused
    the double free to be done unconditionally.

    [IGT] kms_rotation_crc: starting subtest primary-rotation-180
    =============================================================================
    BUG kmalloc-128 (Tainted: G U ): Object already free
    -----------------------------------------------------------------------------

    Disabling lock debugging due to kernel taint
    INFO: Allocated in drm_atomic_helper_setup_commit+0x285/0x2f0 [drm_kms_helper] age=0 cpu=3 pid=1529
    ___slab_alloc+0x308/0x3b0
    __slab_alloc+0xd/0x20
    kmem_cache_alloc_trace+0x92/0x1c0
    drm_atomic_helper_setup_commit+0x285/0x2f0 [drm_kms_helper]
    intel_atomic_commit+0x35/0x4f0 [i915]
    drm_atomic_commit+0x46/0x50 [drm]
    drm_mode_atomic_ioctl+0x7d4/0xab0 [drm]
    drm_ioctl+0x2b3/0x490 [drm]
    do_vfs_ioctl+0x69c/0x700
    SyS_ioctl+0x4e/0x80
    entry_SYSCALL_64_fastpath+0x13/0x94
    INFO: Freed in drm_event_cancel_free+0xa3/0xb0 [drm] age=0 cpu=3 pid=1529
    __slab_free+0x48/0x2e0
    kfree+0x159/0x1a0
    drm_event_cancel_free+0xa3/0xb0 [drm]
    drm_mode_atomic_ioctl+0x86d/0xab0 [drm]
    drm_ioctl+0x2b3/0x490 [drm]
    do_vfs_ioctl+0x69c/0x700
    SyS_ioctl+0x4e/0x80
    entry_SYSCALL_64_fastpath+0x13/0x94
    INFO: Slab 0xffffde1f0997b080 objects=17 used=2 fp=0xffff92fb65ec2578 flags=0x200000000008101
    INFO: Object 0xffff92fb65ec2578 @offset=1400 fp=0xffff92fb65ec2ae8

    Redzone ffff92fb65ec2570: bb bb bb bb bb bb bb bb ........
    Object ffff92fb65ec2578: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
    Object ffff92fb65ec2588: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
    Object ffff92fb65ec2598: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
    Object ffff92fb65ec25a8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
    Object ffff92fb65ec25b8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
    Object ffff92fb65ec25c8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
    Object ffff92fb65ec25d8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
    Object ffff92fb65ec25e8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 kkkkkkkkkkkkkkk.
    Redzone ffff92fb65ec25f8: bb bb bb bb bb bb bb bb ........
    Padding ffff92fb65ec2738: 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZ
    CPU: 3 PID: 180 Comm: kworker/3:2 Tainted: G BU 4.10.0-rc6-patser+ #5039
    Hardware name: /NUC5PPYB, BIOS PYBSWCEL.86A.0031.2015.0601.1712 06/01/2015
    Workqueue: events intel_atomic_helper_free_state [i915]
    Call Trace:
    dump_stack+0x4d/0x6d
    print_trailer+0x20c/0x220
    free_debug_processing+0x1c6/0x330
    ? drm_atomic_state_default_clear+0xf7/0x1c0 [drm]
    __slab_free+0x48/0x2e0
    ? drm_atomic_state_default_clear+0xf7/0x1c0 [drm]
    kfree+0x159/0x1a0
    drm_atomic_state_default_clear+0xf7/0x1c0 [drm]
    ? drm_atomic_state_clear+0x30/0x30 [drm]
    intel_atomic_state_clear+0xd/0x20 [i915]
    drm_atomic_state_clear+0x1a/0x30 [drm]
    __drm_atomic_state_free+0x13/0x60 [drm]
    intel_atomic_helper_free_state+0x5d/0x70 [i915]
    process_one_work+0x260/0x4a0
    worker_thread+0x2d1/0x4f0
    kthread+0x127/0x130
    ? process_one_work+0x4a0/0x4a0
    ? kthread_stop+0x120/0x120
    ret_from_fork+0x29/0x40
    FIX kmalloc-128: Object at 0xffff92fb65ec2578 not freed

    Fixes: 3b24f7d67581 ("drm/atomic: Add struct drm_crtc_commit to track async updates")
    Fixes: 9626014258a5 ("drm/fence: add in-fences support")
    Cc: Daniel Vetter
    Signed-off-by: Maarten Lankhorst
    Reviewed-by: Daniel Vetter
    Reviewed-by: Gustavo Padovan
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1485854725-27640-1-git-send-email-maarten.lankhorst@linux.intel.com
    CC: koos vriezen
    Signed-off-by: Greg Kroah-Hartman

    Maarten Lankhorst
     
  • commit 789ea12500e5ce3911d0a6a822277c3133451927 upstream.

    Add the missing INTEL_OUTPUT_DP_MST case in bxt_get_dpll()
    to correctly initialize the crtc_state and port plls when
    link training a DP MST monitor on BXT/APL devices.

    Fixes: a277ca7dc01d ("drm/i915: Split bxt_ddi_pll_select()")
    Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=99572
    Reviewed-by: Cooper Chiou
    Reviewed-by: Gary C Wang
    Reviewed-by: Ciobanu, Nathan D
    Reviewed-by: Herbert, Marc
    Reviewed-by: Bride, Jim
    Reviewed-by: Navare, Manasi D
    Cc: Jani Nikula
    Signed-off-by: Lee, Shawn C
    Signed-off-by: Jani Nikula
    Link: http://patchwork.freedesktop.org/patch/msgid/1486096329-6255-1-git-send-email-shawn.c.lee@intel.com
    (cherry picked from commit 0aab2c721d81590012a5021a516f00666646741f)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Lee, Shawn C
     
  • commit 5351fbb1bf1413f6024892093528280769ca852f upstream.

    page_flip_completed() dereferences 'work' variable after executing
    queue_work(). This is not safe as the 'work' item might be already freed
    by queued work:

    BUG: KASAN: use-after-free in page_flip_completed+0x3ff/0x490 at addr ffff8803dc010f90
    Call Trace:
    __asan_report_load8_noabort+0x59/0x80
    page_flip_completed+0x3ff/0x490
    intel_finish_page_flip_mmio+0xe3/0x130
    intel_pipe_handle_vblank+0x2d/0x40
    gen8_irq_handler+0x4a7/0xed0
    __handle_irq_event_percpu+0xf6/0x860
    handle_irq_event_percpu+0x6b/0x160
    handle_irq_event+0xc7/0x1b0
    handle_edge_irq+0x1f4/0xa50
    handle_irq+0x41/0x70
    do_IRQ+0x9a/0x200
    common_interrupt+0x89/0x89

    Freed:
    kfree+0x113/0x4d0
    intel_unpin_work_fn+0x29a/0x3b0
    process_one_work+0x79e/0x1b70
    worker_thread+0x611/0x1460
    kthread+0x241/0x3a0
    ret_from_fork+0x27/0x40

    Move queue_work() after trace_i915_flip_complete() to fix this.

    Fixes: e5510fac98a7 ("drm/i915: add tracepoints for flip requests & completions")
    Signed-off-by: Andrey Ryabinin
    Reviewed-by: Chris Wilson
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/20170126143211.24013-1-aryabinin@virtuozzo.com
    (cherry picked from commit 05c41f926fcc7ef838c80a6a99d84f67b4e0b824)
    Signed-off-by: Jani Nikula
    Signed-off-by: Greg Kroah-Hartman

    Andrey Ryabinin
     
  • commit b3f2d07f4649adcf6905953a10d217b5683e4077 upstream.

    The use of ACCESS_ONCE() looks like a micro-optimization to force gcc to use
    an indexed load for the register address, but it has an absolutely detrimental
    effect on builds with gcc-5 and CONFIG_KASAN=y, leading to a very likely
    kernel stack overflow aside from very complex object code:

    hisilicon/hns/hns_dsaf_gmac.c: In function 'hns_gmac_update_stats':
    hisilicon/hns/hns_dsaf_gmac.c:419:1: error: the frame size of 2912 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_ppe.c: In function 'hns_ppe_reset_common':
    hisilicon/hns/hns_dsaf_ppe.c:390:1: error: the frame size of 1184 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_ppe.c: In function 'hns_ppe_get_regs':
    hisilicon/hns/hns_dsaf_ppe.c:621:1: error: the frame size of 3632 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_rcb.c: In function 'hns_rcb_get_common_regs':
    hisilicon/hns/hns_dsaf_rcb.c:970:1: error: the frame size of 2784 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_gmac.c: In function 'hns_gmac_get_regs':
    hisilicon/hns/hns_dsaf_gmac.c:641:1: error: the frame size of 5728 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_rcb.c: In function 'hns_rcb_get_ring_regs':
    hisilicon/hns/hns_dsaf_rcb.c:1021:1: error: the frame size of 2208 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_comm_init':
    hisilicon/hns/hns_dsaf_main.c:1209:1: error: the frame size of 1904 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_xgmac.c: In function 'hns_xgmac_get_regs':
    hisilicon/hns/hns_dsaf_xgmac.c:748:1: error: the frame size of 4704 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_update_stats':
    hisilicon/hns/hns_dsaf_main.c:2420:1: error: the frame size of 1088 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
    hisilicon/hns/hns_dsaf_main.c: In function 'hns_dsaf_get_regs':
    hisilicon/hns/hns_dsaf_main.c:2753:1: error: the frame size of 10768 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

    This does not seem to happen any more with gcc-7, but removing the ACCESS_ONCE
    seems safe anyway and it avoids a serious issue for some people. I have verified
    that with gcc-5.3.1, the object code we get is better in the new version
    both with and without CONFIG_KASAN, as we no longer allocate a 1344 byte
    stack frame for hns_dsaf_get_regs() but otherwise have practically identical
    object code.

    With gcc-7.0.0, removing ACCESS_ONCE has no effect, the object code is already
    good either way.

    This patch is probably not urgent to get into 4.11 as only KASAN=y builds
    with certain compilers are affected, but I still think it makes sense to
    backport into older kernels.

    Fixes: 511e6bc ("net: add Hisilicon Network Subsystem DSAF support")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit b22bc27868e8c11fe3f00937a341b44f80b50364 upstream.

    This patch adds internal LIO sgl limit since the driver already
    sets a max transfer limit on transport layer of 1MB to the client.

    Tested-by: Steven Royer
    Signed-off-by: Bryant G. Ly
    Signed-off-by: Nicholas Bellinger
    Signed-off-by: Greg Kroah-Hartman

    Bryant G. Ly
     
  • commit 52f5631a4c056ad01682393be56d2be237e81610 upstream.

    In commit cf4747d7535a ("rtlwifi: Fix regression caused by commit
    d86e64768859, an error in the edit results in the wrong firmware
    being loaded for some models of the RTL8188/8192CE. In this condition,
    the connection suffered from high ping latency, slow transfer rates,
    and required higher signal strengths to work at all

    See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853073,
    https://bugzilla.opensuse.org/show_bug.cgi?id=1017471, and
    https://github.com/lwfinger/rtlwifi_new/issues/203 for descriptions
    of the problems. This patch fixes all of those problems.

    Fixes: cf4747d7535a ("rtlwifi: Fix regression caused by commit d86e64768859")
    Signed-off-by: Jurij Smakov
    Signed-off-by: Larry Finger
    Signed-off-by: Kalle Valo
    Signed-off-by: Greg Kroah-Hartman

    Jurij Smakov
     
  • commit 601bbbe0517303c9f8eb3d75e11d64efed1293c9 upstream.

    If user tries to initialize uinput device mixing old and new style
    initialization (i.e. using old UI_SET_ABSBIT instead of UI_ABS_SETUP,
    we forget to allocate input->absinfo and will crash when trying to send
    absolute events:

    ioctl(ui, UI_DEV_SETUP, &us);
    ioctl(ui, UI_SET_PHYS, "Test");

    ioctl(ui, UI_SET_EVBIT, EV_ABS);
    ioctl(ui, UI_SET_ABSBIT, ABS_X);
    ioctl(ui, UI_SET_ABSBIT, ABS_Y);
    ioctl(ui, UI_DEV_CREATE, 0);

    Reported-by: Rodrigo Rivas Costa
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=191811
    Fixes: fbae10db0940 ("Input: uinput - rework ABS validation")
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • commit e5da5c5667381d2772374ee6a2967b3576c9483d upstream.

    Eliminate a double-add by creating a new list to manage
    command descriptors when created; move the descriptor to
    the pending list when the command is submitted.

    Signed-off-by: Gary R Hook
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Gary R Hook
     
  • commit 500c0106e638e08c2c661c305ed57d6b67e10908 upstream.

    An I/O page fault occurs when the IOMMU is enabled on a
    system that supports the v5 CCP. DMA operations use a
    Request ID value that does not match what is expected by
    the IOMMU, resulting in the I/O page fault. Setting the
    Request ID value to 0 corrects this issue.

    Signed-off-by: Gary R Hook
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Gary R Hook
     
  • commit 685ce0626840e2673fe64ea8807684f7324fec5f upstream.

    Zero embedded ram in DH85x devices. This is not
    needed for newer generations as it is done by HW.

    Signed-off-by: Giovanni Cabiddu
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Giovanni Cabiddu
     
  • commit 3484ecbe0e9deb94afb0b9b6172d77e98eb72b94 upstream.

    Some accelerators of the c62x series have only two bars.
    This patch skips BAR0 if the accelerator does not have it.

    Signed-off-by: Giovanni Cabiddu
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Giovanni Cabiddu
     
  • commit f5f7bebc91ab378dea5aad5277c4d283e46472d9 upstream.

    Ensure dev is allocated for crypto uld context before using the device
    for crypto operations.

    Signed-off-by: Atul Gupta
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Harsh Jain
     
  • commit 4087a1fffe38106e10646606a27f10d40451862d upstream.

    Fixes a crash in dm_table_find_target() due to a NULL struct dm_table
    being passed from dm_old_request_fn() that races with DM device
    destruction.

    Reported-by: artem@flashgrid.io
    Signed-off-by: Mike Snitzer
    Signed-off-by: Greg Kroah-Hartman

    Mike Snitzer