1. 17 9月, 2010 1 次提交
  2. 30 8月, 2010 5 次提交
  3. 28 8月, 2010 1 次提交
    • J
      net/ipv4: Eliminate kstrdup memory leak · c34186ed
      Julia Lawall 提交于
      The string clone is only used as a temporary copy of the argument val
      within the while loop, and so it should be freed before leaving the
      function.  The call to strsep, however, modifies clone, so a pointer to the
      front of the string is kept in saved_clone, to make it possible to free it.
      
      The sematic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E;
      identifier l;
      statement S;
      @@
      
      *x= \(kasprintf\|kstrdup\)(...);
      ...
      if (x == NULL) S
      ... when != kfree(x)
          when != E = x
      if (...) {
        <... when != kfree(x)
      * goto l;
        ...>
      * return ...;
      }
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c34186ed
  4. 27 8月, 2010 3 次提交
  5. 26 8月, 2010 2 次提交
    • K
      tcp: select(writefds) don't hang up when a peer close connection · d84ba638
      KOSAKI Motohiro 提交于
      This issue come from ruby language community. Below test program
      hang up when only run on Linux.
      
      	% uname -mrsv
      	Linux 2.6.26-2-486 #1 Sat Dec 26 08:37:39 UTC 2009 i686
      	% ruby -rsocket -ve '
      	BasicSocket.do_not_reverse_lookup = true
      	serv = TCPServer.open("127.0.0.1", 0)
      	s1 = TCPSocket.open("127.0.0.1", serv.addr[1])
      	s2 = serv.accept
      	s2.close
      	s1.write("a") rescue p $!
      	s1.write("a") rescue p $!
      	Thread.new {
      	  s1.write("a")
      	}.join'
      	ruby 1.9.3dev (2010-07-06 trunk 28554) [i686-linux]
      	#<Errno::EPIPE: Broken pipe>
      	[Hang Here]
      
      FreeBSD, Solaris, Mac doesn't. because Ruby's write() method call
      select() internally. and tcp_poll has a bug.
      
      SUS defined 'ready for writing' of select() as following.
      
      |  A descriptor shall be considered ready for writing when a call to an output
      |  function with O_NONBLOCK clear would not block, whether or not the function
      |  would transfer data successfully.
      
      That said, EPIPE situation is clearly one of 'ready for writing'.
      
      We don't have read-side issue because tcp_poll() already has read side
      shutdown care.
      
      |        if (sk->sk_shutdown & RCV_SHUTDOWN)
      |                mask |= POLLIN | POLLRDNORM | POLLRDHUP;
      
      So, Let's insert same logic in write side.
      
      - reference url
        http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/31065
        http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/31068Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d84ba638
    • E
      tcp: fix three tcp sysctls tuning · c5ed63d6
      Eric Dumazet 提交于
      As discovered by Anton Blanchard, current code to autotune 
      tcp_death_row.sysctl_max_tw_buckets, sysctl_tcp_max_orphans and
      sysctl_max_syn_backlog makes little sense.
      
      The bigger a page is, the less tcp_max_orphans is : 4096 on a 512GB
      machine in Anton's case.
      
      (tcp_hashinfo.bhash_size * sizeof(struct inet_bind_hashbucket))
      is much bigger if spinlock debugging is on. Its wrong to select bigger
      limits in this case (where kernel structures are also bigger)
      
      bhash_size max is 65536, and we get this value even for small machines. 
      
      A better ground is to use size of ehash table, this also makes code
      shorter and more obvious.
      
      Based on a patch from Anton, and another from David.
      Reported-and-tested-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5ed63d6
  6. 25 8月, 2010 1 次提交
  7. 24 8月, 2010 2 次提交
  8. 19 8月, 2010 4 次提交
  9. 18 8月, 2010 4 次提交
  10. 16 8月, 2010 1 次提交
  11. 15 8月, 2010 2 次提交
  12. 13 8月, 2010 1 次提交
  13. 12 8月, 2010 5 次提交
    • R
      phylib: available for any speed ethernet · cba86f2e
      Randy Dunlap 提交于
      Several gigabit network drivers (SB1250_MAC, TIGON3, FSL, GIANFAR,
      UCC_GETH, MV643XX_ETH, XILINX_LL_TEMAC, S6GMAC, STMMAC_ETH, PASEMI_MAC,
      and OCTEON_ETHERNET) select PHYLIB.  These drivers are not under
      NET_ETHERNET (10/100 mbit), so this warning is generated (long, irrelevant
      parts are omitted):
      
      warning: (NET_DSA && NET && EXPERIMENTAL && NET_ETHERNET && !S390 || ... || SB1250_MAC && NETDEVICES && NETDEV_1000 && SIBYTE_SB1xxx_SOC || TIGON3 && NETDEVICES && NETDEV_1000 && PCI || FSL_PQ_MDIO && NETDEVICES && NETDEV_1000 && FSL_SOC || GIANFAR && NETDEVICES && NETDEV_1000 && FSL_SOC || UCC_GETH && NETDEVICES && NETDEV_1000 && QUICC_ENGINE || MV643XX_ETH && NETDEVICES && NETDEV_1000 && (MV64X60 || PPC32 || PLAT_ORION) || XILINX_LL_TEMAC && NETDEVICES && NETDEV_1000 && (PPC || MICROBLAZE) || S6GMAC && NETDEVICES && NETDEV_1000 && XTENSA_VARIANT_S6000 || STMMAC_ETH && NETDEV_1000 && NETDEVICES && CPU_SUBTYPE_ST40 || PASEMI_MAC && NETDEVICES && NETDEV_10000 && PPC_PASEMI && PCI || OCTEON_ETHERNET && STAGING && !STAGING_EXCLUDE_BUILD && CPU_CAVIUM_OCTEON) selects PHYLIB which has unmet direct dependencies (!S390 && NET_ETHERNET)
      
      PHYLIB is used by non-10/100 mbit ethernet drivers, so change the dependencies
      to be NETDEVICES instead of NET_ETHERNET.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cba86f2e
    • O
      can: add limit for nframes and clean up signed/unsigned variables · 5b75c497
      Oliver Hartkopp 提交于
      This patch adds a limit for nframes as the number of frames in TX_SETUP and
      RX_SETUP are derived from a single byte multiplex value by default.
      Use-cases that would require to send/filter more than 256 CAN frames should
      be implemented in userspace for complexity reasons anyway.
      
      Additionally the assignments of unsigned values from userspace to signed
      values in kernelspace and vice versa are fixed by using unsigned values in
      kernelspace consistently.
      Signed-off-by: NOliver Hartkopp <socketcan@hartkopp.net>
      Reported-by: NBen Hawkes <hawkes@google.com>
      Acked-by: NUrs Thuermann <urs.thuermann@volkswagen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5b75c497
    • W
      DNS: If the DNS server returns an error, allow that to be cached [ver #2] · 4a2d7892
      Wang Lei 提交于
      If the DNS server returns an error, allow that to be cached in the DNS resolver
      key in lieu of a value.  Userspace passes the desired error number as an option
      in the payload:
      
      	"#dnserror=<number>"
      
      Userspace must map h_errno from the name resolution routines to an appropriate
      Linux error before passing it up.  Something like the following mapping is
      recommended:
      
      	[HOST_NOT_FOUND]	= ENODATA,
      	[TRY_AGAIN]		= EAGAIN,
      	[NO_RECOVERY]		= ECONNREFUSED,
      	[NO_DATA]		= ENODATA,
      
      in lieu of Linux errors specifically for representing name service errors.  The
      filesystem must map these errors appropropriately before passing them to
      userspace.  AFS is made to map ENODATA and EAGAIN to EDESTADDRREQ for the
      return to userspace; ECONNREFUSED is allowed to stand as is.
      
      The error can be seen in /proc/keys as a negative number after the description
      of the key.  Compare, for example, the following key entries:
      
      2f97238c I--Q--     1  53s 3f010000     0     0 dns_resol afsdb:grand.centrall.org: -61
      338bfbbe I--Q--     1  59m 3f010000     0     0 dns_resol afsdb:grand.central.org: 37
      
      If the error option is supplied in the payload, the main part of the payload is
      discarded.  The key should have an expiry time set by userspace.
      Signed-off-by: NWang Lei <wang840925@gmail.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      4a2d7892
    • T
      rpcrdma: Fix SQ size calculation when memreg is FRMR · 15cdc644
      Tom Tucker 提交于
      This patch updates the computation to include the worst case situation
      where three FRMR are required to map a single RPC REQ.
      Signed-off-by: NTom Tucker <tom@ogc.us>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      15cdc644
    • S
      xprtrdma: Do not truncate iova_start values in frmr registrations. · 7a8b80eb
      Steve Wise 提交于
      A bad cast causes the iova_start, which in this case is a 64b DMA
      bus address, to be truncated on 32b systems.  This breaks frmrs on
      32b systems.  No cast is needed.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      7a8b80eb
  14. 11 8月, 2010 6 次提交
  15. 10 8月, 2010 2 次提交