Bug#412132: cacct interface misscalced about 100 TB

2007-02-23 Thread Bastian Blank
On Sat, Feb 24, 2007 at 12:48:20AM +0100, Patrick Matthäi wrote:
> I'm sorry, normaly it shouldn't be a very important bug, but please 
> think about these ones, who have to log the caused traffic, that's very 
> terrible. So could you please add it to the next upload?

I do, but I have to prioritize them.

Bastian

-- 
Kirk to Enterprise -- beam down yeoman Rand and a six-pack.



Bug#412132: cacct interface misscalced about 100 TB

2007-02-23 Thread Patrick Matthäi

Hi,

I'm sorry, normaly it shouldn't be a very important bug, but please 
think about these ones, who have to log the caused traffic, that's very 
terrible. So could you please add it to the next upload?


Regards, Patrick Matthäi


Bastian Blank schrieb:

severity 412132 important
user debian-kernel@lists.debian.org
usertag dkt-waiting-etch-update
tags 412132 +patch
thanks

On Fri, Feb 23, 2007 at 11:19:57PM +0100, Patrick Matthäi wrote:
  

I think I've found a serious bug in the vserver image for amd64.
We're running a daemon, which is logging the traffic of all 
hostmachines. Now I've found a very big mistake in the 
/proc/virtual//cacct interface.



Known. Can be fixed with the first stable update, not security relevant.

Available patch, needs to be fixed to avoid abi change (use atomic_t and crop
at the printf):

diff -Nurp linux-2.6.19.2-vs2.2.0-rc9/include/linux/vserver/cacct_def.h 
linux-2.6.19.2-vs2.2.0-rc9.longatomic/include/linux/vserver/cacct_def.h
--- linux-2.6.19.2-vs2.2.0-rc9/include/linux/vserver/cacct_def.h
2007-01-11 18:10:53.0 +0100
+++ linux-2.6.19.2-vs2.2.0-rc9.longatomic/include/linux/vserver/cacct_def.h 
2007-02-02 18:17:38.0 +0100
@@ -6,8 +6,8 @@
 
 
 struct _vx_sock_acc {

-   atomic_t count;
-   atomic_t total;
+   atomic_long_t count;
+   atomic_long_t total;
 };
 
 /* context sub struct */

@@ -30,9 +30,9 @@ static inline void __dump_vx_cacct(struc
 
 		printk("\t [%d] =", i);

for (j=0; j<3; j++) {
-   printk(" [%d] = %8d, %8d", j,
-   atomic_read(&ptr[j].count),
-   atomic_read(&ptr[j].total));
+   printk(" [%d] = %8ld, %8ld", j,
+   atomic_long_read(&ptr[j].count),
+   atomic_long_read(&ptr[j].total));
}
printk("\n");
}
diff -Nurp linux-2.6.19.2-vs2.2.0-rc9/include/linux/vs_socket.h 
linux-2.6.19.2-vs2.2.0-rc9.longatomic/include/linux/vs_socket.h
--- linux-2.6.19.2-vs2.2.0-rc9/include/linux/vs_socket.h2007-01-11 
18:10:52.0 +0100
+++ linux-2.6.19.2-vs2.2.0-rc9.longatomic/include/linux/vs_socket.h 
2007-02-02 18:18:14.0 +0100
@@ -38,8 +38,8 @@ static inline void __vx_acc_sock(struct 
 	if (vxi) {

int type = vx_sock_type(family);
 
-		atomic_inc(&vxi->cacct.sock[type][pos].count);

-   atomic_add(size, &vxi->cacct.sock[type][pos].total);
+   atomic_long_inc(&vxi->cacct.sock[type][pos].count);
+   atomic_long_add(size, &vxi->cacct.sock[type][pos].total);
}
 }
 
Bastian


  





Processed (with 1 errors): Re: Bug#412132: cacct interface misscalced about 100 TB

2007-02-23 Thread Debian Bug Tracking System
Processing commands for [EMAIL PROTECTED]:

> severity 412132 important
Bug#412132: cacct interface misscalced about 100 TB
Severity set to `important' from `serious'

> user debian-kernel@lists.debian.org
Setting user to debian-kernel@lists.debian.org (was [EMAIL PROTECTED]).
> usertag dkt-waiting-etch-update
Unknown command or malformed arguments to command.

> tags 412132 +patch
Bug#412132: cacct interface misscalced about 100 TB
There were no tags set.
Tags added: patch

> thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#412132: cacct interface misscalced about 100 TB

2007-02-23 Thread Bastian Blank
severity 412132 important
user debian-kernel@lists.debian.org
usertag dkt-waiting-etch-update
tags 412132 +patch
thanks

