1. 18 1月, 2016 1 次提交
  2. 17 1月, 2016 1 次提交
    • D
      Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge · 78c5b2c6
      David S. Miller 提交于
      Antonio Quartulli says:
      
      ====================
      pull request [net]: batman-adv 20160117
      
      here you have a bunch of patches intended for net.
      
      This patchset is provided by Sven Eckelmann and it is basically
      fixing 2 major issues that exist in several parts of the code -
      that is why we have 8 patches.
      
      The first bugfix (patch 1 and 2) is preventing call_rcu from
      being invoked recursively. This would deceive any user waiting
      on rcu_barrier() because the latter won't be able to wait for
      the nested invocation thus triggering any sort of undefined
      behaviours.
      
      The second bugfix (patches from 3 to 8) prevents the code from
      freeing rcu protected objects without waiting for the proper grace
      period. This issue can potentially lead to wrong memory access
      and thus kernel crashes.
      
      Unfortunately this bogus code pattern was copy/pasted
      all around the place when developing new features, therefore
      Sven diligently created several patches to address each component
      independently.
      
      Given that such bugs were introduced quite some time ago, all
      the patches except patch 5 should be considered for submission
      to stable.
      
      Included changes:
      - avoid recursive invocations of call_rcu() which would fool users waiting on
        rcu_barrier()
      - prevent immediate kfree of objects used in rcu protected contexts
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      78c5b2c6
  3. 16 1月, 2016 38 次提交
    • S
      batman-adv: Drop immediate orig_node free function · 42eff6a6
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_orig_node_free_ref.
      
      Fixes: 72822225 ("batman-adv: Fix rcu_barrier() miss due to double call_rcu() in TT code")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      42eff6a6
    • S
      batman-adv: Drop immediate batadv_hard_iface free function · b4d922cf
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_hardif_free_ref.
      
      Fixes: 89652331 ("batman-adv: split tq information in neigh_node struct")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      b4d922cf
    • S
      batman-adv: Drop immediate neigh_ifinfo free function · ae3e1e36
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_neigh_ifinfo_free_ref.
      
      Fixes: 89652331 ("batman-adv: split tq information in neigh_node struct")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      ae3e1e36
    • S
      batman-adv: Drop immediate batadv_hardif_neigh_node free function · f6389692
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_hardif_neigh_free_ref.
      
      Fixes: cef63419 ("batman-adv: add list of unique single hop neighbors per hard-interface")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      f6389692
    • S
      batman-adv: Drop immediate batadv_neigh_node free function · 2baa753c
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_neigh_node_free_ref.
      
      Fixes: 89652331 ("batman-adv: split tq information in neigh_node struct")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      2baa753c
    • S
      batman-adv: Drop immediate batadv_orig_ifinfo free function · deed9660
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_orig_ifinfo_free_ref.
      
      Fixes: 7351a482 ("batman-adv: split out router from orig_node")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      deed9660
    • S
      batman-adv: Avoid recursive call_rcu for batadv_nc_node · 44e8e7e9
      Sven Eckelmann 提交于
      The batadv_nc_node_free_ref function uses call_rcu to delay the free of the
      batadv_nc_node object until no (already started) rcu_read_lock is enabled
      anymore. This makes sure that no context is still trying to access the
      object which should be removed. But batadv_nc_node also contains a
      reference to orig_node which must be removed.
      
      The reference drop of orig_node was done in the call_rcu function
      batadv_nc_node_free_rcu but should actually be done in the
      batadv_nc_node_release function to avoid nested call_rcus. This is
      important because rcu_barrier (e.g. batadv_softif_free or batadv_exit) will
      not detect the inner call_rcu as relevant for its execution. Otherwise this
      barrier will most likely be inserted in the queue before the callback of
      the first call_rcu was executed. The caller of rcu_barrier will therefore
      continue to run before the inner call_rcu callback finished.
      
      Fixes: d56b1705 ("batman-adv: network coding - detect coding nodes and remove these after timeout")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      44e8e7e9
    • S
      batman-adv: Avoid recursive call_rcu for batadv_bla_claim · 63b39927
      Sven Eckelmann 提交于
      The batadv_claim_free_ref function uses call_rcu to delay the free of the
      batadv_bla_claim object until no (already started) rcu_read_lock is enabled
      anymore. This makes sure that no context is still trying to access the
      object which should be removed. But batadv_bla_claim also contains a
      reference to backbone_gw which must be removed.
      
      The reference drop of backbone_gw was done in the call_rcu function
      batadv_claim_free_rcu but should actually be done in the
      batadv_claim_release function to avoid nested call_rcus. This is important
      because rcu_barrier (e.g. batadv_softif_free or batadv_exit) will not
      detect the inner call_rcu as relevant for its execution. Otherwise this
      barrier will most likely be inserted in the queue before the callback of
      the first call_rcu was executed. The caller of rcu_barrier will therefore
      continue to run before the inner call_rcu callback finished.
      
      Fixes: 23721387 ("batman-adv: add basic bridge loop avoidance code")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Acked-by: NSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      63b39927
    • I
      bna: fix Rx data corruption with VLAN stripping enabled and MTU > 4096 · 6c3f5aef
      Ivan Vecera 提交于
      The multi-buffer Rx mode implemented in the past introduced
      a regression that causes a data corruption for received VLAN
      traffic when VLAN tag stripping is enabled. This mode is supported
      only be newer chipsets (1860) and is enabled when MTU > 4096.
      
      When this mode is enabled Rx queue contains buffers with fixed size
      2048 bytes. Any incoming packet larger than 2048 is divided into
      multiple buffers that are attached as skb frags in polling routine.
      
      The driver assumes that all buffers associated with a packet except
      the last one is fully used (e.g. packet with size 5000 are divided
      into 3 buffers 2048 + 2048 + 904 bytes) and ignores true size reported
      in completions. This assumption is usually true but not when VLAN
      packet is received and VLAN tag stripping is enabled. In this case
      the first buffer is 2044 bytes long but as the driver always assumes
      2048 bytes then 4 extra random bytes are included between the first
      and the second frag. Additionally the driver sets checksum as correct
      so the packet is properly processed by the core.
      
      The driver needs to check the size of used space in each Rx buffer
      reported by FW and not blindly use the fixed value.
      
      Cc: Rasesh Mody <rasesh.mody@qlogic.com>
      Signed-off-by: NIvan Vecera <ivecera@redhat.com>
      Reviewed-by: NRasesh Mody <rasesh.mody@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c3f5aef
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 4e5448a3
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
       "A quick set of bug fixes after there initial networking merge:
      
        1) Netlink multicast group storage allocator only was tested with
           nr_groups equal to 1, make it work for other values too.  From
           Matti Vaittinen.
      
        2) Check build_skb() return value in macb and hip04_eth drivers, from
           Weidong Wang.
      
        3) Don't leak x25_asy on x25_asy_open() failure.
      
        4) More DMA map/unmap fixes in 3c59x from Neil Horman.
      
        5) Don't clobber IP skb control block during GSO segmentation, from
           Konstantin Khlebnikov.
      
        6) ECN helpers for ipv6 don't fixup the checksum, from Eric Dumazet.
      
        7) Fix SKB segment utilization estimation in xen-netback, from David
           Vrabel.
      
        8) Fix lockdep splat in bridge addrlist handling, from Nikolay
           Aleksandrov"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (26 commits)
        bgmac: Fix reversed test of build_skb() return value.
        bridge: fix lockdep addr_list_lock false positive splat
        net: smsc: Add support h8300
        xen-netback: free queues after freeing the net device
        xen-netback: delete NAPI instance when queue fails to initialize
        xen-netback: use skb to determine number of required guest Rx requests
        net: sctp: Move sequence start handling into sctp_transport_get_idx()
        ipv6: update skb->csum when CE mark is propagated
        net: phy: turn carrier off on phy attach
        net: macb: clear interrupts when disabling them
        sctp: support to lookup with ep+paddr in transport rhashtable
        net: hns: fixes no syscon error when init mdio
        dts: hisi: fixes no syscon fault when init mdio
        net: preserve IP control block during GSO segmentation
        fsl/fman: Delete one function call "put_device" in dtsec_config()
        hip04_eth: fix missing error handle for build_skb failed
        3c59x: fix another page map/single unmap imbalance
        3c59x: balance page maps and unmaps
        x25_asy: Free x25_asy on x25_asy_open() failure.
        mlxsw: fix SWITCHDEV_OBJ_ID_PORT_MDB
        ...
      4e5448a3
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 5a18d263
      Linus Torvalds 提交于
      Pull sparc fixes from David Miller:
       "Two sparc bug fixes"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc64: Fix numa node distance initialization
        sparc64: fix incorrect sign extension in sys_sparc64_personality
      5a18d263
    • L
      Merge tag 'powerpc-4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · f689b742
      Linus Torvalds 提交于
      Pull powerpc updates from Michael Ellerman:
       "Core:
         - Ground work for the new Power9 MMU from Aneesh Kumar K.V
         - Optimise FP/VMX/VSX context switching from Anton Blanchard
      
        Misc:
         - Various cleanups from Krzysztof Kozlowski, John Ogness, Rashmica
           Gupta, Russell Currey, Gavin Shan, Daniel Axtens, Michael Neuling,
           Andrew Donnellan
         - Allow wrapper to work on non-english system from Laurent Vivier
         - Add rN aliases to the pt_regs_offset table from Rashmica Gupta
         - Fix module autoload for rackmeter & axonram drivers from Luis de
           Bethencourt
         - Include KVM guest test in all interrupt vectors from Paul Mackerras
         - Fix DSCR inheritance over fork() from Anton Blanchard
         - Make value-returning atomics & {cmp}xchg* & their atomic_ versions
           fully ordered from Boqun Feng
         - Print MSR TM bits in oops messages from Michael Neuling
         - Add TM signal return & invalid stack selftests from Michael Neuling
         - Limit EPOW reset event warnings from Vipin K Parashar
         - Remove the Cell QPACE code from Rashmica Gupta
         - Append linux_banner to exception information in xmon from Rashmica
           Gupta
         - Add selftest to check if VSRs are corrupted from Rashmica Gupta
         - Remove broken GregorianDay() from Daniel Axtens
         - Import Anton's context_switch2 benchmark into selftests from
           Michael Ellerman
         - Add selftest script to test HMI functionality from Daniel Axtens
         - Remove obsolete OPAL v2 support from Stewart Smith
         - Make enter_rtas() private from Michael Ellerman
         - PPR exception cleanups from Michael Ellerman
         - Add page soft dirty tracking from Laurent Dufour
         - Add support for Nvlink NPUs from Alistair Popple
         - Add support for kexec on 476fpe from Alistair Popple
         - Enable kernel CPU dlpar from sysfs from Nathan Fontenot
         - Copy only required pieces of the mm_context_t to the paca from
           Michael Neuling
         - Add a kmsg_dumper that flushes OPAL console output on panic from
           Russell Currey
         - Implement save_stack_trace_regs() to enable kprobe stack tracing
           from Steven Rostedt
         - Add HWCAP bits for Power9 from Michael Ellerman
         - Fix _PAGE_PTE breaking swapoff from Aneesh Kumar K.V
         - Fix _PAGE_SWP_SOFT_DIRTY breaking swapoff from Hugh Dickins
         - scripts/recordmcount.pl: support data in text section on powerpc
           from Ulrich Weigand
         - Handle R_PPC64_ENTRY relocations in modules from Ulrich Weigand
      
        cxl:
         - cxl: Fix possible idr warning when contexts are released from
           Vaibhav Jain
         - cxl: use correct operator when writing pcie config space values
           from Andrew Donnellan
         - cxl: Fix DSI misses when the context owning task exits from Vaibhav
           Jain
         - cxl: fix build for GCC 4.6.x from Brian Norris
         - cxl: use -Werror only with CONFIG_PPC_WERROR from Brian Norris
         - cxl: Enable PCI device ID for future IBM CXL adapter from Uma
           Krishnan
      
        Freescale:
         - Freescale updates from Scott: Highlights include moving QE code out
           of arch/powerpc (to be shared with arm), device tree updates, and
           minor fixes"
      
      * tag 'powerpc-4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (149 commits)
        powerpc/module: Handle R_PPC64_ENTRY relocations
        scripts/recordmcount.pl: support data in text section on powerpc
        powerpc/powernv: Fix OPAL_CONSOLE_FLUSH prototype and usages
        powerpc/mm: fix _PAGE_SWP_SOFT_DIRTY breaking swapoff
        powerpc/mm: Fix _PAGE_PTE breaking swapoff
        cxl: Enable PCI device ID for future IBM CXL adapter
        cxl: use -Werror only with CONFIG_PPC_WERROR
        cxl: fix build for GCC 4.6.x
        powerpc: Add HWCAP bits for Power9
        powerpc/powernv: Reserve PE#0 on NPU
        powerpc/powernv: Change NPU PE# assignment
        powerpc/powernv: Fix update of NVLink DMA mask
        powerpc/powernv: Remove misleading comment in pci.c
        powerpc: Implement save_stack_trace_regs() to enable kprobe stack tracing
        powerpc: Fix build break due to paca mm_context_t changes
        cxl: Fix DSI misses when the context owning task exits
        MAINTAINERS: Update Scott Wood's e-mail address
        powerpc/powernv: Fix minor off-by-one error in opal_mce_check_early_recovery()
        powerpc: Fix style of self-test config prompts
        powerpc/powernv: Only delay opal_rtc_read() retry when necessary
        ...
      f689b742
    • D
      bgmac: Fix reversed test of build_skb() return value. · 750afbf8
      David S. Miller 提交于
      Fixes: f1640c3d ("bgmac: fix a missing check for build_skb")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      750afbf8
    • L
      Merge tag 'vfio-v4.5-rc1' of git://github.com/awilliam/linux-vfio · 37cea93b
      Linus Torvalds 提交于
      Pull VFIO updates from Alex Williamson:
      
       - Fixes in AMD xgbe reset, spapr structure padding, type 1 flags (Dan
         Carpenter, Alexey Kardashevskiy, Pierre Morel)
      
       - Re-introduce no-iommu mode, with a user this time (Alex Williamson)
      
      * tag 'vfio-v4.5-rc1' of git://github.com/awilliam/linux-vfio:
        vfio/iommu_type1: make use of info.flags
        vfio: Include No-IOMMU mode
        vfio: Add explicit alignments in vfio_iommu_spapr_tce_create
        VFIO: platform: reset: fix a warning message condition
      37cea93b
    • L
      Merge tag 'nfsd-4.5' of git://linux-nfs.org/~bfields/linux · cc80fe0e
      Linus Torvalds 提交于
      Pull nfsd updates from Bruce Fields:
       "Smaller bugfixes and cleanup, including a fix for a failures of
        kerberized NFSv4.1 mounts, and Scott Mayhew's work addressing ACK
        storms that can affect some high-availability NFS setups"
      
      * tag 'nfsd-4.5' of git://linux-nfs.org/~bfields/linux:
        nfsd: add new io class tracepoint
        nfsd: give up on CB_LAYOUTRECALLs after two lease periods
        nfsd: Fix nfsd leaks sunrpc module references
        lockd: constify nlmsvc_binding structure
        lockd: use to_delayed_work
        nfsd: use to_delayed_work
        Revert "svcrdma: Do not send XDR roundup bytes for a write chunk"
        lockd: Register callbacks on the inetaddr_chain and inet6addr_chain
        nfsd: Register callbacks on the inetaddr_chain and inet6addr_chain
        sunrpc: Add a function to close temporary transports immediately
        nfsd: don't base cl_cb_status on stale information
        nfsd4: fix gss-proxy 4.1 mounts for some AD principals
        nfsd: fix unlikely NULL deref in mach_creds_match
        nfsd: minor consolidation of mach_cred handling code
        nfsd: helper for dup of possibly NULL string
        svcrpc: move some initialization to common code
        nfsd: fix a warning message
        nfsd: constify nfsd4_callback_ops structure
        nfsd: recover: constify nfsd4_client_tracking_ops structures
        svcrdma: Do not send XDR roundup bytes for a write chunk
      cc80fe0e
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · c7b6c5fe
      Linus Torvalds 提交于
      Pull vfs regression fix from Al Viro:
       "Fix for braino introduced in vfs.git#work.misc"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        amdkfd: Copy from the proper user command pointer
      c7b6c5fe
    • N
      bridge: fix lockdep addr_list_lock false positive splat · c6894dec
      Nikolay Aleksandrov 提交于
      After promisc mode management was introduced a bridge device could do
      dev_set_promiscuity from its ndo_change_rx_flags() callback which in
      turn can be called after the bridge's addr_list_lock has been taken
      (e.g. by dev_uc_add). This causes a false positive lockdep splat because
      the port interfaces' addr_list_lock is taken when br_manage_promisc()
      runs after the bridge's addr list lock was already taken.
      To remove the false positive introduce a custom bridge addr_list_lock
      class and set it on bridge init.
      A simple way to reproduce this is with the following:
      $ brctl addbr br0
      $ ip l add l br0 br0.100 type vlan id 100
      $ ip l set br0 up
      $ ip l set br0.100 up
      $ echo 1 > /sys/class/net/br0/bridge/vlan_filtering
      $ brctl addif br0 eth0
      Splat:
      [   43.684325] =============================================
      [   43.684485] [ INFO: possible recursive locking detected ]
      [   43.684636] 4.4.0-rc8+ #54 Not tainted
      [   43.684755] ---------------------------------------------
      [   43.684906] brctl/1187 is trying to acquire lock:
      [   43.685047]  (_xmit_ETHER){+.....}, at: [<ffffffff8150169e>] dev_set_rx_mode+0x1e/0x40
      [   43.685460]  but task is already holding lock:
      [   43.685618]  (_xmit_ETHER){+.....}, at: [<ffffffff815072a7>] dev_uc_add+0x27/0x80
      [   43.686015]  other info that might help us debug this:
      [   43.686316]  Possible unsafe locking scenario:
      
      [   43.686743]        CPU0
      [   43.686967]        ----
      [   43.687197]   lock(_xmit_ETHER);
      [   43.687544]   lock(_xmit_ETHER);
      [   43.687886] *** DEADLOCK ***
      
      [   43.688438]  May be due to missing lock nesting notation
      
      [   43.688882] 2 locks held by brctl/1187:
      [   43.689134]  #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff81510317>] rtnl_lock+0x17/0x20
      [   43.689852]  #1:  (_xmit_ETHER){+.....}, at: [<ffffffff815072a7>] dev_uc_add+0x27/0x80
      [   43.690575] stack backtrace:
      [   43.690970] CPU: 0 PID: 1187 Comm: brctl Not tainted 4.4.0-rc8+ #54
      [   43.691270] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.1-20150318_183358- 04/01/2014
      [   43.691770]  ffffffff826a25c0 ffff8800369fb8e0 ffffffff81360ceb ffffffff826a25c0
      [   43.692425]  ffff8800369fb9b8 ffffffff810d0466 ffff8800369fb968 ffffffff81537139
      [   43.693071]  ffff88003a08c880 0000000000000000 00000000ffffffff 0000000002080020
      [   43.693709] Call Trace:
      [   43.693931]  [<ffffffff81360ceb>] dump_stack+0x4b/0x70
      [   43.694199]  [<ffffffff810d0466>] __lock_acquire+0x1e46/0x1e90
      [   43.694483]  [<ffffffff81537139>] ? netlink_broadcast_filtered+0x139/0x3e0
      [   43.694789]  [<ffffffff8153b5da>] ? nlmsg_notify+0x5a/0xc0
      [   43.695064]  [<ffffffff810d10f5>] lock_acquire+0xe5/0x1f0
      [   43.695340]  [<ffffffff8150169e>] ? dev_set_rx_mode+0x1e/0x40
      [   43.695623]  [<ffffffff815edea5>] _raw_spin_lock_bh+0x45/0x80
      [   43.695901]  [<ffffffff8150169e>] ? dev_set_rx_mode+0x1e/0x40
      [   43.696180]  [<ffffffff8150169e>] dev_set_rx_mode+0x1e/0x40
      [   43.696460]  [<ffffffff8150189c>] dev_set_promiscuity+0x3c/0x50
      [   43.696750]  [<ffffffffa0586845>] br_port_set_promisc+0x25/0x50 [bridge]
      [   43.697052]  [<ffffffffa05869aa>] br_manage_promisc+0x8a/0xe0 [bridge]
      [   43.697348]  [<ffffffffa05826ee>] br_dev_change_rx_flags+0x1e/0x20 [bridge]
      [   43.697655]  [<ffffffff81501532>] __dev_set_promiscuity+0x132/0x1f0
      [   43.697943]  [<ffffffff81501672>] __dev_set_rx_mode+0x82/0x90
      [   43.698223]  [<ffffffff815072de>] dev_uc_add+0x5e/0x80
      [   43.698498]  [<ffffffffa05b3c62>] vlan_device_event+0x542/0x650 [8021q]
      [   43.698798]  [<ffffffff8109886d>] notifier_call_chain+0x5d/0x80
      [   43.699083]  [<ffffffff810988b6>] raw_notifier_call_chain+0x16/0x20
      [   43.699374]  [<ffffffff814f456e>] call_netdevice_notifiers_info+0x6e/0x80
      [   43.699678]  [<ffffffff814f4596>] call_netdevice_notifiers+0x16/0x20
      [   43.699973]  [<ffffffffa05872be>] br_add_if+0x47e/0x4c0 [bridge]
      [   43.700259]  [<ffffffffa058801e>] add_del_if+0x6e/0x80 [bridge]
      [   43.700548]  [<ffffffffa0588b5f>] br_dev_ioctl+0xaf/0xc0 [bridge]
      [   43.700836]  [<ffffffff8151a7ac>] dev_ifsioc+0x30c/0x3c0
      [   43.701106]  [<ffffffff8151aac9>] dev_ioctl+0xf9/0x6f0
      [   43.701379]  [<ffffffff81254345>] ? mntput_no_expire+0x5/0x450
      [   43.701665]  [<ffffffff812543ee>] ? mntput_no_expire+0xae/0x450
      [   43.701947]  [<ffffffff814d7b02>] sock_do_ioctl+0x42/0x50
      [   43.702219]  [<ffffffff814d8175>] sock_ioctl+0x1e5/0x290
      [   43.702500]  [<ffffffff81242d0b>] do_vfs_ioctl+0x2cb/0x5c0
      [   43.702771]  [<ffffffff81243079>] SyS_ioctl+0x79/0x90
      [   43.703033]  [<ffffffff815eebb6>] entry_SYSCALL_64_fastpath+0x16/0x7a
      
      CC: Vlad Yasevich <vyasevic@redhat.com>
      CC: Stephen Hemminger <stephen@networkplumber.org>
      CC: Bridge list <bridge@lists.linux-foundation.org>
      CC: Andy Gospodarek <gospo@cumulusnetworks.com>
      CC: Roopa Prabhu <roopa@cumulusnetworks.com>
      Fixes: 2796d0c6 ("bridge: Automatically manage port promiscuous mode.")
      Reported-by: NAndy Gospodarek <gospo@cumulusnetworks.com>
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c6894dec
    • L
      Merge tag 'md/4.5' of git://neil.brown.name/md · 3c28c9cc
      Linus Torvalds 提交于
      Pull md updates from Neil Brown:
       "Mostly clustered-raid1 and raid5 journal updates.  one Y2038 fix and
        other minor stuff.
      
        One patch removes me from the MAINTAINERS file and adds a record of my
        md maintainership to Credits"
      
      Many thanks to Neil, who has been around for a _looong_ time.
      
      * tag 'md/4.5' of git://neil.brown.name/md: (26 commits)
        md/raid: only permit hot-add of compatible integrity profiles
        Remove myself as MD Maintainer, and add to Credits.
        raid5-cache: handle journal hotadd in quiesce
        MD: add journal with array suspended
        md: set MD_HAS_JOURNAL in correct places
        md: Remove 'ready' field from mddev.
        md: remove unnecesary md_new_event_inintr
        raid5: allow r5l_io_unit allocations to fail
        raid5-cache: use a mempool for the metadata block
        raid5-cache: use a bio_set
        raid5-cache: add journal hot add/remove support
        drivers: md: use ktime_get_real_seconds()
        md: avoid warning for 32-bit sector_t
        raid5-cache: free meta_page earlier
        raid5-cache: simplify r5l_move_io_unit_list
        md: update comment for md_allow_write
        md-cluster: update comments for MD_CLUSTER_SEND_LOCKED_ALREADY
        md-cluster: Protect communication with mutexes
        md-cluster: Defer MD reloading to mddev->thread
        md-cluster: update the documentation
        ...
      3c28c9cc
    • L
      Merge tag 'regulator-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator · 4b43ea2a
      Linus Torvalds 提交于
      Pull regulator updates from Mark Brown:
       "Aside from a fix for a spurious warning (which caused more problems
        than it fixed in the fixing really) this is all driver updates,
        including new drivers for Dialog PV88060/90 and TI LM363x and TPS65086
        devices.  The qcom_smd driver has had PM8916 and PMA8084 support
        added"
      
      * tag 'regulator-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (36 commits)
        regulator: core: remove some dead code
        regulator: core: use dev_to_rdev
        regulator: lp872x: Get rid of duplicate reference to DVS GPIO
        regulator: lp872x: Add missing of_match in regulators descriptions
        regulator: axp20x: Fix GPIO LDO enable value for AXP22x
        regulator: lp8788: constify regulator_ops structures
        regulator: wm8*: constify regulator_ops structures
        regulator: da9*: constify regulator_ops structures
        regulator: mt6311: Use REGCACHE_RBTREE
        regulator: tps65917/palmas: Add bypass ops for LDOs with bypass capability
        regulator: qcom-smd: Add support for PMA8084
        regulator: qcom-smd: Add PM8916 support
        soc: qcom: documentation: Update SMD/RPM Docs
        regulator: pv88090: logical vs bitwise AND typo
        regulator: pv88090: Fix irq leak
        regulator: pv88090: new regulator driver
        regulator: wm831x-ldo: Use platform_register/unregister_drivers()
        regulator: wm831x-dcdc: Use platform_register/unregister_drivers()
        regulator: lp8788-ldo: Use platform_register/unregister_drivers()
        regulator: core: Fix nested locking of supplies
        ...
      4b43ea2a
    • Y
      net: smsc: Add support h8300 · f147d0b3
      Yoshinori Sato 提交于
      Add H8/300 platform support for smc91x
      Signed-off-by: NYoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f147d0b3
    • B
      amdkfd: Copy from the proper user command pointer · 39c01bf9
      Borislav Petkov 提交于
      8f1d57c1 ("amdkfd: don't open-code memdup_user()") mistakenly uses
      an uninitialized local pointer, gcc complains:
      
        drivers/gpu/drm/amd/amdkfd/kfd_chardev.c: In function ‘kfd_ioctl_dbg_address_watch’:
        drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:562:12: warning: ‘args_buff’ may be used uninitialized in this function [-Wmaybe-uninitialized]
          args_buff = memdup_user(args_buff,
                      ^
      
      Fix it.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      39c01bf9
    • L
      Merge branch 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration · 7aca74e7
      Linus Torvalds 提交于
      Pull mailbox fixlet from Jussi Brar.
      
      * 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        mailbox: constify mbox_chan_ops structure
      7aca74e7
    • D
      Merge branch 'xen-netback-fixes' · 973365dc
      David S. Miller 提交于
      David Vrabel says:
      
      ====================
      xen-netback: use skb to determine number of required (etc.)
      
      "xen-netback: use skb to determine number of required" plus two other
      minor fixes I found down the back of the sofa.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      973365dc
    • D
      xen-netback: free queues after freeing the net device · 9c6f3ffe
      David Vrabel 提交于
      If a queue still has a NAPI instance added to the net device, freeing
      the queues early results in a use-after-free.
      
      The shouldn't ever happen because we disconnect and tear down all queues
      before freeing the net device, but doing this makes it obviously safe.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c6f3ffe
    • D
      xen-netback: delete NAPI instance when queue fails to initialize · 4a658527
      David Vrabel 提交于
      When xenvif_connect() fails it may leave a stale NAPI instance added to
      the device.  Make sure we delete it in the error path.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a658527
    • D
      xen-netback: use skb to determine number of required guest Rx requests · 99a2dea5
      David Vrabel 提交于
      Using the MTU or GSO size to determine the number of required guest Rx
      requests for an skb was subtly broken since these value may change at
      runtime.
      
      After 1650d545 (xen-netback: always
      fully coalesce guest Rx packets) we always fully pack a packet into
      its guest Rx slots.  Calculating the number of required slots from the
      packet length is then easy.
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99a2dea5
    • G
      net: sctp: Move sequence start handling into sctp_transport_get_idx() · fb331185
      Geert Uytterhoeven 提交于
      net/sctp/proc.c: In function ‘sctp_transport_get_idx’:
      net/sctp/proc.c:313: warning: ‘obj’ may be used uninitialized in this function
      
      This is currently a false positive, as all callers check for a zero
      offset first, and handle this case in the exact same way.
      
      Move the check and handling into sctp_transport_get_idx() to kill the
      compiler warning, and avoid future bugs.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fb331185
    • E
      ipv6: update skb->csum when CE mark is propagated · 34ae6a1a
      Eric Dumazet 提交于
      When a tunnel decapsulates the outer header, it has to comply
      with RFC 6080 and eventually propagate CE mark into inner header.
      
      It turns out IP6_ECN_set_ce() does not correctly update skb->csum
      for CHECKSUM_COMPLETE packets, triggering infamous "hw csum failure"
      messages and stack traces.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      34ae6a1a
    • L
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 1d3671df
      Linus Torvalds 提交于
      Pull UDF fixes and quota cleanups from Jan Kara:
       "Several UDF fixes and some minor quota cleanups"
      
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        udf: Check output buffer length when converting name to CS0
        udf: Prevent buffer overrun with multi-byte characters
        quota: constify qtree_fmt_operations structures
        udf: avoid uninitialized variable use
        udf: Fix lost indirect extent block
        udf: Factor out code for creating indirect extent
        udf: limit the maximum number of indirect extents in a row
        udf: limit the maximum number of TD redirections
        fs: make quota/dquot.c explicitly non-modular
        fs: make quota/netlink.c explicitly non-modular
      1d3671df
    • S
      net: phy: turn carrier off on phy attach · 113c74d8
      Sjoerd Simons 提交于
      The operstate of a networking device initially IF_OPER_UNKNOWN aka
      "unknown", updated on carrier state changes (with carrier state being on
      by default). This means it will stay unknown unless the carrier state
      goes to off at some point, which is not the case if the phy is already
      up/connected at startup.
      
      Explicitly turn off the carrier on phy attach, leaving the phy state
      machine to turn the carrier on when it has done the initial negotiation.
      Signed-off-by: NSjoerd Simons <sjoerd.simons@collabora.co.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      113c74d8
    • N
      net: macb: clear interrupts when disabling them · 24468374
      Nathan Sullivan 提交于
      Disabling interrupts with the IDR register does not stop the macb hardware
      from asserting its interrupt line if there are interrupts pending.  Always
      clear the interrupts using ISR, and be sure to write it on hardware that
      is not read-to-clear, like Zynq.  Not doing so will cause interrupts when
      the driver doesn't expect them.
      Signed-off-by: NNathan Sullivan <nathan.sullivan@ni.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24468374
    • L
      Merge branch 'akpm' (patches from Andrew) · 875fc4f5
      Linus Torvalds 提交于
      Merge first patch-bomb from Andrew Morton:
      
       - A few hotfixes which missed 4.4 becasue I was asleep.  cc'ed to
         -stable
      
       - A few misc fixes
      
       - OCFS2 updates
      
       - Part of MM.  Including pretty large changes to page-flags handling
         and to thp management which have been buffered up for 2-3 cycles now.
      
        I have a lot of MM material this time.
      
      [ It turns out the THP part wasn't quite ready, so that got dropped from
        this series  - Linus ]
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (117 commits)
        zsmalloc: reorganize struct size_class to pack 4 bytes hole
        mm/zbud.c: use list_last_entry() instead of list_tail_entry()
        zram/zcomp: do not zero out zcomp private pages
        zram: pass gfp from zcomp frontend to backend
        zram: try vmalloc() after kmalloc()
        zram/zcomp: use GFP_NOIO to allocate streams
        mm: add tracepoint for scanning pages
        drivers/base/memory.c: fix kernel warning during memory hotplug on ppc64
        mm/page_isolation: use macro to judge the alignment
        mm: fix noisy sparse warning in LIBCFS_ALLOC_PRE()
        mm: rework virtual memory accounting
        include/linux/memblock.h: fix ordering of 'flags' argument in comments
        mm: move lru_to_page to mm_inline.h
        Documentation/filesystems: describe the shared memory usage/accounting
        memory-hotplug: don't BUG() in register_memory_resource()
        hugetlb: make mm and fs code explicitly non-modular
        mm/swapfile.c: use list_for_each_entry_safe in free_swap_count_continuations
        mm: /proc/pid/clear_refs: no need to clear VM_SOFTDIRTY in clear_soft_dirty_pmd()
        mm: make sure isolate_lru_page() is never called for tail page
        vmstat: make vmstat_updater deferrable again and shut down on idle
        ...
      875fc4f5
    • X
      sctp: support to lookup with ep+paddr in transport rhashtable · 65a5124a
      Xin Long 提交于
      Now, when we sendmsg, we translate the ep to laddr by selecting the
      first element of the list, and then do a lookup for a transport.
      
      But sctp_hash_cmp() will compare it against asoc addr_list, which may
      be a subset of ep addr_list, meaning that this chosen laddr may not be
      there, and thus making it impossible to find the transport.
      
      So we fix it by using ep + paddr to lookup transports in hashtable. In
      sctp_hash_cmp, if .ep is set, we will check if this ep == asoc->ep,
      or we will do the laddr check.
      
      Fixes: d6c0256a ("sctp: add the rhashtable apis for sctp global transport hashtable")
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Acked-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Reported-by: NVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      65a5124a
    • W
      zsmalloc: reorganize struct size_class to pack 4 bytes hole · 7dfa4612
      Weijie Yang 提交于
      Reoder the pages_per_zspage field in struct size_class which can
      eliminate the 4 bytes hole between it and stats field.
      Signed-off-by: NWeijie Yang <weijie.yang@samsung.com>
      Reviewed-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7dfa4612
    • G
      mm/zbud.c: use list_last_entry() instead of list_tail_entry() · f58fb5e7
      Geliang Tang 提交于
      list_last_entry*( has been defined in list.h, so replace
      list_tail_entry() with it.
      Signed-off-by: NGeliang Tang <geliangtang@163.com>
      Cc: Seth Jennings <sjennings@variantweb.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f58fb5e7
    • S
      zram/zcomp: do not zero out zcomp private pages · e02d238c
      Sergey Senozhatsky 提交于
      Do not __GFP_ZERO allocated zcomp ->private pages.  We keep allocated
      streams around and use them for read/write requests, so we supply a
      zeroed out ->private to compression algorithm as a scratch buffer only
      once -- the first time we use that stream.  For the rest of IO requests
      served by this stream ->private usually contains some temporarily data
      from the previous requests.
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Acked-by: NMinchan Kim <minchan@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e02d238c
    • M
      zram: pass gfp from zcomp frontend to backend · 75d8947a
      Minchan Kim 提交于
      Each zcomp backend uses own gfp flag but it's pointless because the
      context they could be called is driven by upper layer(ie, zcomp
      frontend).  As well, zcomp frondend could call them in different
      context.  One context(ie, zram init part) is it should be better to make
      sure successful allocation other context(ie, further stream allocation
      part for accelarating I/O speed) is just optional so let's pass gfp down
      from driver (ie, zcomp frontend) like normal MM convention.
      
      [sergey.senozhatsky@gmail.com: add missing __vmalloc zero and highmem gfps]
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      75d8947a
    • K
      zram: try vmalloc() after kmalloc() · d913897a
      Kyeongdon Kim 提交于
      When we're using LZ4 multi compression streams for zram swap, we found
      out page allocation failure message in system running test.  That was
      not only once, but a few(2 - 5 times per test).  Also, some failure
      cases were continually occurring to try allocation order 3.
      
      In order to make parallel compression private data, we should call
      kzalloc() with order 2/3 in runtime(lzo/lz4).  But if there is no order
      2/3 size memory to allocate in that time, page allocation fails.  This
      patch makes to use vmalloc() as fallback of kmalloc(), this prevents
      page alloc failure warning.
      
      After using this, we never found warning message in running test, also
      It could reduce process startup latency about 60-120ms in each case.
      
      For reference a call trace :
      
          Binder_1: page allocation failure: order:3, mode:0x10c0d0
          CPU: 0 PID: 424 Comm: Binder_1 Tainted: GW 3.10.49-perf-g991d02b-dirty #20
          Call trace:
            dump_backtrace+0x0/0x270
            show_stack+0x10/0x1c
            dump_stack+0x1c/0x28
            warn_alloc_failed+0xfc/0x11c
            __alloc_pages_nodemask+0x724/0x7f0
            __get_free_pages+0x14/0x5c
            kmalloc_order_trace+0x38/0xd8
            zcomp_lz4_create+0x2c/0x38
            zcomp_strm_alloc+0x34/0x78
            zcomp_strm_multi_find+0x124/0x1ec
            zcomp_strm_find+0xc/0x18
            zram_bvec_rw+0x2fc/0x780
            zram_make_request+0x25c/0x2d4
            generic_make_request+0x80/0xbc
            submit_bio+0xa4/0x15c
            __swap_writepage+0x218/0x230
            swap_writepage+0x3c/0x4c
            shrink_page_list+0x51c/0x8d0
            shrink_inactive_list+0x3f8/0x60c
            shrink_lruvec+0x33c/0x4cc
            shrink_zone+0x3c/0x100
            try_to_free_pages+0x2b8/0x54c
            __alloc_pages_nodemask+0x514/0x7f0
            __get_free_pages+0x14/0x5c
            proc_info_read+0x50/0xe4
            vfs_read+0xa0/0x12c
            SyS_read+0x44/0x74
          DMA: 3397*4kB (MC) 26*8kB (RC) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB
               0*512kB 0*1024kB 0*2048kB 0*4096kB = 13796kB
      
      [minchan@kernel.org: change vmalloc gfp and adding comment about gfp]
      [sergey.senozhatsky@gmail.com: tweak comments and styles]
      Signed-off-by: NKyeongdon Kim <kyeongdon.kim@lge.com>
      Signed-off-by: NMinchan Kim <minchan@kernel.org>
      Acked-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d913897a