1. 05 5月, 2016 3 次提交
    • F
      netfilter: conntrack: fix lookup race during hash resize · 5e3c61f9
      Florian Westphal 提交于
      When resizing the conntrack hash table at runtime via
      echo 42 > /sys/module/nf_conntrack/parameters/hashsize, we are racing with
      the conntrack lookup path -- reads can happen in parallel and nothing
      prevents readers from observing a the newly allocated hash but the old
      size (or vice versa).
      
      So access to hash[bucket] can trigger OOB read access in case the table got
      expanded and we saw the new size but the old hash pointer (or it got shrunk
      and we got new hash ptr but the size of the old and larger table):
      
      kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] SMP KASAN
      CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 4.6.0-rc2+ #107
      [..]
      Call Trace:
      [<ffffffff822c3d6a>] ? nf_conntrack_tuple_taken+0x12a/0xe90
      [<ffffffff822c3ac1>] ? nf_ct_invert_tuplepr+0x221/0x3a0
      [<ffffffff8230e703>] get_unique_tuple+0xfb3/0x2760
      
      Use generation counter to obtain the address/length of the same table.
      
      Also add a synchronize_net before freeing the old hash.
      AFAICS, without it we might access ct_hash[bucket] after ct_hash has been
      freed, provided that lockless reader got delayed by another event:
      
      CPU1			CPU2
      seq_begin
      seq_retry
      <delay>			resize occurs
      			free oldhash
      for_each(oldhash[size])
      
      Note that resize is only supported in init_netns, it took over 2 minutes
      of constant resizing+flooding to produce the warning, so this isn't a
      big problem in practice.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      5e3c61f9
    • F
      netfilter: conntrack: keep BH enabled during lookup · 2cf12348
      Florian Westphal 提交于
      No need to disable BH here anymore:
      
      stats are switched to _ATOMIC variant (== this_cpu_inc()), which
      nowadays generates same code as the non _ATOMIC NF_STAT, at least on x86.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      2cf12348
    • F
      netfilter: nftables: add connlabel set support · 1ad8f48d
      Florian Westphal 提交于
      Conntrack labels are currently sized depending on the iptables
      ruleset, i.e. if we're asked to test or set bits 1, 2, and 65 then we
      would allocate enough room to store at least bit 65.
      
      However, with nft, the input is just a register with arbitrary runtime
      content.
      
      We therefore ask for the upper ceiling we currently have, which is
      enough room to store 128 bits.
      
      Alternatively, we could alter nf_connlabel_replace to increase
      net->ct.label_words at run time, but since 128 bits is not that
      big we'd only save sizeof(long) so it doesn't seem worth it for now.
      
      This follows a similar approach that xtables 'connlabel'
      match uses, so when user inputs
      
          ct label set bar
      
      then we will set the bit used by the 'bar' label and leave the rest alone.
      
      This is done by passing the sreg content to nf_connlabels_replace
      as both value and mask argument.
      Labels (bits) already set thus cannot be re-set to zero, but
      this is not supported by xtables connlabel match either.
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      1ad8f48d
  2. 29 4月, 2016 1 次提交
  3. 25 4月, 2016 16 次提交
  4. 24 4月, 2016 12 次提交
  5. 22 4月, 2016 8 次提交
    • L
      Merge tag 'rtc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux · 5f44abd0
      Linus Torvalds 提交于
      Pull RTC fixes from Alexandre Belloni:
       "A few fixes for the RTC subsystem.  The documentation fix already
        missed 4.5 so I think it is worth taking it now:
      
        A documentation fix for s3c and two fixes for the ds1307"
      
      * tag 'rtc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
        rtc: ds1307: Use irq when available for wakeup-source device
        rtc: ds1307: ds3231 temperature s16 overflow
        rtc: s3c: Document in binding that only s3c6410 needs a src clk
      5f44abd0
    • L
      Merge tag 'pm+acpi-4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · f78fe081
      Linus Torvalds 提交于
      Pull power management fixes from Rafael Wysocki:
       "Two fixes for issues introduced recently, one for an intel_pstate
        driver problem uncovered by the recent switch over from using timers
        and the other one for a potential cpufreq core problem related to
        system suspend/resume.
      
        Specifics:
      
         - Fix an intel_pstate driver problem causing CPUs to get stuck in the
           highest P-state when completely idle uncovered by the recent switch
           over from using timers (Rafael Wysocki).
      
         - Avoid attempts to get the current CPU frequency when all devices
           (like I2C controllers that may be nedded for that purpose) have
           been suspended during system suspend/resume (Rafael Wysocki)"
      
      * tag 'pm+acpi-4.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: Abort cpufreq_update_current_freq() for cpufreq_suspended set
        intel_pstate: Avoid getting stuck in high P-states when idle
      f78fe081
    • N
      rtc: ds1307: Use irq when available for wakeup-source device · 38a7a73e
      Nishanth Menon 提交于
      With commit 8bc2a407 ("rtc: ds1307: add support for the
      DT property 'wakeup-source'") we lost the ability for rtc irq
      functionality for devices that are actually hooked on a real IRQ
      line and have capability to wakeup as well. This is not an expected
      behavior. So, instead of just not requesting IRQ, skip the IRQ
      requirement only if interrupts are not defined for the device.
      
      Fixes: 8bc2a407 ("rtc: ds1307: add support for the DT property 'wakeup-source'")
      Reported-by: NTony Lindgren <tony@atomide.com>
      Cc: Michael Lange <linuxstuff@milaw.biz>
      Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      38a7a73e
    • Z
      rtc: ds1307: ds3231 temperature s16 overflow · 9a3dce62
      Zhuang Yuyao 提交于
      while retrieving temperature from ds3231, the result may be overflow
      since s16 is too small for a multiplication with 250.
      
      ie. if temp_buf[0] == 0x2d, the result (s16 temp) will be negative.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Tested-by: NMichael Tatarinov <kukabu@gmail.com>
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      9a3dce62
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · c5edde3a
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix memory leak in iwlwifi, from Matti Gottlieb.
      
       2) Add missing registration of netfilter arp_tables into initial
          namespace, from Florian Westphal.
      
       3) Fix potential NULL deref in DecNET routing code.
      
       4) Restrict NETLINK_URELEASE to truly bound sockets only, from Dmitry
          Ivanov.
      
       5) Fix dst ref counting in VRF, from David Ahern.
      
       6) Fix TSO segmenting limits in i40e driver, from Alexander Duyck.
      
       7) Fix heap leak in PACKET_DIAG_MCLIST, from Mathias Krause.
      
       8) Ravalidate IPV6 datagram socket cached routes properly, particularly
          with UDP, from Martin KaFai Lau.
      
       9) Fix endian bug in RDS dp_ack_seq handling, from Qing Huang.
      
      10) Fix stats typing in bcmgenet driver, from Eric Dumazet.
      
      11) Openvswitch needs to orphan SKBs before ipv6 fragmentation handing,
          from Joe Stringer.
      
      12) SPI device reference leak in spi_ks8895 PHY driver, from Mark Brown.
      
      13) atl2 doesn't actually support scatter-gather, so don't advertise the
          feature.  From Ben Hucthings.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (72 commits)
        openvswitch: use flow protocol when recalculating ipv6 checksums
        Driver: Vmxnet3: set CHECKSUM_UNNECESSARY for IPv6 packets
        atl2: Disable unimplemented scatter/gather feature
        net/mlx4_en: Split SW RX dropped counter per RX ring
        net/mlx4_core: Don't allow to VF change global pause settings
        net/mlx4_core: Avoid repeated calls to pci enable/disable
        net/mlx4_core: Implement pci_resume callback
        net: phy: spi_ks8895: Don't leak references to SPI devices
        net: ethernet: davinci_emac: Fix platform_data overwrite
        net: ethernet: davinci_emac: Fix Unbalanced pm_runtime_enable
        qede: Fix single MTU sized packet from firmware GRO flow
        qede: Fix setting Skb network header
        qede: Fix various memory allocation error flows for fastpath
        tcp: Merge tx_flags and tskey in tcp_shifted_skb
        tcp: Merge tx_flags and tskey in tcp_collapse_retrans
        drivers: net: cpsw: fix wrong regs access in cpsw_ndo_open
        tcp: Fix SOF_TIMESTAMPING_TX_ACK when handling dup acks
        openvswitch: Orphan skbs before IPv6 defrag
        Revert "Prevent NUll pointer dereference with two PHYs on cpsw"
        VSOCK: Only check error on skb_recv_datagram when skb is NULL
        ...
      c5edde3a
    • D
      Merge branch 'geneve-vxlan-deps' · 22d37b6b
      David S. Miller 提交于
      Hannes Frederic Sowa says:
      
      ====================
      net: network drivers should not depend on geneve/vxlan
      
      This patchset removes the dependency of network drivers on vxlan or
      geneve, so those don't get autoloaded when the nic driver is loaded.
      
      Also audited the code such that vxlan_get_rx_port and geneve_get_rx_port
      are not called without rtnl lock.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22d37b6b
    • H
      geneve: break dependency with netdev drivers · 681e683f
      Hannes Frederic Sowa 提交于
      Equivalent to "vxlan: break dependency with netdev drivers", don't
      autoload geneve module in case the driver is loaded. Instead make the
      coupling weaker by using netdevice notifiers as proxy.
      
      Cc: Jesse Gross <jesse@kernel.org>
      Signed-off-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      681e683f
    • H
      vxlan: break dependency with netdev drivers · b7aade15
      Hannes Frederic Sowa 提交于
      Currently all drivers depend and autoload the vxlan module because how
      vxlan_get_rx_port is linked into them. Remove this dependency:
      
      By using a new event type in the netdevice notifier call chain we proxy
      the request from the drivers to flush and resetup the vxlan ports not
      directly via function call but by the already existing netdevice
      notifier call chain.
      
      I added a separate new event type, NETDEV_OFFLOAD_PUSH_VXLAN, to do so.
      We don't need to save those ids, as the event type field is an unsigned
      long and using specialized event types for this purpose seemed to be a
      more elegant way. This also comes in beneficial if in future we want to
      add offloading knobs for vxlan.
      
      Cc: Jesse Gross <jesse@kernel.org>
      Signed-off-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7aade15