1. 13 Oct, 2013 10 commits
    • Herbert Xu's avatar
      bridge: Clamp forward_delay when enabling STP · 3c5bd142
      Herbert Xu authored
      [ Upstream commit be4f154d ]
      
      At some point limits were added to forward_delay.  However, the
      limits are only enforced when STP is enabled.  This created a
      scenario where you could have a value outside the allowed range
      while STP is disabled, which then stuck around even after STP
      is enabled.
      
      This patch fixes this by clamping the value when we enable STP.
      
      I had to move the locking around a bit to ensure that there is
      no window where someone could insert a value outside the range
      while we're in the middle of enabling STP.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3c5bd142
    • Chris Healy's avatar
      resubmit bridge: fix message_age_timer calculation · 12021622
      Chris Healy authored
      [ Upstream commit 9a062013 ]
      
      This changes the message_age_timer calculation to use the BPDU's max age as
      opposed to the local bridge's max age.  This is in accordance with section
      8.6.2.3.2 Step 2 of the 802.1D-1998 sprecification.
      
      With the current implementation, when running with very large bridge
      diameters, convergance will not always occur even if a root bridge is
      configured to have a longer max age.
      
      Tested successfully on bridge diameters of ~200.
      Signed-off-by: default avatarChris Healy <cphealy@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      12021622
    • Daniel Borkmann's avatar
      net: sctp: fix ipv6 ipsec encryption bug in sctp_v6_xmit · 9dea496e
      Daniel Borkmann authored
      [ Upstream commit 95ee6208 ]
      
      Alan Chester reported an issue with IPv6 on SCTP that IPsec traffic is not
      being encrypted, whereas on IPv4 it is. Setting up an AH + ESP transport
      does not seem to have the desired effect:
      
      SCTP + IPv4:
      
        22:14:20.809645 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto AH (51), length 116)
          192.168.0.2 > 192.168.0.5: AH(spi=0x00000042,sumlen=16,seq=0x1): ESP(spi=0x00000044,seq=0x1), length 72
        22:14:20.813270 IP (tos 0x2,ECT(0), ttl 64, id 0, offset 0, flags [DF], proto AH (51), length 340)
          192.168.0.5 > 192.168.0.2: AH(spi=0x00000043,sumlen=16,seq=0x1):
      
      SCTP + IPv6:
      
        22:31:19.215029 IP6 (class 0x02, hlim 64, next-header SCTP (132) payload length: 364)
          fe80::222:15ff:fe87:7fc.3333 > fe80::92e6:baff:fe0d:5a54.36767: sctp
          1) [INIT ACK] [init tag: 747759530] [rwnd: 62464] [OS: 10] [MIS: 10]
      
      Moreover, Alan says:
      
        This problem was seen with both Racoon and Racoon2. Other people have seen
        this with OpenSwan. When IPsec is configured to encrypt all upper layer
        protocols the SCTP connection does not initialize. After using Wireshark to
        follow packets, this is because the SCTP packet leaves Box A unencrypted and
        Box B believes all upper layer protocols are to be encrypted so it drops
        this packet, causing the SCTP connection to fail to initialize. When IPsec
        is configured to encrypt just SCTP, the SCTP packets are observed unencrypted.
      
      In fact, using `socat sctp6-listen:3333 -` on one end and transferring "plaintext"
      string on the other end, results in cleartext on the wire where SCTP eventually
      does not report any errors, thus in the latter case that Alan reports, the
      non-paranoid user might think he's communicating over an encrypted transport on
      SCTP although he's not (tcpdump ... -X):
      
        ...
        0x0030: 5d70 8e1a 0003 001a 177d eb6c 0000 0000  ]p.......}.l....
        0x0040: 0000 0000 706c 6169 6e74 6578 740a 0000  ....plaintext...
      
      Only in /proc/net/xfrm_stat we can see XfrmInTmplMismatch increasing on the
      receiver side. Initial follow-up analysis from Alan's bug report was done by
      Alexey Dobriyan. Also thanks to Vlad Yasevich for feedback on this.
      
      SCTP has its own implementation of sctp_v6_xmit() not calling inet6_csk_xmit().
      This has the implication that it probably never really got updated along with
      changes in inet6_csk_xmit() and therefore does not seem to invoke xfrm handlers.
      
      SCTP's IPv4 xmit however, properly calls ip_queue_xmit() to do the work. Since
      a call to inet6_csk_xmit() would solve this problem, but result in unecessary
      route lookups, let us just use the cached flowi6 instead that we got through
      sctp_v6_get_dst(). Since all SCTP packets are being sent through sctp_packet_transmit(),
      we do the route lookup / flow caching in sctp_transport_route(), hold it in
      tp->dst and skb_dst_set() right after that. If we would alter fl6->daddr in
      sctp_v6_xmit() to np->opt->srcrt, we possibly could run into the same effect
      of not having xfrm layer pick it up, hence, use fl6_update_dst() in sctp_v6_get_dst()
      instead to get the correct source routed dst entry, which we assign to the skb.
      
      Also source address routing example from 62503411 ("sctp: fix sctp to work with
      ipv6 source address routing") still works with this patch! Nevertheless, in RFC5095
      it is actually 'recommended' to not use that anyway due to traffic amplification [1].
      So it seems we're not supposed to do that anyway in sctp_v6_xmit(). Moreover, if
      we overwrite the flow destination here, the lower IPv6 layer will be unable to
      put the correct destination address into IP header, as routing header is added in
      ipv6_push_nfrag_opts() but then probably with wrong final destination. Things aside,
      result of this patch is that we do not have any XfrmInTmplMismatch increase plus on
      the wire with this patch it now looks like:
      
      SCTP + IPv6:
      
        08:17:47.074080 IP6 2620:52:0:102f:7a2b:cbff:fe27:1b0a > 2620:52:0:102f:213:72ff:fe32:7eba:
          AH(spi=0x00005fb4,seq=0x1): ESP(spi=0x00005fb5,seq=0x1), length 72
        08:17:47.074264 IP6 2620:52:0:102f:213:72ff:fe32:7eba > 2620:52:0:102f:7a2b:cbff:fe27:1b0a:
          AH(spi=0x00003d54,seq=0x1): ESP(spi=0x00003d55,seq=0x1), length 296
      
      This fixes Kernel Bugzilla 24412. This security issue seems to be present since
      2.6.18 kernels. Lets just hope some big passive adversary in the wild didn't have
      its fun with that. lksctp-tools IPv6 regression test suite passes as well with
      this patch.
      
       [1] http://www.secdev.org/conf/IPv6_RH_security-csw07.pdfReported-by: default avatarAlan Chester <alan.chester@tekelec.com>
      Reported-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9dea496e
    • Nikolay Aleksandrov's avatar
      netpoll: fix NULL pointer dereference in netpoll_cleanup · a8e02b78
      Nikolay Aleksandrov authored
      [ Upstream commit d0fe8c88 ]
      
      I've been hitting a NULL ptr deref while using netconsole because the
      np->dev check and the pointer manipulation in netpoll_cleanup are done
      without rtnl and the following sequence happens when having a netconsole
      over a vlan and we remove the vlan while disabling the netconsole:
      	CPU 1					CPU2
      					removes vlan and calls the notifier
      enters store_enabled(), calls
      netdev_cleanup which checks np->dev
      and then waits for rtnl
      					executes the netconsole netdev
      					release notifier making np->dev
      					== NULL and releases rtnl
      continues to dereference a member of
      np->dev which at this point is == NULL
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a8e02b78
    • Eric Dumazet's avatar
      net: flow_dissector: fix thoff for IPPROTO_AH · a4942e99
      Eric Dumazet authored
      [ Upstream commit b8678358 ]
      
      In commit 8ed78166 ("flow_keys: include thoff into flow_keys for
      later usage"), we missed that existing code was using nhoff as a
      temporary variable that could not always contain transport header
      offset.
      
      This is not a problem for TCP/UDP because port offset (@poff)
      is 0 for these protocols.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Daniel Borkmann <dborkman@redhat.com>
      Cc: Nikolay Aleksandrov <nikolay@redhat.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
      Acked-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a4942e99
    • Daniel Borkmann's avatar
      net: sctp: fix smatch warning in sctp_send_asconf_del_ip · 835e0aac
      Daniel Borkmann authored
      [ Upstream commit 88362ad8 ]
      
      This was originally reported in [1] and posted by Neil Horman [2], he said:
      
        Fix up a missed null pointer check in the asconf code. If we don't find
        a local address, but we pass in an address length of more than 1, we may
        dereference a NULL laddr pointer. Currently this can't happen, as the only
        users of the function pass in the value 1 as the addrcnt parameter, but
        its not hot path, and it doesn't hurt to check for NULL should that ever
        be the case.
      
      The callpath from sctp_asconf_mgmt() looks okay. But this could be triggered
      from sctp_setsockopt_bindx() call with SCTP_BINDX_REM_ADDR and addrcnt > 1
      while passing all possible addresses from the bind list to SCTP_BINDX_REM_ADDR
      so that we do *not* find a single address in the association's bind address
      list that is not in the packed array of addresses. If this happens when we
      have an established association with ASCONF-capable peers, then we could get
      a NULL pointer dereference as we only check for laddr == NULL && addrcnt == 1
      and call later sctp_make_asconf_update_ip() with NULL laddr.
      
      BUT: this actually won't happen as sctp_bindx_rem() will catch such a case
      and return with an error earlier. As this is incredably unintuitive and error
      prone, add a check to catch at least future bugs here. As Neil says, its not
      hot path. Introduced by 8a07eb0a ("sctp: Add ASCONF operation on the
      single-homed host").
      
       [1] http://www.spinics.net/lists/linux-sctp/msg02132.html
       [2] http://www.spinics.net/lists/linux-sctp/msg02133.htmlReported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Cc: Michio Honda <micchie@sfc.wide.ad.jp>
      Acked-By: default avatarNeil Horman <nhorman@tuxdriver.com>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      835e0aac
    • Dave Jones's avatar
      caif: Add missing braces to multiline if in cfctrl_linkup_request · 8e307e20
      Dave Jones authored
      [ Upstream commit 0c1db731 ]
      
      The indentation here implies this was meant to be a multi-line if.
      
      Introduced several years back in commit c85c2951
      ("caif: Handle dev_queue_xmit errors.")
      Signed-off-by: default avatarDave Jones <davej@fedoraproject.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e307e20
    • Claudiu Manoil's avatar
      gianfar: Change default HW Tx queue scheduling mode · d45a3625
      Claudiu Manoil authored
      commit b98b8bab upstream.
      
      This is primarily to address transmission timeout occurrences, when
      multiple H/W Tx queues are being used concurrently. Because in
      the priority scheduling mode the controller does not service the
      Tx queues equally (but in ascending index order), Tx timeouts are
      being triggered rightaway for a basic test with multiple simultaneous
      connections like:
      iperf -c <server_ip> -n 100M -P 8
      
      resulting in kernel trace:
      NETDEV WATCHDOG: eth1 (fsl-gianfar): transmit queue <X> timed out
      ------------[ cut here ]------------
      WARNING: at net/sched/sch_generic.c:255
      ...
      and controller reset during intense traffic, and possibly further
      complications.
      
      This patch changes the default H/W Tx scheduling setting (TXSCHED)
      for multi-queue devices, from priority scheduling mode to a weighted
      round robin mode with equal weights for all H/W Tx queues, and
      addresses the issue above.
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d45a3625
    • Dan Carpenter's avatar
      cciss: fix info leak in cciss_ioctl32_passthru() · f845e0c5
      Dan Carpenter authored
      commit 58f09e00 upstream.
      
      The arg64 struct has a hole after ->buf_size which isn't cleared.  Or if
      any of the calls to copy_from_user() fail then that would cause an
      information leak as well.
      
      This was assigned CVE-2013-2147.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarMike Miller <mike.miller@hp.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f845e0c5
    • Dan Carpenter's avatar
      cpqarray: fix info leak in ida_locked_ioctl() · dd7c4461
      Dan Carpenter authored
      commit 627aad1c upstream.
      
      The pciinfo struct has a two byte hole after ->dev_fn so stack
      information could be leaked to the user.
      
      This was assigned CVE-2013-2147.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarMike Miller <mike.miller@hp.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dd7c4461
  2. 05 Oct, 2013 16 commits
  3. 01 Oct, 2013 14 commits