1. 25 Aug, 2007 11 commits
    • Mark Fortescue's avatar
      [PATCH] Fix sparc32 udelay() rounding errors. · 92420871
      Mark Fortescue authored
      [SPARC32]: Fix rounding errors in ndelay/udelay implementation.
      
      __ndelay and __udelay have not been delayung >= specified time.
      The problem with __ndelay has been tacked down to the rounding of the
      multiplier constant. By changing this, delays > app 18us are correctly
      calculated.
      The problem with __udelay has also been tracked down to rounding issues.
      Changing the multiplier constant (to match that used in sparc64) corrects
      for large delays and adding in a rounding constant corrects for trunctaion
      errors in the claculations.
      Many short delays will return without looping. This is not an error as there
      is the fixed delay of doing all the maths to calculate the loop count.
      Signed-off-by: default avatarMark Fortescue <mark@mtfhpc.demon.co.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      92420871
    • Alexander Shmelev's avatar
      [PATCH] Fix sparc32 memset() · 461da1de
      Alexander Shmelev authored
      [SPARC32]: Fix bug in sparc optimized memset.
      
      Sparc optimized memset (arch/sparc/lib/memset.S) does not fill last
      byte of the memory area, if area size is less than 8 bytes and start
      address is not word (4-bytes) aligned.
      
      Here is code chunk where bug located:
      /* %o0 - memory address, %o1 - size, %g3 - value */
      8:
           add    %o0, 1, %o0
          subcc    %o1, 1, %o1
          bne,a    8b
           stb %g3, [%o0 - 1]
      
      This code should write byte every loop iteration, but last time delay
      instruction stb is not executed because branch instruction sets
      "annul" bit.
      
      Patch replaces bne,a by bne instruction.
      
      Error can be reproduced by simple kernel module:
      
      --------------------
      #include <linux/module.h>
      #include <linux/config.h>
      #include <linux/kernel.h>
      #include <linux/errno.h>
      #include <string.h>
      
      static void do_memset(void **p, int size)
      {
              memset(p, 0x00, size);
      }
      
      static int __init memset_test_init(void)
      {
          char fooc[8];
          int *fooi;
          memset(fooc, 0xba, sizeof(fooc));
      
          do_memset((void**)(fooc + 3), 1);
      
          fooi = (int*) fooc;
          printk("%08X %08X\n", fooi[0], fooi[1]);
      
          return -1;
      }
      
      static void __exit memset_test_cleanup(void)
      {
          return;
      }
      
      module_init(memset_test_init);
      module_exit(memset_test_cleanup);
      
      MODULE_LICENSE("GPL");
      EXPORT_NO_SYMBOLS;
      ------------------------
      Signed-off-by: default avatarAlexander Shmelev <ashmelev@task.sun.mcst.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      461da1de
    • David S. Miller's avatar
      [PATCH] Sparc64 bootup assembler bug · 8dd61f5b
      David S. Miller authored
      [SPARC64]: Fix two year old bug in early bootup asm.
      
      We try to fetch the CIF entry pointer from %o4, but that
      can get clobbered by the early OBP calls.  It is saved
      in %l7 already, so actually this "mov %o4, %l7" can just
      be completely removed with no other changes.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      8dd61f5b
    • Satyam Sharma's avatar
      [PATCH] Netpoll leak · 1801acf8
      Satyam Sharma authored
      [NETPOLL]: Fix a leak-n-bug in netpoll_cleanup()
      
      93ec2c72 applied excessive duct tape to
      the netpoll beast's netpoll_cleanup(), thus substituting one leak with
      another, and opening up a little buglet :-)
      
      net_device->npinfo (netpoll_info) is a shared and refcounted object and
      cannot simply be set NULL the first time netpoll_cleanup() is called.
      Otherwise, further netpoll_cleanup()'s see np->dev->npinfo == NULL and
      become no-ops, thus leaking. And it's a bug too: the first call to
      netpoll_cleanup() would thus (annoyingly) "disable" other (still alive)
      netpolls too. Maybe nobody noticed this because netconsole (only user
      of netpoll) never supported multiple netpoll objects earlier.
      
      This is a trivial and obvious one-line fixlet.
      Signed-off-by: default avatarSatyam Sharma <ssatyam@cse.iitk.ac.in>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      1801acf8
    • Vlad Yasevich's avatar
      [PATCH] Fix ipv6 link down handling. · 676834f0
      Vlad Yasevich authored
      [IPV6]: Call inet6addr_chain notifiers on link down
      
      Currently if the link is brought down via ip link or ifconfig down,
      the inet6addr_chain notifiers are not called even though all
      the addresses are removed from the interface.  This caused SCTP
      to add duplicate addresses to it's list.
      Signed-off-by: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      676834f0
    • Dmitry Butskoy's avatar
      [PATCH] Fix error queue socket lookup in ipv6 · 66d45a1f
      Dmitry Butskoy authored
      [IPV6]: MSG_ERRQUEUE messages do not pass to connected raw sockets
      
      From: Dmitry Butskoy <dmitry@butskoy.name>
      
      Taken from http://bugzilla.kernel.org/show_bug.cgi?id=8747
      
      Problem Description:
      
      It is related to the possibility to obtain MSG_ERRQUEUE messages from the udp
      and raw sockets, both connected and unconnected.
      
      There is a little typo in net/ipv6/icmp.c code, which prevents such messages
      to be delivered to the errqueue of the correspond raw socket, when the socket
      is CONNECTED.  The typo is due to swap of local/remote addresses.
      
      Consider __raw_v6_lookup() function from net/ipv6/raw.c. When a raw socket is
      looked up usual way, it is something like:
      
      sk = __raw_v6_lookup(sk, nexthdr, daddr, saddr, IP6CB(skb)->iif);
      
      where "daddr" is a destination address of the incoming packet (IOW our local
      address), "saddr" is a source address of the incoming packet (the remote end).
      
      But when the raw socket is looked up for some icmp error report, in
      net/ipv6/icmp.c:icmpv6_notify() , daddr/saddr are obtained from the echoed
      fragment of the "bad" packet, i.e.  "daddr" is the original destination
      address of that packet, "saddr" is our local address.  Hence, for
      icmpv6_notify() must use "saddr, daddr" in its arguments, not "daddr, saddr"
      ...
      
      Steps to reproduce:
      
      Create some raw socket, connect it to an address, and cause some error
      situation: f.e. set ttl=1 where the remote address is more than 1 hop to reach.
      Set IPV6_RECVERR .
      Then send something and wait for the error (f.e. poll() with POLLERR|POLLIN).
      You should receive "time exceeded" icmp message (because of "ttl=1"), but the
      socket do not receive it.
      
      If you do not connect your raw socket, you will receive MSG_ERRQUEUE
      successfully.  (The reason is that for unconnected socket there are no actual
      checks for local/remote addresses).
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      66d45a1f
    • Ranko Zivojnovic's avatar
      [PATCH] gen estimator deadlock fix · 66f2a2e3
      Ranko Zivojnovic authored
      [NET]: gen_estimator deadlock fix
      
      -Fixes ABBA deadlock noted by Patrick McHardy <kaber@trash.net>:
      
      > There is at least one ABBA deadlock, est_timer() does:
      > read_lock(&est_lock)
      > spin_lock(e->stats_lock) (which is dev->queue_lock)
      >
      > and qdisc_destroy calls htb_destroy under dev->queue_lock, which
      > calls htb_destroy_class, then gen_kill_estimator and this
      > write_locks est_lock.
      
      To fix the ABBA deadlock the rate estimators are now kept on an rcu list.
      
      -The est_lock changes the use from protecting the list to protecting
      the update to the 'bstat' pointer in order to avoid NULL dereferencing.
      
      -The 'interval' member of the gen_estimator structure removed as it is
      not needed.
      Signed-off-by: default avatarRanko Zivojnovic <ranko@spidernet.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      66f2a2e3
    • Patrick McHardy's avatar
      [PATCH] gen estimator timer unload race · 6bfc898d
      Patrick McHardy authored
      [NET]: Fix gen_estimator timer removal race
      
      As noticed by Jarek Poplawski <jarkao2@o2.pl>, the timer removal in
      gen_kill_estimator races with the timer function rearming the timer.
      
      Check whether the timer list is empty before rearming the timer
      in the timer function to fix this.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Acked-by: default avatarJarek Poplawski <jarkao2@o2.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      6bfc898d
    • Vlad Yasevich's avatar
      [PATCH] SCTP scope_id handling fix · 844aa775
      Vlad Yasevich authored
      SCTP: Add scope_id validation for link-local binds
      
      SCTP currently permits users to bind to link-local addresses,
      but doesn't verify that the scope id specified at bind matches
      the interface that the address is configured on.  It was report
      that this can hang a system.
      Signed-off-by: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      844aa775
    • Adrian Bunk's avatar
      [PATCH] Missing header include in ipt_iprange.h · 16978e1a
      Adrian Bunk authored
      [NETFILTER]: ipt_iprange.h must #include <linux/types.h>
      
      ipt_iprange.h must #include <linux/types.h> since it uses __be32.
      
      This patch fixes kernel Bugzilla #7604.
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      16978e1a
    • Patrick McHardy's avatar
      [PATCH] Fix IPCOMP crashes. · e7ddaa5d
      Patrick McHardy authored
      [XFRM]: Fix crash introduced by struct dst_entry reordering
      
      XFRM expects xfrm_dst->u.next to be same pointer as dst->next, which
      was broken by the dst_entry reordering in commit 1e19e02c~, causing
      an oops in xfrm_bundle_ok when walking the bundle upwards.
      
      Kill xfrm_dst->u.next and change the only user to use dst->next instead.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
      e7ddaa5d
  2. 15 Aug, 2007 28 commits
  3. 07 Jul, 2007 1 commit