1. 08 May, 2008 6 commits
    • Pavel Emelyanov's avatar
      netns: Fix arbitrary net_device-s corruptions on net_ns stop. · aca51397
      Pavel Emelyanov authored
      When a net namespace is destroyed, some devices (those, not killed
      on ns stop explicitly) are moved back to init_net.
      
      The problem, is that this net_ns change has one point of failure -
      the __dev_alloc_name() may be called if a name collision occurs (and
      this is easy to trigger). This allocator performs a likely-to-fail
      GFP_ATOMIC allocation to find a suitable number. Other possible 
      conditions that may cause error (for device being ns local or not
      registered) are always false in this case.
      
      So, when this call fails, the device is unregistered. But this is
      *not* the right thing to do, since after this the device may be
      released (and kfree-ed) improperly. E. g. bridges require more
      actions (sysfs update, timer disarming, etc.), some other devices 
      want to remove their private areas from lists, etc.
      
      I. e. arbitrary use-after-free cases may occur.
      
      The proposed fix is the following: since the only reason for the
      dev_change_net_namespace to fail is the name generation, we may
      give it a unique fall-back name w/o %d-s in it - the dev<ifindex>
      one, since ifindexes are still unique.
      
      So make this change, raise the failure-case printk loglevel to 
      EMERG and replace the unregister_netdevice call with BUG().
      
      [ Use snprintf() -DaveM ]
      Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aca51397
    • Patrick McHardy's avatar
      netfilter: Kconfig: default DCCP/SCTP conntrack support to the protocol config values · f3261aff
      Patrick McHardy authored
      When conntrack and DCCP/SCTP protocols are enabled, chances are good
      that people also want DCCP/SCTP conntrack and NAT support.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f3261aff
    • Patrick McHardy's avatar
      netfilter: nf_conntrack_sip: restrict RTP expect flushing on error to last request · ef75d49f
      Patrick McHardy authored
      Some Inovaphone PBXs exhibit very stange behaviour: when dialing for
      example "123", the device sends INVITE requests for "1", "12" and
      "123" back to back.  The first requests will elicit error responses
      from the receiver, causing the SIP helper to flush the RTP
      expectations even though we might still see a positive response.
      
      Note the sequence number of the last INVITE request that contained a
      media description and only flush the expectations when receiving a
      negative response for that sequence number.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef75d49f
    • Patrick McHardy's avatar
      macvlan: Fix memleak on device removal/crash on module removal · 73120964
      Patrick McHardy authored
      As noticed by Ben Greear, macvlan crashes the kernel when unloading the
      module. The reason is that it tries to clean up the macvlan_port pointer
      on the macvlan device itself instead of the underlying device. A non-NULL
      pointer is taken as indication that the macvlan_handle_frame_hook is
      valid, when receiving the next packet on the underlying device it tries
      to call the NULL hook and crashes.
      
      Clean up the macvlan_port on the correct device to fix this.
      
      Signed-off-by; Patrick McHardy <kaber@trash.net>
      Tested-by: default avatarBen Greear <greearb@candelatech.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73120964
    • J.H.M. Dassen (Ray)'s avatar
      net/ipv4: correct RFC 1122 section reference in comment · c67fa027
      J.H.M. Dassen (Ray) authored
      RFC 1122 does not have a section 3.1.2.2. The requirement to silently
      discard datagrams with a bad checksum is in section 3.2.1.2 instead.
      
      Addresses http://bugzilla.kernel.org/show_bug.cgi?id=10611Signed-off-by: default avatarJ.H.M. Dassen (Ray) <jdassen@debian.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c67fa027
    • Ilpo Järvinen's avatar
      tcp FRTO: SACK variant is errorneously used with NewReno · 62ab2227
      Ilpo Järvinen authored
      Note: there's actually another bug in FRTO's SACK variant, which
      is the causing failure in NewReno case because of the error
      that's fixed here. I'll fix the SACK case separately (it's
      a separate bug really, though related, but in order to fix that
      I need to audit tp->snd_nxt usage a bit).
      
      There were two places where SACK variant of FRTO is getting
      incorrectly used even if SACK wasn't negotiated by the TCP flow.
      This leads to incorrect setting of frto_highmark with NewReno
      if a previous recovery was interrupted by another RTO.
      
      An eventual fallback to conventional recovery then incorrectly
      considers one or couple of segments as forward transmissions
      though they weren't, which then are not LOST marked during
      fallback making them "non-retransmittable" until the next RTO.
      In a bad case, those segments are really lost and are the only
      one left in the window. Thus TCP needs another RTO to continue.
      The next FRTO, however, could again repeat the same events
      making the progress of the TCP flow extremely slow.
      
      In order for these events to occur at all, FRTO must occur
      again in FRTOs step 3 while the key segments must be lost as
      well, which is not too likely in practice. It seems to most
      frequently with some small devices such as network printers
      that *seem* to accept TCP segments only in-order. In cases
      were key segments weren't lost, things get automatically
      resolved because those wrongly marked segments don't need to be
      retransmitted in order to continue.
      
      I found a reproducer after digging up relevant reports (few
      reports in total, none at netdev or lkml I know of), some
      cases seemed to indicate middlebox issues which seems now
      to be a false assumption some people had made. Bugzilla
      #10063 _might_ be related. Damon L. Chesser <damon@damtek.com>
      had a reproducable case and was kind enough to tcpdump it
      for me. With the tcpdump log it was quite trivial to figure
      out.
      Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      62ab2227
  2. 06 May, 2008 3 commits
  3. 05 May, 2008 11 commits
  4. 04 May, 2008 5 commits
    • David S. Miller's avatar
      niu: Fix probing regression for maramba on-board chips. · be0c007a
      David S. Miller authored
      Changeset 7f7c4072 ("niu: Determine
      the # of ports from the card's VPD data") caused maramba on-board
      NIU ports to stop probing properly.
      
      The old code had a fallback that would use a num_ports value of
      4 if all the probing methods failed, but that was removed.
      
      This restores the fallback of 4 ports, to get things working
      again.
      
      Bump driver version and release date.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be0c007a
    • David S. Miller's avatar
      lapbeth: Release ->ethdev when unregistering device. · e544ff00
      David S. Miller authored
      Otherwise it leaks forever.
      
      Based upon a report by Roland <devzero@web.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e544ff00
    • Marcin Slusarz's avatar
      xfrm: convert empty xfrm_audit_* macros to functions · 41fef0ee
      Marcin Slusarz authored
      it removes these warnings when CONFIG_AUDITSYSCALL is unset:
      
      net/xfrm/xfrm_user.c: In function 'xfrm_add_sa':
      net/xfrm/xfrm_user.c:412: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:411: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:410: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_del_sa':
      net/xfrm/xfrm_user.c:485: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:484: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:483: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_add_policy':
      net/xfrm/xfrm_user.c:1132: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:1131: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:1130: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_get_policy':
      net/xfrm/xfrm_user.c:1382: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:1381: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:1380: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_add_pol_expire':
      net/xfrm/xfrm_user.c:1620: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:1619: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:1618: warning: unused variable 'loginuid'
      net/xfrm/xfrm_user.c: In function 'xfrm_add_sa_expire':
      net/xfrm/xfrm_user.c:1658: warning: unused variable 'sid'
      net/xfrm/xfrm_user.c:1657: warning: unused variable 'sessionid'
      net/xfrm/xfrm_user.c:1656: warning: unused variable 'loginuid'
      Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41fef0ee
    • Johannes Berg's avatar
      net: Fix useless comment reference loop. · c8005785
      Johannes Berg authored
      include/linux/skbuff.h says:
              /* These elements must be at the end, see alloc_skb() for details.  */
      
      net/core/skbuff.c says:
      	* See comment in sk_buff definition, just before the 'tail' member
      
      This patch contains my guess as to the actual reason rather than a
      dead comment reference loop.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c8005785
    • Jarek Poplawski's avatar
      sch_htb: remove from event queue in htb_parent_to_leaf() · 3ba08b00
      Jarek Poplawski authored
      There is lack of removing a class from the event queue while changing
      from parent to leaf which can cause corruption of this rb tree. This
      patch fixes a bug introduced by my patch: "sch_htb: turn intermediate
      classes into leaves" commit: 160d5e10.
      
      Many thanks to Jan 'yanek' Bortl for finding a way to reproduce this
      rare bug and narrowing the test case, which made possible proper
      diagnosing.
      
      This patch is recommended for all kernels starting from 2.6.20.
      Reported-and-tested-by: default avatarJan 'yanek' Bortl <yanek@ya.bofh.cz>
      Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ba08b00
  5. 03 May, 2008 3 commits
    • Bernard Pidoux's avatar
      rose: Wrong list_lock argument in rose_node seqops · f37f2c62
      Bernard Pidoux authored
      In rose_node_start() as well as in rose_node_stop() __acquires() and
      spin_lock_bh() were wrongly passing rose_neigh_list_lock instead of
      rose_node_list_lock arguments.
      Signed-off-by: default avatarBernard Pidoux <f6bvp@amsat.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f37f2c62
    • Daniel Lezcano's avatar
      netns: Fix reassembly timer to use the right namespace · 4ac2ccd0
      Daniel Lezcano authored
      This trivial fix retrieves the network namespace from frag queue
      and use it to get the network device in the right namespace.
      Signed-off-by: default avatarDaniel Lezcano <dlezcano@fr.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ac2ccd0
    • Daniel Lezcano's avatar
      netns: Fix device renaming for sysfs · aaf8cdc3
      Daniel Lezcano authored
      When a netdev is moved across namespaces with the
      'dev_change_net_namespace' function, the 'device_rename' function is
      used to fixup kobject and refresh the sysfs tree. The device_rename
      function will call kobject_rename and this one will check if there is
      an object with the same name and this is the case because we are
      renaming the object with the same name.
      
      The use of 'device_rename' seems for me wrong because we usually don't
      rename it but just move it across namespaces. As we just want to do a
      mini "netdev_[un]register", IMO the functions
      'netdev_[un]register_kobject' should be used instead, like an usual
      network device [un]registering.
      
      This patch replace device_rename by netdev_unregister_kobject,
      followed by netdev_register_kobject.
      
      The netdev_register_kobject will call device_initialize and will raise
      a warning indicating the device was already initialized. In order to
      fix that, I split the device initialization into a separate function
      and use it together with 'netdev_register_kobject' into
      register_netdevice. So we can safely call 'netdev_register_kobject' in
      'dev_change_net_namespace'.
      
      This fix will allow to properly use the sysfs per namespace which is
      coming from -mm tree.
      Signed-off-by: default avatarDaniel Lezcano <dlezcano@fr.ibm.com>
      Acked-by: default avatarBenjamin Thery <benjamin.thery@bull.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aaf8cdc3
  6. 02 May, 2008 12 commits