Author: lcapitulino
Date: Thu Feb 15 16:45:00 2007
New Revision: 121426
Added:
packages/updates/2006.0/kernel-2.6/current/PATCHES/patches/CAAC_net_fix_negative_timeouts.patch
Modified:
packages/updates/2006.0/kernel-2.6/current/SPECS/kernel-2.6.spec
Log:
NET: Make sure l_linger is unsigned to avoid negative timeouts
Added:
packages/updates/2006.0/kernel-2.6/current/PATCHES/patches/CAAC_net_fix_negative_timeouts.patch
==============================================================================
--- (empty file)
+++
packages/updates/2006.0/kernel-2.6/current/PATCHES/patches/CAAC_net_fix_negative_timeouts.patch
Thu Feb 15 16:45:00 2007
@@ -0,0 +1,58 @@
+From: Eric Dumazet <[EMAIL PROTECTED]>
+Date: Tue, 6 Sep 2005 21:51:39 +0000 (-0700)
+Subject: [NET]: Make sure l_linger is unsigned to avoid negative timeouts
+X-Git-Tag: v2.6.14^0~1037^2~15
+X-Git-Url:
http://www.kernel.org/git/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=9261c9b042547d01eeb206cf0e21ce72832245ec
+
+[NET]: Make sure l_linger is unsigned to avoid negative timeouts
+
+One of my x86_64 (linux 2.6.13) server log is filled with :
+
+schedule_timeout: wrong timeout value ffffffffffffff06 from ffffffff802e63ca
+schedule_timeout: wrong timeout value ffffffffffffff06 from ffffffff802e63ca
+schedule_timeout: wrong timeout value ffffffffffffff06 from ffffffff802e63ca
+schedule_timeout: wrong timeout value ffffffffffffff06 from ffffffff802e63ca
+schedule_timeout: wrong timeout value ffffffffffffff06 from ffffffff802e63ca
+
+This is because some application does a
+
+struct linger li;
+li.l_onoff = 1;
+li.l_linger = -1;
+setsockopt(sock, SOL_SOCKET, SO_LINGER, &li, sizeof(li));
+
+And unfortunatly l_linger is defined as a 'signed int' in
+include/linux/socket.h:
+
+struct linger {
+ int l_onoff; /* Linger active */
+ int l_linger; /* How long to linger for */
+};
+
+I dont know if it's safe to change l_linger to 'unsigned int' in the
+include file (It might be defined as int in ABI specs)
+
+Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
+Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
+---
+
+---
+ net/core/sock.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- linux-2.6.12.orig/net/core/sock.c
++++ linux-2.6.12/net/core/sock.c
+@@ -325,11 +325,11 @@ int sock_setsockopt(struct socket *sock,
+ sock_reset_flag(sk, SOCK_LINGER);
+ else {
+ #if (BITS_PER_LONG == 32)
+- if (ling.l_linger >= MAX_SCHEDULE_TIMEOUT/HZ)
++ if ((unsigned int)ling.l_linger >=
MAX_SCHEDULE_TIMEOUT/HZ)
+ sk->sk_lingertime =
MAX_SCHEDULE_TIMEOUT;
+ else
+ #endif
+- sk->sk_lingertime = ling.l_linger * HZ;
++ sk->sk_lingertime = (unsigned
int)ling.l_linger * HZ;
+ sock_set_flag(sk, SOCK_LINGER);
+ }
+ break;
Modified: packages/updates/2006.0/kernel-2.6/current/SPECS/kernel-2.6.spec
==============================================================================
--- packages/updates/2006.0/kernel-2.6/current/SPECS/kernel-2.6.spec
(original)
+++ packages/updates/2006.0/kernel-2.6/current/SPECS/kernel-2.6.spec Thu Feb
15 16:45:00 2007
@@ -5,9 +5,9 @@
# if you try to understand kernel numbering, read docs/kernel_naming
%define sublevel 12
-%define mdkrelease 30
+%define mdkrelease 31
%define use_patch 0
-#define patchlevel uc1
+%define patchlevel uc1
%define devel_notice %{?patchlevel:NOTE: This is work-in-progress (WIP)
development kernel.}
# This is only to make life easier for people that creates derivated kernels
@@ -1367,6 +1367,9 @@
%endif
%changelog
+* Thu Feb 15 2007 Luiz Capitulino <[EMAIL PROTECTED]> 2.6.12-31uc1mdk
+ - NET: Make sure l_linger is unsigned to avoid negative timeouts
+
* Thu Jan 18 2007 Samir Bellabes <[EMAIL PROTECTED]> 2.6.12-30mdk
o Samir Bellabes <[EMAIL PROTECTED]>
- HP ML350 :