Skip to content
  1. Apr 18, 2019
  2. Apr 17, 2019
    • Corey Minyard's avatar
      ipmi: fix sleep-in-atomic in free_user at cleanup SRCU user->release_barrier · 3b9a9072
      Corey Minyard authored
      free_user() could be called in atomic context.
      
      This patch pushed the free operation off into a workqueue.
      
      Example:
      
       BUG: sleeping function called from invalid context at kernel/workqueue.c:2856
       in_atomic(): 1, irqs_disabled(): 0, pid: 177, name: ksoftirqd/27
       CPU: 27 PID: 177 Comm: ksoftirqd/27 Not tainted 4.19.25-3 #1
       Hardware name: AIC 1S-HV26-08/MB-DPSB04-06, BIOS IVYBV060 10/21/2015
       Call Trace:
        dump_stack+0x5c/0x7b
        ___might_sleep+0xec/0x110
        __flush_work+0x48/0x1f0
        ? try_to_del_timer_sync+0x4d/0x80
        _cleanup_srcu_struct+0x104/0x140
        free_user+0x18/0x30 [ipmi_msghandler]
        ipmi_free_recv_msg+0x3a/0x50 [ipmi_msghandler]
        deliver_response+0xbd/0xd0 [ipmi_msghandler]
        deliver_local_response+0xe/0x30 [ipmi_msghandler]
        handle_one_recv_msg+0x163/0xc80 [ipmi_msghandler]
        ? dequeue_entity+0xa0/0x960
        handle_new_recv_msgs+0x15c/0x1f0 [ipmi_msghandler]
        tasklet_action_common.isra.22+0x103/0x120
        __do_softirq+0xf8/0x2d7
        run_ksoftirqd+0x26/0x50
        smpboot_thread_fn+0x11d/0x1e0
        kthread+0x103/0x140
        ? sort_range+0x20/0x20
        ? kthread_destroy_worker+0x40/0x40
        ret_from_fork+0x1f/0x40
      
      Fixes: 77f82696
      
       ("ipmi: fix use-after-free of user->release_barrier.rda")
      
      Reported-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      Cc: stable@vger.kernel.org # 5.0
      Cc: Yang Yingliang <yangyingliang@huawei.com>
      3b9a9072
    • Arnd Bergmann's avatar
      socket: fix compat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW · e6986423
      Arnd Bergmann authored
      It looks like the new socket options only work correctly
      for native execution, but in case of compat mode fall back
      to the old behavior as we ignore the 'old_timeval' flag.
      
      Rework so we treat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW the
      same way in compat and native 32-bit mode.
      
      Cc: Deepa Dinamani <deepa.kernel@gmail.com>
      Fixes: a9beb86a
      
       ("sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6986423
    • Eric Dumazet's avatar
      tcp: tcp_grow_window() needs to respect tcp_space() · 50ce163a
      Eric Dumazet authored
      
      
      For some reason, tcp_grow_window() correctly tests if enough room
      is present before attempting to increase tp->rcv_ssthresh,
      but does not prevent it to grow past tcp_space()
      
      This is causing hard to debug issues, like failing
      the (__tcp_select_window(sk) >= tp->rcv_wnd) test
      in __tcp_ack_snd_check(), causing ACK delays and possibly
      slow flows.
      
      Depending on tcp_rmem[2], MTU, skb->len/skb->truesize ratio,
      we can see the problem happening on "netperf -t TCP_RR -- -r 2000,2000"
      after about 60 round trips, when the active side no longer sends
      immediate acks.
      
      This bug predates git history.
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Acked-by: default avatarWei Wang <weiwan@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      50ce163a
    • David S. Miller's avatar
      Merge branch 'dpaa2-eth-Add-flow-steering-support-without-masking' · 17f780b3
      David S. Miller authored
      
      
      Ioana Ciocoi Radulescu says:
      
      ====================
      dpaa2-eth: Add flow steering support without masking
      
      On DPAA2 platforms that lack a TCAM (like LS1088A), masking of
      flow steering keys is not supported. Until now we didn't offer
      flow steering capabilities at all on these platforms.
      
      Introduce a limited support for flow steering, where we only
      allow ethtool rules that share a common key (i.e. have the same
      header fields). If a rule with a new composition key is wanted,
      the user must first manually delete all previous rules.
      
      First patch fixes a minor bug, the next two cleanup and prepare
      the code and the last one introduces the actual FS support.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      17f780b3
    • Ioana Ciocoi Radulescu's avatar
      dpaa2-eth: Add flow steering support without masking · 2d680237
      Ioana Ciocoi Radulescu authored
      
      
      On platforms that lack a TCAM (like LS1088A), masking of
      flow steering keys is not supported. Until now we didn't
      offer flow steering capabilities at all on these platforms,
      since our driver implementation configured a "comprehensive"
      FS key (containing all supported header fields), with masks
      used to ignore the fields not present in the rules provided
      by the user.
      
      We now allow ethtool rules that share a common key (i.e. have
      the same header fields). The FS key is now kept in the driver
      private data and initialized when the first rule is added to
      an empty table, rather than at probe time. If a rule with a new
      composition key is wanted, the user must first manually delete
      all previous rules.
      
      When building a FS table entry to pass to firmware, we still use
      the old building algorithm, which assumes an all-supported-fields
      key, and later collapse the fields which aren't actually needed.
      
      Masked rules are not supported; if provided, the mask value
      will be ignored. For firmware versions older than MC10.7.0
      (that only offer the legacy ABIs for configuring distribution
      keys) flow steering without masking support remains unavailable.
      
      Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d680237