On Fri, Feb 23, 2007 at 11:19:57PM +0100, Patrick Matthäi wrote:
> I think I've found a serious bug in the vserver image for amd64.
> We're running a daemon, which is logging the traffic of all 
> hostmachines. Now I've found a very big mistake in the 
> /proc/virtual//cacct interface.

Known. Can be fixed with the first stable update, not security relevant.

Available patch, needs to be fixed to avoid abi change (use atomic_t and crop
at the printf):

diff -Nurp linux-2.6.19.2-vs2.2.0-rc9/include/linux/vserver/cacct_def.h 
linux-2.6.19.2-vs2.2.0-rc9.longatomic/include/linux/vserver/cacct_def.h
--- linux-2.6.19.2-vs2.2.0-rc9/include/linux/vserver/cacct_def.h
2007-01-11 18:10:53.0 +0100
+++ linux-2.6.19.2-vs2.2.0-rc9.longatomic/include/linux/vserver/cacct_def.h 
2007-02-02 18:17:38.0 +0100
@@ -6,8 +6,8 @@
 
 
 struct _vx_sock_acc {
-   atomic_t count;
-   atomic_t total;
+   atomic_long_t count;
+   atomic_long_t total;
 };
 
 /* context sub struct */
@@ -30,9 +30,9 @@ static inline void __dump_vx_cacct(struc
 
printk("\t [%d] =", i);
for (j=0; j<3; j++) {
-   printk(" [%d] = %8d, %8d", j,
-   atomic_read(&ptr[j].count),
-   atomic_read(&ptr[j].total));
+   printk(" [%d] = %8ld, %8ld", j,
+   atomic_long_read(&ptr[j].count),
+   atomic_long_read(&ptr[j].total));
}
printk("\n");
}
diff -Nurp linux-2.6.19.2-vs2.2.0-rc9/include/linux/vs_socket.h 
linux-2.6.19.2-vs2.2.0-rc9.longatomic/include/linux/vs_socket.h
--- linux-2.6.19.2-vs2.2.0-rc9/include/linux/vs_socket.h2007-01-11 
18:10:52.0 +0100
+++ linux-2.6.19.2-vs2.2.0-rc9.longatomic/include/linux/vs_socket.h 
2007-02-02 18:18:14.0 +0100
@@ -38,8 +38,8 @@ static inline void __vx_acc_sock(struct 
if (vxi) {
int type = vx_sock_type(family);
 
-   atomic_inc(&vxi->cacct.sock[type][pos].count);
-   atomic_add(size, &vxi->cacct.sock[type][pos].total);
+   atomic_long_inc(&vxi->cacct.sock[type][pos].count);
+   atomic_long_add(size, &vxi->cacct.sock[type][pos].total);
}
 }
 
Bastian

-- 
Without freedom of choice there is no creativity.
-- Kirk, "The return of the Archons", stardate 3157.4



Bug#412132: cacct interface misscalced about 100 TB

2007-02-23 Thread Patrick Matthäi

Package: linux-image-2.6.18-4-vserver-amd64
Version: 2.6.18.dfsg.1-9
Severity: serious

Hello,

I think I've found a serious bug in the vserver image for amd64.
We're running a daemon, which is logging the traffic of all 
hostmachines. Now I've found a very big mistake in the 
/proc/virtual//cacct interface.


The daemon gets the informations of this cacct interface and will calc 
the caused traffic, here's the debug of my daemon:


|Fri Feb 23 15:42:01 2007 - cacct: 1472700147 o.cacct 1472517504 logged: 1495189052 now: 1495371695 method: 1 


Fri Feb 23 16:00:01 2007 - cacct: 18446744072641133818 o.cacct 3222831651 
logged: 3178567909 now: 18446744072596870076 method: 1

|The cacct variable is the value of all incoming / outcoming IPv4 and 
IPv6 traffic in bytes.
This debug would mean, that one customer has caused traffic more as 100 
TB in 20 minutes ( and that only with one ventrilo server! ).
First I thought, it's a bug in my daemon software, but that wasn't the 
problem, how this information will show:


|:~/control# cat /proc/virtual/2/cacct
UNSPEC:0/0 0/0 0/0 

UNIX: 305586/28642976 267311/28642976  1/30 

INET:9058790/1149688302  9889025/18446744071736090069  47323/18446744072430740975 

INET6: 0/0 0/0 0/0 

OTHER: 0/0 0/0 0/0 


forks:  0|
|
|It seems as the kernel misscalced or overflowed after a cacct value 
over |"1472700147".


It's the first and only example of this bug, because this is the first 
customer, with such "a lot" traffic.


Regards,
Patrick Matthäi
|