1. 29 3月, 2016 1 次提交
    • D
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · 0c84ea17
      David S. Miller 提交于
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for you net tree,
      they are:
      
      1) There was a race condition between parallel save/swap and delete,
         which resulted a kernel crash due to the increase ref for save, swap,
         wrong ref decrease operations. Reported and fixed by Vishwanath Pai.
      
      2) OVS should call into CT NAT for packets of new expected connections only
         when the conntrack state is persisted with the 'commit' option to the
         OVS CT action. From Jarno Rajahalme.
      
      3) Resolve kconfig dependencies with new OVS NAT support. From Arnd Bergmann.
      
      4) Early validation of entry->target_offset to make sure it doesn't take us
         out from the blob, from Florian Westphal.
      
      5) Again early validation of entry->next_offset to make sure it doesn't take
         out from the blob, also from Florian.
      
      6) Check that entry->target_offset is always of of sizeof(struct xt_entry)
         for unconditional entries, when checking both from check_underflow()
         and when checking for loops in mark_source_chains(), again from
         Florian.
      
      7) Fix inconsistent behaviour in nfnetlink_queue when
         NFQA_CFG_F_FAIL_OPEN is set and netlink_unicast() fails due to buffer
         overrun, we have to reinject the packet as the user expects.
      
      8) Enforce nul-terminated table names from getsockopt GET_ENTRIES
         requests.
      
      9) Don't assume skb->sk is set from nft_bridge_reject and synproxy,
         this fixes a recent update of the code to namespaceify
         ip_default_ttl, patch from Liping Zhang.
      
      This batch comes with four patches to validate x_tables blobs coming
      from userspace. CONFIG_USERNS exposes the x_tables interface to
      unpriviledged users and to be honest this interface never received the
      attention for this move away from the CAP_NET_ADMIN domain. Florian is
      working on another round with more patches with more sanity checks, so
      expect a bit more Netfilter fixes in this development cycle than usual.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c84ea17
  2. 28 3月, 2016 18 次提交
  3. 25 3月, 2016 21 次提交
    • C
      net: macb: remove BUG_ON() and reset the queue to handle RX errors · 9ba723b0
      Cyrille Pitchen 提交于
      This patch removes two BUG_ON() used to notify about RX queue corruptions
      on macb (not gem) hardware without actually handling the error.
      
      The new code skips corrupted frames but still processes faultless frames.
      Then it resets the RX queue before restarting the reception from a clean
      state.
      
      This patch is a rework of an older patch proposed by Neil Armstrong:
      http://patchwork.ozlabs.org/patch/371525/Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Acked-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ba723b0
    • M
      qlge: Update version to 1.00.00.35 · d31fecd1
      Manish Chopra 提交于
      Just updating version as many fixes got
      accumulated over 1.00.00.34
      Signed-off-by: NManish Chopra <manish.chopra@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d31fecd1
    • J
      net: phy: bcm7xxx: Add entries for Broadcom BCM7346 and BCM7362 · 4cef191d
      Jaedon Shin 提交于
      Add PHY entries for the Broadcom BCM7346 and BCM7362 chips, these are
      40nm generation Ethernet PHY.
      
      Fixes: 815717d1 ("net: phy: bcm7xxx: Remove wildcard entries")
      Signed-off-by: NJaedon Shin <jaedon.shin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cef191d
    • D
      bpf: add missing map_flags to bpf_map_show_fdinfo · 322cea2f
      Daniel Borkmann 提交于
      Add map_flags attribute to bpf_map_show_fdinfo(), so that tools like
      tc can check for them when loading objects from a pinned entry, e.g.
      if user intent wrt allocation (BPF_F_NO_PREALLOC) is different to the
      pinned object, it can bail out. Follow-up to 6c905981 ("bpf:
      pre-allocate hash map elements"), so that tc can still support this
      with v4.6.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      322cea2f
    • B
      netpoll: Fix extra refcount release in netpoll_cleanup() · 543e3a8d
      Bjorn Helgaas 提交于
      netpoll_setup() does a dev_hold() on np->dev, the netpoll device.  If it
      fails, it correctly does a dev_put() but leaves np->dev set.  If we call
      netpoll_cleanup() after the failure, np->dev is still set so we do another
      dev_put(), which decrements the refcount an extra time.
      
      It's questionable to call netpoll_cleanup() after netpoll_setup() fails,
      but it can be difficult to find the problem, and we can easily avoid it in
      this case.  The extra decrements can lead to hangs like this:
      
        unregister_netdevice: waiting for bond0 to become free. Usage count = -3
      
      Set and clear np->dev at the points where we dev_hold() and dev_put() the
      device.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      543e3a8d
    • P
      net: bcmgenet: fix skb_len in bcmgenet_xmit_single() · 7dd39913
      Petri Gynther 提交于
      skb_len needs to be skb_headlen(skb) in bcmgenet_xmit_single().
      
      Fragmented skbs can have only Ethernet + IP + TCP headers (14+20+20=54 bytes)
      in the linear buffer, followed by the rest in fragments. Bumping skb_len to
      ETH_ZLEN would be incorrect for this case, as it would introduce garbage
      between TCP header and the fragment data.
      
      This also works with regular/non-fragmented small packets < ETH_ZLEN bytes.
      Successfully tested this on GENETv3 with 42-byte ARP frames.
      
      For testing, I used:
      ethtool -K eth0 tx-checksum-ipv4 off
      ethtool -K eth0 tx-checksum-ipv6 off
      echo 0 > /proc/sys/net/ipv4/tcp_timestamps
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NPetri Gynther <pgynther@google.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7dd39913
    • P
      net: bcmgenet: fix dev->stats.tx_bytes accounting · 55868120
      Petri Gynther 提交于
      1. Add bytes_compl local variable to __bcmgenet_tx_reclaim() to collect
         transmitted bytes. dev->stats updates can then be moved outside the
         while-loop. bytes_compl is also needed for future BQL support.
      2. When bcmgenet device uses Tx checksum offload, each transmitted skb
         gets an extra 64-byte header prepended to it. Before this header is
         prepended to the skb, we need to save the skb "wire" length in
         GENET_CB(skb)->bytes_sent, so that proper Tx bytes accounting can
         be done in __bcmgenet_tx_reclaim().
      3. skb->len covers the entire length of skb, whether it is linear or
         fragmented. Thus, when we clean the fragments, do not increase
         transmitted bytes.
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NPetri Gynther <pgynther@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      55868120
    • N
      switchdev: fix typo in comments/doc · 3e347660
      Nicolas Dichtel 提交于
      Two minor typo.
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e347660
    • C
      net: macb: replace macb_writel() call by queue_writel() to update queue ISR · ba504994
      Cyrille Pitchen 提交于
      macb_interrupt() should not use macb_writel(bp, ISR, <value>) but only
      queue_writel(queue, ISR, <value>).
      
      There is one IRQ and one set of {ISR, IER, IDR, IMR} [1] registers per
      queue on gem hardware, though only queue0 is actually used for now to
      receive frames: other queues can already be used to transmit frames.
      
      The queue_readl() and queue_writel() helper macros are designed to access
      the relevant IRQ registers.
      
      [1]
      ISR: Interrupt Status Register
      IER: Interrupt Enable Register
      IDR: Interrupt Disable Register
      IMR: Interrupt Mask Register
      Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Fixes: bfbb92c4 ("net: macb: Handle the RXUBR interrupt on all devices")
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba504994
    • D
      Merge branch 'hns-fixes' · 7629d9c1
      David S. Miller 提交于
      Yisen Zhuang says:
      
      ====================
      net: hns: fix some bugs in HNS driver
      
      Here are some bug fixed patches for HNS driver.
      
      They are:
      
      >from Kejian, fix for the warning of passing zero to 'PTR_ERR'
      
      >from qianqian, four fixes for inappropriate operation in hns driver
      
      >from Sheng, one fix for optimization of irq proccess in hns driver, and
      one fix for hilink status for hns driver.
      
      For more details, please see individual patches.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7629d9c1
    • S
      net: hns: bug fix about getting hilink status for HNS v2 · c1203fe7
      Sheng Li 提交于
      The hilink status reg in HNS V2 is different from HNS v1. In HNS V2, It
      distinguishes differnt lane status according to the bit-field of the reg.
      As is shown below:
      [0:0] ---> lane0
      [1:1] ---> lane1
      ...
      
      But the current driver reads the reg to get the hilink status ONLY
      concidering HNS V1 situation. Here is a patch to support both of them.
      Signed-off-by: NSheng Li <lisheng011@huawei.com>
      Signed-off-by: NDaode Huang <huangdaode@hisilicon.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1203fe7
    • K
      net: hns: fix warning of passing zero to 'PTR_ERR' · daa8cfd9
      Kejian Yan 提交于
      There is a misuse of PTR as shown below:
      
      	ae_node = (void *)of_parse_phandle(dev->of_node,
      					   "ae-handle",
      					   0);
      	if (IS_ERR_OR_NULL(ae_node)) {
      		ret = PTR_ERR(ae_node);
      		dev_err(dev, "not find ae-handle\n");
      		goto out_read_prop_fail;
      	}
      
      if the ae_node is NULL, PTR_ERR(ae_node) means it returns success. And the
      return value should be -ENODEV.
      Signed-off-by: NKejian Yan <yankejian@huawei.com>
      Signed-off-by: NYisen Zhuang <Yisen.Zhuang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      daa8cfd9
    • S
      net: hns: optimizate irq proccess for HNS V2 · 4b34aa41
      Sheng Li 提交于
      In hns V1, common_poll should check and clean fbd pkts, because it
      can not pend irq to clean them if there is no new pkt comes in.
      But hns V2 hw fixes this bug, and will pend irq itself to do this.
      So, for hns V2, we set ring_data->fini_process to NULL.
      Signed-off-by: NSheng Li <lisheng011@huawei.com>
      Signed-off-by: NYisen Zhuang <Yisen.Zhuang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b34aa41
    • Q
      net: hns: remove useless variable assignment and comment · 1c3bae6e
      Qianqian Xie 提交于
      The variable head in hns_nic_tx_fini_pro has read a value, but it is
      obviously no use. The patch will fix it.
      And the comment is nothing to do with the routine, so it has to be removed
      Signed-off-by: NQianqian Xie <xieqianqian@huawei.com>
      Signed-off-by: NYisen Zhuang <Yisen.Zhuang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c3bae6e
    • Q
      net: hns: bug fix for return values · 055a9417
      Qianqian Xie 提交于
      The return values in the first two functions mdiobus_write()
      are ignored. The patch will fix it.
      Signed-off-by: NQianqian Xie <xieqianqian@huawei.com>
      Signed-off-by: NYisen Zhuang <Yisen.Zhuang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      055a9417
    • Q
      net: hns: optimizate fmt of snprintf() · 8d71397b
      Qianqian Xie 提交于
      It misses string format in function snprintf(), as below:
      snprintf(buff, ETH_GSTRING_LEN, g_gmac_stats_string[i].desc);
      
      It needs to add "%s" to fix it as below:
      snprintf(buff, ETH_GSTRING_LEN, "%s", g_gmac_stats_string[i].desc);
      Signed-off-by: NQianqian Xie <xieqianqian@huawei.com>
      Signed-off-by: NKejian Yan <yankejian@huawei.com>
      Signed-off-by: NYisen Zhuang <Yisen.Zhuang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d71397b
    • Q
      net: hns: fix a bug for cycle index · 52613126
      Qianqian Xie 提交于
      The cycle index should be varied while the variable j is a fixed value.
      The patch will fix this bug.
      Signed-off-by: NQianqian Xie <xieqianqian@huawei.com>
      Signed-off-by: NYisen Zhuang <Yisen.Zhuang@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      52613126
    • S
      xfrm: Fix crash observed during device unregistration and decryption · 071d36bf
      subashab@codeaurora.org 提交于
      A crash is observed when a decrypted packet is processed in receive
      path. get_rps_cpus() tries to dereference the skb->dev fields but it
      appears that the device is freed from the poison pattern.
      
      [<ffffffc000af58ec>] get_rps_cpu+0x94/0x2f0
      [<ffffffc000af5f94>] netif_rx_internal+0x140/0x1cc
      [<ffffffc000af6094>] netif_rx+0x74/0x94
      [<ffffffc000bc0b6c>] xfrm_input+0x754/0x7d0
      [<ffffffc000bc0bf8>] xfrm_input_resume+0x10/0x1c
      [<ffffffc000ba6eb8>] esp_input_done+0x20/0x30
      [<ffffffc0000b64c8>] process_one_work+0x244/0x3fc
      [<ffffffc0000b7324>] worker_thread+0x2f8/0x418
      [<ffffffc0000bb40c>] kthread+0xe0/0xec
      
      -013|get_rps_cpu(
           |    dev = 0xFFFFFFC08B688000,
           |    skb = 0xFFFFFFC0C76AAC00 -> (
           |      dev = 0xFFFFFFC08B688000 -> (
           |        name =
      "......................................................
           |        name_hlist = (next = 0xAAAAAAAAAAAAAAAA, pprev =
      0xAAAAAAAAAAA
      
      Following are the sequence of events observed -
      
      - Encrypted packet in receive path from netdevice is queued
      - Encrypted packet queued for decryption (asynchronous)
      - Netdevice brought down and freed
      - Packet is decrypted and returned through callback in esp_input_done
      - Packet is queued again for process in network stack using netif_rx
      
      Since the device appears to have been freed, the dereference of
      skb->dev in get_rps_cpus() leads to an unhandled page fault
      exception.
      
      Fix this by holding on to device reference when queueing packets
      asynchronously and releasing the reference on call back return.
      
      v2: Make the change generic to xfrm as mentioned by Steffen and
      update the title to xfrm
      Suggested-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NJerome Stanislaus <jeromes@codeaurora.org>
      Signed-off-by: NSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      071d36bf
    • L
      Merge tag 'trace-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · e46b4e2b
      Linus Torvalds 提交于
      Pull tracing updates from Steven Rostedt:
       "Nothing major this round.  Mostly small clean ups and fixes.
      
        Some visible changes:
      
         - A new flag was added to distinguish traces done in NMI context.
      
         - Preempt tracer now shows functions where preemption is disabled but
           interrupts are still enabled.
      
        Other notes:
      
         - Updates were done to function tracing to allow better performance
           with perf.
      
         - Infrastructure code has been added to allow for a new histogram
           feature for recording live trace event histograms that can be
           configured by simple user commands.  The feature itself was just
           finished, but needs a round in linux-next before being pulled.
      
           This only includes some infrastructure changes that will be needed"
      
      * tag 'trace-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (22 commits)
        tracing: Record and show NMI state
        tracing: Fix trace_printk() to print when not using bprintk()
        tracing: Remove redundant reset per-CPU buff in irqsoff tracer
        x86: ftrace: Fix the misleading comment for arch/x86/kernel/ftrace.c
        tracing: Fix crash from reading trace_pipe with sendfile
        tracing: Have preempt(irqs)off trace preempt disabled functions
        tracing: Fix return while holding a lock in register_tracer()
        ftrace: Use kasprintf() in ftrace_profile_tracefs()
        ftrace: Update dynamic ftrace calls only if necessary
        ftrace: Make ftrace_hash_rec_enable return update bool
        tracing: Fix typoes in code comment and printk in trace_nop.c
        tracing, writeback: Replace cgroup path to cgroup ino
        tracing: Use flags instead of bool in trigger structure
        tracing: Add an unreg_all() callback to trigger commands
        tracing: Add needs_rec flag to event triggers
        tracing: Add a per-event-trigger 'paused' field
        tracing: Add get_syscall_name()
        tracing: Add event record param to trigger_ops.func()
        tracing: Make event trigger functions available
        tracing: Make ftrace_event_field checking functions available
        ...
      e46b4e2b
    • L
      Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · faea72dd
      Linus Torvalds 提交于
      Pull thermal updates from Zhang Rui:
      
       - Fix a regression where bogus trip points on some Lenovo laptops start
         to screw up thermal control after commit 81ad4276 ("Thermal:
         initialize thermal zone device correctly").
      
         On these Lenovo laptops, a bogus passive trip point is reported,
         which is 0 degree Celsius.  Without commit 81ad4276, thermal zone
         fails to set cooling devices to proper cooling state, which is a bug.
         But with commit 81ad4276 applied, the processors are always
         throttled on these Lenovo laptops because the current temperature is
         always higher than the passive trip point.
      
         Fix things to ignore such bogus trip points.  (Zhang Rui)
      
       - Introduce Mediatek thermal driver.  (Sascha Hauer)
      
       - Introduce devm_ versions of OF thermal sensor register API.  (Laxman
         Dewangan)
      
       - Changes in Kconfigs to allow compile test on UM arch.  (Krzysztof
         Kozlowski)
      
       - Introduce Skylake support in intel_pch_thermal driver.  (Srinivas
         Pandruvada)
      
       - Several small fixes on Rockchip, TI-SoC, Tegra, RCar, and Exynos
         thermal drivers.
      
      * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (26 commits)
        Thermal: Ignore invalid trip points
        thermal: trace: migrating thermal traces to use TRACE_DEFINE_ENUM() macros
        thermal: intel_pch_thermal: Enable Skylake PCH thermal
        thermal: doc: Add details of devm_thermal_zone_of_sensor_{register,unregister}
        thermal: of-thermal: Add devm version of thermal_zone_of_sensor_register
        thermal: doc: Add details of thermal_zone_of_sensor_{register,unregister}
        thermal: exynos: Defer probe if vtmu is present but not registered
        thermal: exynos: Use devm_regulator_get_optional() for vtmu
        thermal: exynos: List vtmu-supply as optional property in DT binding
        thermal: exynos: Print a message about exceeded number of supported trip-points
        thermal: exynos: Document number of supported trip-points
        thermal: exynos: Document compatible for Exynos5433 TMU
        thermal: mtk: allow compile testing on UM
        thermal: tegra_soctherm: fix sign bit of temperature
        thermal: Fix build error of missing devm_ioremap_resource on UM
        thermal: ti-soc-thermal: clean up the error handling a bit
        thermal: rcar: Use ARCH_RENESAS
        thermal: rcar_thermal: don't open code of_device_get_match_data()
        thermal: db8500_cpufreq_cooling: Compile with COMPILE_TEST
        thermal: rockchip: fix the tsadc sequence output on rk3228/rk3399
        ...
      faea72dd
    • L
      Merge tag 'nfsd-4.6' of git://linux-nfs.org/~bfields/linux · 5b1e167d
      Linus Torvalds 提交于
      Pull nfsd updates from Bruce Fields:
       "Various bugfixes, a RDMA update from Chuck Lever, and support for a
        new pnfs layout type from Christoph Hellwig.  The new layout type is a
        variant of the block layout which uses SCSI features to offer improved
        fencing and device identification.
      
        (Also: note this pull request also includes the client side of SCSI
        layout, with Trond's permission.)"
      
      * tag 'nfsd-4.6' of git://linux-nfs.org/~bfields/linux:
        sunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race
        nfsd: recover: fix memory leak
        nfsd: fix deadlock secinfo+readdir compound
        nfsd4: resfh unused in nfsd4_secinfo
        svcrdma: Use new CQ API for RPC-over-RDMA server send CQs
        svcrdma: Use new CQ API for RPC-over-RDMA server receive CQs
        svcrdma: Remove close_out exit path
        svcrdma: Hook up the logic to return ERR_CHUNK
        svcrdma: Use correct XID in error replies
        svcrdma: Make RDMA_ERROR messages work
        rpcrdma: Add RPCRDMA_HDRLEN_ERR
        svcrdma: svc_rdma_post_recv() should close connection on error
        svcrdma: Close connection when a send error occurs
        nfsd: Lower NFSv4.1 callback message size limit
        svcrdma: Do not send Write chunk XDR pad with inline content
        svcrdma: Do not write xdr_buf::tail in a Write chunk
        svcrdma: Find client-provided write and reply chunks once per reply
        nfsd: Update NFS server comments related to RDMA support
        nfsd: Fix a memory leak when meeting unsupported state_protect_how4
        nfsd4: fix bad bounds checking
      5b1e167d