1. 12 Nov, 2010 7 commits
    • Joakim Tjernlund's avatar
      ucc_geth: Fix deadlock · 75e60474
      Joakim Tjernlund authored
      This script:
       while [ 1==1 ] ; do ifconfig eth0 up; usleep 1950000 ;ifconfig eth0 down; dmesg -c ;done
      causes in just a second or two:
      INFO: task ifconfig:572 blocked for more than 120 seconds.
      "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      ifconfig      D 0ff65760     0   572    369 0x00000000
      Call Trace:
      [c6157be0] [c6008460] 0xc6008460 (unreliable)
      [c6157ca0] [c0008608] __switch_to+0x4c/0x6c
      [c6157cb0] [c028fecc] schedule+0x184/0x310
      [c6157ce0] [c0290e54] __mutex_lock_slowpath+0xa4/0x150
      [c6157d20] [c0290c48] mutex_lock+0x44/0x48
      [c6157d30] [c01aba74] phy_stop+0x20/0x70
      [c6157d40] [c01aef40] ucc_geth_stop+0x30/0x98
      [c6157d60] [c01b18fc] ucc_geth_close+0x9c/0xdc
      [c6157d80] [c01db0cc] __dev_close+0xa0/0xd0
      [c6157d90] [c01deddc] __dev_change_flags+0x8c/0x148
      [c6157db0] [c01def54] dev_change_flags+0x1c/0x64
      [c6157dd0] [c0237ac8] devinet_ioctl+0x678/0x784
      [c6157e50] [c0239a58] inet_ioctl+0xb0/0xbc
      [c6157e60] [c01cafa8] sock_ioctl+0x174/0x2a0
      [c6157e80] [c009a16c] vfs_ioctl+0xcc/0xe0
      [c6157ea0] [c009a998] do_vfs_ioctl+0xc4/0x79c
      [c6157f10] [c009b0b0] sys_ioctl+0x40/0x74
      [c6157f40] [c00117c4] ret_from_syscall+0x0/0x38
      
      The reason appears to be ucc_geth_stop meets adjust_link as the
      PHY reports PHY changes. I belive adjust_link hangs somewhere,
      holding the PHY lock, because ucc_geth_stop disabled the
      controller HW.
      Fix is to stop the PHY before disabling the controller.
      Signed-off-by: default avatarJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
      Reviewed-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      75e60474
    • Joakim Tjernlund's avatar
      ucc_geth: Do not bring the whole IF down when TX failure. · 2040bd57
      Joakim Tjernlund authored
      ucc_geth_close lacks a cancel_work_sync(&ugeth->timeout_work)
      to stop any outstanding processing of TX fail. However, one
      can not call cancel_work_sync without fixing the timeout function
      otherwise it will deadlock. This patch brings ucc_geth in line with
      gianfar:
      
      Don't bring the interface down and up, just reinit controller HW
      and PHY.
      Signed-off-by: default avatarJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
      Reviewed-by: default avatarAnton Vorontsov <cbouatmailru@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2040bd57
    • Mariusz Kozlowski's avatar
      net: Fix header size check for GSO case in recvmsg (af_packet) · 1f18b717
      Mariusz Kozlowski authored
      Parameter 'len' is size_t type so it will never get negative.
      Signed-off-by: default avatarMariusz Kozlowski <mk@lab.zgora.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f18b717
    • David S. Miller's avatar
    • Thomas Graf's avatar
      rtnetlink: Fix message size calculation for link messages · 369cf77a
      Thomas Graf authored
      nlmsg_total_size() calculates the length of a netlink message
      including header and alignment. nla_total_size() calculates the
      space an individual attribute consumes which was meant to be used
      in this context.
      
      Also, ensure to account for the attribute header for the
      IFLA_INFO_XSTATS attribute as implementations of get_xstats_size()
      seem to assume that we do so.
      
      The addition of two message headers minus the missing attribute
      header resulted in a calculated message size that was larger than
      required. Therefore we never risked running out of skb tailroom.
      Signed-off-by: default avatarThomas Graf <tgraf@infradead.org>
      Acked-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      369cf77a
    • Shan Wei's avatar
      netfilter: ipv6: fix overlap check for fragments · 22e091e5
      Shan Wei authored
      The type of FRAG6_CB(prev)->offset is int, skb->len is *unsigned* int,
      and offset is int.
      
      Without this patch, type conversion occurred to this expression, when
      (FRAG6_CB(prev)->offset + prev->len) is less than offset.
      Signed-off-by: default avatarShan Wei <shanwei@cn.fujitsu.com>
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      22e091e5
    • Eric Paris's avatar
      netfilter: NF_HOOK_COND has wrong conditional · ac5aa2e3
      Eric Paris authored
      The NF_HOOK_COND returns 0 when it shouldn't due to what I believe to be an
      error in the code as the order of operations is not what was intended.  C will
      evalutate == before =.  Which means ret is getting set to the bool result,
      rather than the return value of the function call.  The code says
      
      if (ret = function() == 1)
      when it meant to say:
      if ((ret = function()) == 1)
      
      Normally the compiler would warn, but it doesn't notice it because its
      a actually complex conditional and so the wrong code is wrapped in an explict
      set of () [exactly what the compiler wants you to do if this was intentional].
      Fixing this means that errors when netfilter denies a packet get propagated
      back up the stack rather than lost.
      
      Problem introduced by commit 2249065f (netfilter: get rid of the grossness
      in netfilter.h).
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      ac5aa2e3
  2. 11 Nov, 2010 2 commits
  3. 10 Nov, 2010 4 commits
  4. 09 Nov, 2010 13 commits
  5. 08 Nov, 2010 14 commits