1. 04 1月, 2018 5 次提交
  2. 03 1月, 2018 16 次提交
    • F
      uapi libc compat: add fallback for unsupported libcs · c0bace79
      Felix Janda 提交于
      libc-compat.h aims to prevent symbol collisions between uapi and libc
      headers for each supported libc. This requires continuous coordination
      between them.
      
      The goal of this commit is to improve the situation for libcs (such as
      musl) which are not yet supported and/or do not wish to be explicitly
      supported, while not affecting supported libcs. More precisely, with
      this commit, unsupported libcs can request the suppression of any
      specific uapi definition by defining the correspondings _UAPI_DEF_*
      macro as 0. This can fix symbol collisions for them, as long as the
      libc headers are included before the uapi headers. Inclusion in the
      other order is outside the scope of this commit.
      
      All infrastructure in order to enable this fallback for unsupported
      libcs is already in place, except that libc-compat.h unconditionally
      defines all _UAPI_DEF_* macros to 1 for all unsupported libcs so that
      any previous definitions are ignored. In order to fix this, this commit
      merely makes these definitions conditional.
      
      This commit together with the musl libc commit
      
      http://git.musl-libc.org/cgit/musl/commit/?id=04983f2272382af92eb8f8838964ff944fbb8258
      
      fixes for example the following compiler errors when <linux/in6.h> is
      included after musl's <netinet/in.h>:
      
      ./linux/in6.h:32:8: error: redefinition of 'struct in6_addr'
      ./linux/in6.h:49:8: error: redefinition of 'struct sockaddr_in6'
      ./linux/in6.h:59:8: error: redefinition of 'struct ipv6_mreq'
      
      The comments referencing glibc are still correct, but this file is not
      only used for glibc any more.
      Signed-off-by: NFelix Janda <felix.janda@posteo.de>
      Reviewed-by: NHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c0bace79
    • J
      tipc: fix problems with multipoint-to-point flow control · f9c935db
      Jon Maloy 提交于
      In commit 04d7b574 ("tipc: add multipoint-to-point flow control") we
      introduced a protocol for preventing buffer overflow when many group
      members try to simultaneously send messages to the same receiving member.
      
      Stress test of this mechanism has revealed a couple of related bugs:
      
      - When the receiving member receives an advertisement REMIT message from
        one of the senders, it will sometimes prematurely activate a pending
        member and send it the remitted advertisement, although the upper
        limit for active senders has been reached. This leads to accumulation
        of illegal advertisements, and eventually to messages being dropped
        because of receive buffer overflow.
      
      - When the receiving member leaves REMITTED state while a received
        message is being read, we miss to look at the pending queue, to
        activate the oldest pending peer. This leads to some pending senders
        being starved out, and never getting the opportunity to profit from
        the remitted advertisement.
      
      We fix the former in the function tipc_group_proto_rcv() by returning
      directly from the function once it becomes clear that the remitting
      peer cannot leave REMITTED state at that point.
      
      We fix the latter in the function tipc_group_update_rcv_win() by looking
      up and activate the longest pending peer when it becomes clear that the
      remitting peer now can leave REMITTED state.
      Signed-off-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9c935db
    • S
      ethtool: do not print warning for applications using legacy API · 71891e2d
      Stephen Hemminger 提交于
      In kernel log ths message appears on every boot:
       "warning: `NetworkChangeNo' uses legacy ethtool link settings API,
        link modes are only partially reported"
      
      When ethtool link settings API changed, it started complaining about
      usages of old API. Ironically, the original patch was from google but
      the application using the legacy API is chrome.
      
      Linux ABI is fixed as much as possible. The kernel must not break it
      and should not complain about applications using legacy API's.
      This patch just removes the warning since using legacy API's
      in Linux is perfectly acceptable.
      
      Fixes: 3f1ac7a7 ("net: ethtool: add new ETHTOOL_xLINKSETTINGS API")
      Signed-off-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NDavid Decotigny <decot@googlers.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71891e2d
    • S
      NET: usb: qmi_wwan: add support for YUGA CLM920-NC5 PID 0x9625 · bd30ffc4
      SZ Lin (林上智) 提交于
      This patch adds support for PID 0x9625 of YUGA CLM920-NC5.
      
      YUGA CLM920-NC5 needs to enable QMI_WWAN_QUIRK_DTR before QMI operation.
      
      qmicli -d /dev/cdc-wdm0 -p --dms-get-revision
      [/dev/cdc-wdm0] Device revision retrieved:
              Revision: 'CLM920_NC5-V1  1  [Oct 23 2016 19:00:00]'
      Signed-off-by: NSZ Lin (林上智) <sz.lin@moxa.com>
      Acked-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd30ffc4
    • B
      e1000e: Fix e1000_check_for_copper_link_ich8lan return value. · 4110e02e
      Benjamin Poirier 提交于
      e1000e_check_for_copper_link() and e1000_check_for_copper_link_ich8lan()
      are the two functions that may be assigned to mac.ops.check_for_link when
      phy.media_type == e1000_media_type_copper. Commit 19110cfb ("e1000e:
      Separate signaling for link check/link up") changed the meaning of the
      return value of check_for_link for copper media but only adjusted the first
      function. This patch adjusts the second function likewise.
      Reported-by: NChristian Hesse <list@eworm.de>
      Reported-by: NGabriel C <nix.or.die@gmail.com>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=198047
      Fixes: 19110cfb ("e1000e: Separate signaling for link check/link up")
      Signed-off-by: NBenjamin Poirier <bpoirier@suse.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Tested-by: NChristian Hesse <list@eworm.de>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4110e02e
    • T
      e1000: fix disabling already-disabled warning · 0b76aae7
      Tushar Dave 提交于
      This patch adds check so that driver does not disable already
      disabled device.
      
      [   44.637743] advantechwdt: Unexpected close, not stopping watchdog!
      [   44.997548] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input6
      [   45.013419] e1000 0000:00:03.0: disabling already-disabled device
      [   45.013447] ------------[ cut here ]------------
      [   45.014868] WARNING: CPU: 1 PID: 71 at drivers/pci/pci.c:1641 pci_disable_device+0xa1/0x105:
      						pci_disable_device at drivers/pci/pci.c:1640
      [   45.016171] CPU: 1 PID: 71 Comm: rcu_perf_shutdo Not tainted 4.14.0-01330-g3c073991 #1
      [   45.017197] task: ffff88011bee9e40 task.stack: ffffc90000860000
      [   45.017987] RIP: 0010:pci_disable_device+0xa1/0x105:
      						pci_disable_device at drivers/pci/pci.c:1640
      [   45.018603] RSP: 0000:ffffc90000863e30 EFLAGS: 00010286
      [   45.019282] RAX: 0000000000000035 RBX: ffff88013a230008 RCX: 0000000000000000
      [   45.020182] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000203
      [   45.021084] RBP: ffff88013a3f31e8 R08: 0000000000000001 R09: 0000000000000000
      [   45.021986] R10: ffffffff827ec29c R11: 0000000000000002 R12: 0000000000000001
      [   45.022946] R13: ffff88013a230008 R14: ffff880117802b20 R15: ffffc90000863e8f
      [   45.023842] FS:  0000000000000000(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000
      [   45.024863] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   45.025583] CR2: ffffc900006d4000 CR3: 000000000220f000 CR4: 00000000000006a0
      [   45.026478] Call Trace:
      [   45.026811]  __e1000_shutdown+0x1d4/0x1e2:
      						__e1000_shutdown at drivers/net/ethernet/intel/e1000/e1000_main.c:5162
      [   45.027344]  ? rcu_perf_cleanup+0x2a1/0x2a1:
      						rcu_perf_shutdown at kernel/rcu/rcuperf.c:627
      [   45.027883]  e1000_shutdown+0x14/0x3a:
      						e1000_shutdown at drivers/net/ethernet/intel/e1000/e1000_main.c:5235
      [   45.028351]  device_shutdown+0x110/0x1aa:
      						device_shutdown at drivers/base/core.c:2807
      [   45.028858]  kernel_power_off+0x31/0x64:
      						kernel_power_off at kernel/reboot.c:260
      [   45.029343]  rcu_perf_shutdown+0x9b/0xa7:
      						rcu_perf_shutdown at kernel/rcu/rcuperf.c:637
      [   45.029852]  ? __wake_up_common_lock+0xa2/0xa2:
      						autoremove_wake_function at kernel/sched/wait.c:376
      [   45.030414]  kthread+0x126/0x12e:
      						kthread at kernel/kthread.c:233
      [   45.030834]  ? __kthread_bind_mask+0x8e/0x8e:
      						kthread at kernel/kthread.c:190
      [   45.031399]  ? ret_from_fork+0x1f/0x30:
      						ret_from_fork at arch/x86/entry/entry_64.S:443
      [   45.031883]  ? kernel_init+0xa/0xf5:
      						kernel_init at init/main.c:997
      [   45.032325]  ret_from_fork+0x1f/0x30:
      						ret_from_fork at arch/x86/entry/entry_64.S:443
      [   45.032777] Code: 00 48 85 ed 75 07 48 8b ab a8 00 00 00 48 8d bb 98 00 00 00 e8 aa d1 11 00 48 89 ea 48 89 c6 48 c7 c7 d8 e4 0b 82 e8 55 7d da ff <0f> ff b9 01 00 00 00 31 d2 be 01 00 00 00 48 c7 c7 f0 b1 61 82
      [   45.035222] ---[ end trace c257137b1b1976ef ]---
      [   45.037838] ACPI: Preparing to enter system sleep state S5
      Signed-off-by: NTushar Dave <tushar.n.dave@oracle.com>
      Tested-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      0b76aae7
    • R
      sfp: fix sfp-bus oops when removing socket/upstream · 0b2122e4
      Russell King 提交于
      When we remove a socket or upstream, and the other side isn't
      registered, we dereference a NULL pointer, causing a kernel oops.
      Fix this.
      
      Fixes: ce0aa27f ("sfp: add sfp-bus to bridge between network devices and sfp cages")
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0b2122e4
    • R
      phylink: ensure we report link down when LOS asserted · ac817f5a
      Russell King 提交于
      Although we disable the netdev carrier, we fail to report in the kernel
      log that the link went down.  Fix this.
      
      Fixes: 9525ae83 ("phylink: add phylink infrastructure")
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ac817f5a
    • G
      macvlan: Fix one possible double free · d02fd6e7
      Gao Feng 提交于
      Because the macvlan_uninit would free the macvlan port, so there is one
      double free case in macvlan_common_newlink. When the macvlan port is just
      created, then register_netdevice or netdev_upper_dev_link failed and they
      would invoke macvlan_uninit. Then it would reach the macvlan_port_destroy
      which triggers the double free.
      Signed-off-by: NGao Feng <gfree.wind@vip.163.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d02fd6e7
    • R
      net/sched: Fix update of lastuse in act modules implementing stats_update · 3bb23421
      Roi Dayan 提交于
      We need to update lastuse to to the most updated value between what
      is already set and the new value.
      If HW matching fails, i.e. because of an issue, the stats are not updated
      but it could be that software did match and updated lastuse.
      
      Fixes: 5712bf9c ("net/sched: act_mirred: Use passed lastuse argument")
      Fixes: 9fea47d9 ("net/sched: act_gact: Update statistics when offloaded to hardware")
      Signed-off-by: NRoi Dayan <roid@mellanox.com>
      Reviewed-by: NPaul Blakey <paulb@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3bb23421
    • I
      mlxsw: spectrum: Relax sanity checks during enslavement · 90045fc9
      Ido Schimmel 提交于
      Since commit 25cc72a3 ("mlxsw: spectrum: Forbid linking to devices that
      have uppers") the driver forbids enslavement to netdevs that already
      have uppers of their own, as this can result in various ordering
      problems.
      
      This requirement proved to be too strict for some users who need to be
      able to enslave ports to a bridge that already has uppers. In this case,
      we can allow the enslavement if the bridge is already known to us, as
      any configuration performed on top of the bridge was already reflected
      to the device.
      
      Fixes: 25cc72a3 ("mlxsw: spectrum: Forbid linking to devices that have uppers")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reported-by: NAlexander Petrovskiy <alexpe@mellanox.com>
      Tested-by: NAlexander Petrovskiy <alexpe@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90045fc9
    • I
      mlxsw: spectrum_router: Fix NULL pointer deref · 8764a826
      Ido Schimmel 提交于
      When we remove the neighbour associated with a nexthop we should always
      refuse to write the nexthop to the adjacency table. Regardless if it is
      already present in the table or not.
      
      Otherwise, we risk dereferencing the NULL pointer that was set instead
      of the neighbour.
      
      Fixes: a7ff87ac ("mlxsw: spectrum_router: Implement next-hop routing")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reported-by: NAlexander Petrovskiy <alexpe@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8764a826
    • X
      ip6_tunnel: allow ip6gre dev mtu to be set below 1280 · 2fa771be
      Xin Long 提交于
      Commit 582442d6 ("ipv6: Allow the MTU of ipip6 tunnel to be set
      below 1280") fixed a mtu setting issue. It works for ipip6 tunnel.
      
      But ip6gre dev updates the mtu also with ip6_tnl_change_mtu. Since
      the inner packet over ip6gre can be ipv4 and it's mtu should also
      be allowed to set below 1280, the same issue also exists on ip6gre.
      
      This patch is to fix it by simply changing to check if parms.proto
      is IPPROTO_IPV6 in ip6_tnl_change_mtu instead, to make ip6gre to
      go to 'else' branch.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2fa771be
    • X
      geneve: update skb dst pmtu on tx path · 52a589d5
      Xin Long 提交于
      Commit a93bf0ff ("vxlan: update skb dst pmtu on tx path") has fixed
      a performance issue caused by the change of lower dev's mtu for vxlan.
      
      The same thing needs to be done for geneve as well.
      
      Note that geneve cannot adjust it's mtu according to lower dev's mtu
      when creating it. The performance is very low later when netperfing
      over it without fixing the mtu manually. This patch could also avoid
      this issue.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      52a589d5
    • E
      ip6_tunnel: disable dst caching if tunnel is dual-stack · 23263ec8
      Eli Cooper 提交于
      When an ip6_tunnel is in mode 'any', where the transport layer
      protocol can be either 4 or 41, dst_cache must be disabled.
      
      This is because xfrm policies might apply to only one of the two
      protocols. Caching dst would cause xfrm policies for one protocol
      incorrectly used for the other.
      Signed-off-by: NEli Cooper <elicooper@gmx.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23263ec8
    • D
      Revert "net: core: dev_get_valid_name is now the same as dev_alloc_name_ns" · 55a5ec9b
      David S. Miller 提交于
      This reverts commit 87c320e5.
      
      Changing the error return code in some situations turns out to
      be harmful in practice.  In particular Michael Ellerman reports
      that DHCP fails on his powerpc machines, and this revert gets
      things working again.
      
      Johannes Berg agrees that this revert is the best course of
      action for now.
      
      Fixes: 029b6d14 ("Revert "net: core: maybe return -EEXIST in __dev_alloc_name"")
      Reported-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55a5ec9b
  3. 29 12月, 2017 10 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 2758b3e3
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) IPv6 gre tunnels end up with different default features enabled
          depending upon whether netlink or ioctls are used to bring them up.
          Fix from Alexey Kodanev.
      
       2) Fix read past end of user control message in RDS< from Avinash
          Repaka.
      
       3) Missing RCU barrier in mini qdisc code, from Cong Wang.
      
       4) Missing policy put when reusing per-cpu route entries, from Florian
          Westphal.
      
       5) Handle nested PCI errors properly in bnx2x driver, from Guilherme G.
          Piccoli.
      
       6) Run nested transport mode IPSEC packets via tasklet, from Herbert
          Xu.
      
       7) Fix handling poll() for stream sockets in tipc, from Parthasarathy
          Bhuvaragan.
      
       8) Fix two stack-out-of-bounds issues in IPSEC, from Steffen Klassert.
      
       9) Another zerocopy ubuf handling fix, from Willem de Bruijn.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
        strparser: Call sock_owned_by_user_nocheck
        sock: Add sock_owned_by_user_nocheck
        skbuff: in skb_copy_ubufs unclone before releasing zerocopy
        tipc: fix hanging poll() for stream sockets
        sctp: Replace use of sockets_allocated with specified macro.
        bnx2x: Improve reliability in case of nested PCI errors
        tg3: Enable PHY reset in MTU change path for 5720
        tg3: Add workaround to restrict 5762 MRRS to 2048
        tg3: Update copyright
        net: fec: unmap the xmit buffer that are not transferred by DMA
        tipc: fix tipc_mon_delete() oops in tipc_enable_bearer() error path
        tipc: error path leak fixes in tipc_enable_bearer()
        RDS: Check cmsg_len before dereferencing CMSG_DATA
        tcp: Avoid preprocessor directives in tracepoint macro args
        tipc: fix memory leak of group member when peer node is lost
        net: sched: fix possible null pointer deref in tcf_block_put
        tipc: base group replicast ack counter on number of actual receivers
        net_sched: fix a missing rcu barrier in mini_qdisc_pair_swap()
        net: phy: micrel: ksz9031: reconfigure autoneg after phy autoneg workaround
        ip6_gre: fix device features for ioctl setup
        ...
      2758b3e3
    • L
      Merge tag 'drm-fixes-for-v4.15-rc6' of git://people.freedesktop.org/~airlied/linux · fd84b751
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "nouveau and i915 regression fixes"
      
      * tag 'drm-fixes-for-v4.15-rc6' of git://people.freedesktop.org/~airlied/linux:
        drm/nouveau: fix race when adding delayed work items
        i915: Reject CCS modifiers for pipe C on Geminilake
        drm/i915/gvt: Fix pipe A enable as default for vgpu
      fd84b751
    • L
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · c0208a33
      Linus Torvalds 提交于
      Pull clk fix from Stephen Boyd:
       "One more fix for the runtime PM clk patches. We're calling a runtime
        PM API that may schedule from somewhere that we can't do that. We
        change to the async version of pm_runtime_put() to fix it"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: use atomic runtime pm api in clk_core_is_enabled
      c0208a33
    • L
      Merge tag 'led_fixes_for_4.15-rc6' of... · 4f2382f3
      Linus Torvalds 提交于
      Merge tag 'led_fixes_for_4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
      
      Pull LED fix from Jacek Anaszewski:
       "A single LED fix for brightness setting when delay_off is 0"
      
      * tag 'led_fixes_for_4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
        led: core: Fix brightness setting when setting delay_off=0
      4f2382f3
    • L
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · 19286e4a
      Linus Torvalds 提交于
      Pull rdma fixes from Jason Gunthorpe:
       "This is the next batch of for-rc patches from RDMA. It includes the
        fix for the ipoib regression I mentioned last time, and the result of
        a fairly major debugging effort to get iser working reliably on cxgb4
        hardware - it turns out the cxgb4 driver was not handling QP error
        flushing properly causing iser to fail.
      
         - cxgb4 fix for an iser testing failure as debugged by Steve and
           Sagi. The problem was a driver bug in the handling of shutting down
           a QP.
      
         - Various vmw_pvrdma fixes for bogus WARN_ON, missed resource free on
           error unwind and a use after free bug
      
         - Improper congestion counter values on mlx5 when link aggregation is
           enabled
      
         - ipoib lockdep regression introduced in this merge window
      
         - hfi1 regression supporting the device in a VM introduced in a
           recent patch
      
         - Typo that breaks future uAPI compatibility in the verbs core
      
         - More SELinux related oops fixing
      
         - Fix an oops during error unwind in mlx5"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        IB/mlx5: Fix mlx5_ib_alloc_mr error flow
        IB/core: Verify that QP is security enabled in create and destroy
        IB/uverbs: Fix command checking as part of ib_uverbs_ex_modify_qp()
        IB/mlx5: Serialize access to the VMA list
        IB/hfi: Only read capability registers if the capability exists
        IB/ipoib: Fix lockdep issue found on ipoib_ib_dev_heavy_flush
        IB/mlx5: Fix congestion counters in LAG mode
        RDMA/vmw_pvrdma: Avoid use after free due to QP/CQ/SRQ destroy
        RDMA/vmw_pvrdma: Use refcount_dec_and_test to avoid warning
        RDMA/vmw_pvrdma: Call ib_umem_release on destroy QP path
        iw_cxgb4: when flushing, complete all wrs in a chain
        iw_cxgb4: reflect the original WR opcode in drain cqes
        iw_cxgb4: Only validate the MSN for successful completions
      19286e4a
    • D
      Merge branch 'strparser-Fix-lockdep-issue' · d5902f6d
      David S. Miller 提交于
      Tom Herbert says:
      
      ====================
      strparser: Fix lockdep issue
      
      When sock_owned_by_user returns true in strparser. Fix is to add and
      call sock_owned_by_user_nocheck since the check for owned by user is
      not an error condition in this case.
      ====================
      
      Fixes: 43a0c675 ("strparser: Stream parser for messages")
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Reported-and-tested-by: <syzbot+c91c53af67f9ebe599a337d2e70950366153b295@syzkaller.appspotmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d5902f6d
    • T
      strparser: Call sock_owned_by_user_nocheck · d66fa9ec
      Tom Herbert 提交于
      strparser wants to check socket ownership without producing any
      warnings. As indicated by the comment in the code, it is permissible
      for owned_by_user to return true.
      
      Fixes: 43a0c675 ("strparser: Stream parser for messages")
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Reported-and-tested-by: <syzbot+c91c53af67f9ebe599a337d2e70950366153b295@syzkaller.appspotmail.com>
      Signed-off-by: NTom Herbert <tom@quantonium.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d66fa9ec
    • T
      sock: Add sock_owned_by_user_nocheck · 602f7a27
      Tom Herbert 提交于
      This allows checking socket lock ownership with producing lockdep
      warnings.
      Signed-off-by: NTom Herbert <tom@quantonium.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      602f7a27
    • W
      skbuff: in skb_copy_ubufs unclone before releasing zerocopy · f72c4ac6
      Willem de Bruijn 提交于
      skb_copy_ubufs must unclone before it is safe to modify its
      skb_shared_info with skb_zcopy_clear.
      
      Commit b90ddd56 ("skbuff: skb_copy_ubufs must release uarg even
      without user frags") ensures that all skbs release their zerocopy
      state, even those without frags.
      
      But I forgot an edge case where such an skb arrives that is cloned.
      
      The stack does not build such packets. Vhost/tun skbs have their
      frags orphaned before cloning. TCP skbs only attach zerocopy state
      when a frag is added.
      
      But if TCP packets can be trimmed or linearized, this might occur.
      Tracing the code I found no instance so far (e.g., skb_linearize
      ends up calling skb_zcopy_clear if !skb->data_len).
      
      Still, it is non-obvious that no path exists. And it is fragile to
      rely on this.
      
      Fixes: b90ddd56 ("skbuff: skb_copy_ubufs must release uarg even without user frags")
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f72c4ac6
    • P
      tipc: fix hanging poll() for stream sockets · 517d7c79
      Parthasarathy Bhuvaragan 提交于
      In commit 42b531de ("tipc: Fix missing connection request
      handling"), we replaced unconditional wakeup() with condtional
      wakeup for clients with flags POLLIN | POLLRDNORM | POLLRDBAND.
      
      This breaks the applications which do a connect followed by poll
      with POLLOUT flag. These applications are not woken when the
      connection is ESTABLISHED and hence sleep forever.
      
      In this commit, we fix it by including the POLLOUT event for
      sockets in TIPC_CONNECTING state.
      
      Fixes: 42b531de ("tipc: Fix missing connection request handling")
      Acked-by: NJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: NParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      517d7c79
  4. 28 12月, 2017 9 次提交
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 1528f6e2
      David S. Miller 提交于
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2017-12-28
      
      The following pull-request contains BPF updates for your *net* tree.
      
      The main changes are:
      
      1) Two small fixes for bpftool. Fix otherwise broken output if any of
         the system calls failed when listing maps in json format and instead
         of bailing out, skip maps or progs that disappeared between fetching
         next id and getting an fd for that id, both from Jakub.
      
      2) Small fix in BPF selftests to respect LLC passed from command line
         when testing for -mcpu=probe presence, from Quentin.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1528f6e2
    • N
      IB/mlx5: Fix mlx5_ib_alloc_mr error flow · 45e6ae7e
      Nitzan Carmi 提交于
      ibmr.device is being set only after ib_alloc_mr() is
      (successfully) complete. Therefore, in case mlx5_core_create_mkey()
      return with error, the error flow calls mlx5_free_priv_descs()
      which uses ibmr.device (which doesn't exist yet), causing
      a NULL dereference oops.
      
      To fix this, the IB device should be set in the mr struct earlier
      stage (e.g. prior to calling mlx5_core_create_mkey()).
      
      Fixes: 8a187ee5 ("IB/mlx5: Support the new memory registration API")
      Signed-off-by: NMax Gurtovoy <maxg@mellanox.com>
      Signed-off-by: NNitzan Carmi <nitzanc@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      45e6ae7e
    • M
      IB/core: Verify that QP is security enabled in create and destroy · 4a50881b
      Moni Shoua 提交于
      The XRC target QP create flow sets up qp_sec only if there is an IB link with
      LSM security enabled. However, several other related uAPI entry points blindly
      follow the qp_sec NULL pointer, resulting in a possible oops.
      
      Check for NULL before using qp_sec.
      
      Cc: <stable@vger.kernel.org> # v4.12
      Fixes: d291f1a6 ("IB/core: Enforce PKey security on QPs")
      Reviewed-by: NDaniel Jurgens <danielj@mellanox.com>
      Signed-off-by: NMoni Shoua <monis@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      4a50881b
    • M
      IB/uverbs: Fix command checking as part of ib_uverbs_ex_modify_qp() · 05d14e7b
      Moni Shoua 提交于
      If the input command length is larger than the kernel supports an error should
      be returned in case the unsupported bytes are not cleared, instead of the
      other way aroudn. This matches what all other callers of ib_is_udata_cleared
      do and will avoid user ABI problems in the future.
      
      Cc: <stable@vger.kernel.org> # v4.10
      Fixes: 189aba99 ("IB/uverbs: Extend modify_qp and support packet pacing")
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMoni Shoua <monis@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      05d14e7b
    • M
      IB/mlx5: Serialize access to the VMA list · ad9a3668
      Majd Dibbiny 提交于
      User-space applications can do mmap and munmap directly at
      any time.
      
      Since the VMA list is not protected with a mutex, concurrent
      accesses to the VMA list from the mmap and munmap can cause
      data corruption. Add a mutex around the list.
      
      Cc: <stable@vger.kernel.org> # v4.7
      Fixes: 7c2344c3 ("IB/mlx5: Implements disassociate_ucontext API")
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMajd Dibbiny <majd@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      ad9a3668
    • L
      Merge tag 'trace-v4.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 5f520fc3
      Linus Torvalds 提交于
      Pull tracing fixes from Steven Rostedt:
       "While doing tests on tracing over the network, I found that the
        packets were getting corrupted.
      
        In the process I found three bugs.
      
        One was the culprit, but the other two scared me. After deeper
        investigation, they were not as major as I thought they were, due to a
        signed compared to an unsigned that prevented a negative number from
        doing actual harm.
      
        The two bigger bugs:
      
         - Mask the ring buffer data page length. There are data flags at the
           high bits of the length field. These were not cleared via the
           length function, and the length could return a negative number.
           (Although the number returned was unsigned, but was assigned to a
           signed number) Luckily, this value was compared to PAGE_SIZE which
           is unsigned and kept it from entering the path that could have
           caused damage.
      
         - Check the page usage before reusing the ring buffer reader page.
           TCP increments the page ref when passing the page off to the
           network. The page is passed back to the ring buffer for use on
           free. But the page could still be in use by the TCP stack.
      
        Minor bugs:
      
         - Related to the first bug. No need to clear out the unused ring
           buffer data before sending to user space. It is now done by the
           ring buffer code itself.
      
         - Reset pointers after free on error path. There were some cases in
           the error path that pointers were freed but not set to NULL, and
           could have them freed again, having a pointer freed twice"
      
      * tag 'trace-v4.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Fix possible double free on failure of allocating trace buffer
        tracing: Fix crash when it fails to alloc ring buffer
        ring-buffer: Do no reuse reader page if still in use
        tracing: Remove extra zeroing out of the ring buffer page
        ring-buffer: Mask out the info bits when returning buffer page length
      5f520fc3
    • L
      Merge tag 'sound-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 9b957794
      Linus Torvalds 提交于
      Pull sound fixes from Takashi Iwai:
       "It seems that Santa overslept with a bunch of gifts; the majority of
        changes here are various device-specific ASoC fixes, most notably the
        revert of rcar IOMMU support and fsl_ssi AC97 fixes, but also lots of
        small fixes for codecs. Besides that, the usual HD-audio quirks and
        fixes are included, too"
      
      * tag 'sound-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (31 commits)
        ALSA: hda - Fix missing COEF init for ALC225/295/299
        ALSA: hda: Drop useless WARN_ON()
        ALSA: hda - change the location for one mic on a Lenovo machine
        ALSA: hda - fix headset mic detection issue on a Dell machine
        ALSA: hda - Add MIC_NO_PRESENCE fixup for 2 HP machines
        ASoC: rsnd: fixup ADG register mask
        ASoC: rt5514-spi: only enable wakeup when fully initialized
        ASoC: nau8825: fix issue that pop noise when start capture
        ASoC: rt5663: Fix the wrong result of the first jack detection
        ASoC: rsnd: ssi: fix race condition in rsnd_ssi_pointer_update
        ASoC: Intel: Change kern log level to avoid unwanted messages
        ASoC: atmel-classd: select correct Kconfig symbol
        ASoC: wm_adsp: Fix validation of firmware and coeff lengths
        ASoC: Intel: Skylake: Do not check dev_type for dmic link type
        ASoC: rockchip: disable clock on error
        ASoC: tlv320aic31xx: Fix GPIO1 register definition
        ASoC: codecs: msm8916-wcd: Fix supported formats
        ASoC: fsl_asrc: Fix typo in a field define
        ASoC: rsnd: ssiu: clear SSI_MODE for non TDM Extended modes
        ASoC: da7218: Correct IRQ level in DT binding example
        ...
      9b957794
    • M
      led: core: Fix brightness setting when setting delay_off=0 · 2b83ff96
      Matthieu CASTET 提交于
      With the current code, the following sequence won't work :
      echo timer > trigger
      
      echo 0 >  delay_off
      * at this point we call
      ** led_delay_off_store
      ** led_blink_set
      *** stop timer
      ** led_blink_setup
      ** led_set_software_blink
      *** if !delay_on, led off
      *** if !delay_off, set led_set_brightness_nosleep <--- LED_BLINK_SW is set but timer is stop
      *** otherwise start timer/set LED_BLINK_SW flag
      
      echo xxx > brightness
      * led_set_brightness
      ** if LED_BLINK_SW
      *** if brightness=0, led off
      *** else apply brightness if next timer <--- timer is stop, and will never apply new setting
      ** otherwise set led_set_brightness_nosleep
      
      To fix that, when we delete the timer, we should clear LED_BLINK_SW.
      
      Cc: linux-leds@vger.kernel.org
      Signed-off-by: NMatthieu CASTET <matthieu.castet@parrot.com>
      Signed-off-by: NJacek Anaszewski <jacek.anaszewski@gmail.com>
      2b83ff96
    • S
      tracing: Fix possible double free on failure of allocating trace buffer · 4397f045
      Steven Rostedt (VMware) 提交于
      Jing Xia and Chunyan Zhang reported that on failing to allocate part of the
      tracing buffer, memory is freed, but the pointers that point to them are not
      initialized back to NULL, and later paths may try to free the freed memory
      again. Jing and Chunyan fixed one of the locations that does this, but
      missed a spot.
      
      Link: http://lkml.kernel.org/r/20171226071253.8968-1-chunyan.zhang@spreadtrum.com
      
      Cc: stable@vger.kernel.org
      Fixes: 737223fb ("tracing: Consolidate buffer allocation code")
      Reported-by: NJing Xia <jing.xia@spreadtrum.com>
      Reported-by: NChunyan Zhang <chunyan.zhang@spreadtrum.com>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      4397f045