Bug 14676

Summary: Process accounting logs all processes as UID 0
Product: Process Management Reporter: Juho K. Juopperi (jkj)
Component: OtherAssignee: Alexey Dobriyan (adobriyan)
Status: RESOLVED CODE_FIX    
Severity: normal CC: adobriyan, dchepishev, jkj, mschmidt
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.31.6 Subsystem:
Regression: No Bisected commit-id:
Attachments: the kernel .config file

Description Juho K. Juopperi 2009-11-23 20:51:23 UTC
All processes are incorrectly logged in pacct file as having user id 0.
Comment 1 Deyan 2009-12-14 12:35:59 UTC
Hello, 

I confirm this bug. All processes are being logged with UID 0.

sa -m gives me correct output about time, but wrong about user usage, because all the time goes to account root and no other users are reported

Tested with the following kernel versions:

2.6.31.6
2.6.31.7
2.6.32

Working correctly with:
2.6.27.10

I tried various configs, but no luck so far. 

OS: CentOS 5.4

Linux centos5-64 2.6.32 #1 SMP Mon Dec 14 11:24:29 EET 2009 x86_64 x86_64 x86_64 GNU/Linux

Gnu C                  4.1.2
Gnu make               3.81
binutils               2.17.50.0.6 and 2.20 tested too
util-linux             2.13-pre7
mount                  2.13-pre7
module-init-tools      3.3-pre2
e2fsprogs              1.39
Linux C Library        2.5
Dynamic linker (ldd)   2.5
Procps                 3.2.7
Net-tools              1.60
Kbd                    1.12
Sh-utils               5.97
udev                   095

enabling/disabling CONFIG_BSD_PROCESS_ACCT_V3 makes no difference

tested with
GNU Accounting Utilities (release 6.3.5-ts02-12)
GNU Accounting Utilities (release 6.5.1), 

The .config file is attached to this bug.
Comment 2 Deyan 2009-12-14 12:36:22 UTC
Created attachment 24177 [details]
the kernel .config file
Comment 3 Deyan 2009-12-14 14:47:39 UTC
Hello again,

I tracked down when the problem first appeared.

The problem comes with this commit:

http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commitdiff;h=d8e180dcd5bbbab9cd3ff2e779efcf70692ef541

My temporary resolution is reverting the patch between, but I guess it is better a kernel developer to take a look at it.

linux-2.6.31.7/kernel/acct.c
and 
linux-2.6.31.4/kernel/acct.c
Comment 4 Deyan 2009-12-14 14:49:45 UTC
Hello Michal Schmidt,

I see you are the author of the patch of the above commit which triggered the problem reported in this bug, so I thought you might want to take a look at this bug.
Comment 5 Michal Schmidt 2009-12-14 15:04:22 UTC
Alexey Dobriyan posted a patch for this bug already (http://lkml.org/lkml/2009/11/30/425) and I ACKed it (http://lkml.org/lkml/2009/12/1/290).
It has not been merged yet to Linus's tree, but I hope it will be soon.

Thank you for reporting bugs.
Comment 6 Deyan 2009-12-15 07:15:55 UTC
Hi,

The patch works for me. Thank you for the prompt reply
Comment 7 Alexey Dobriyan 2009-12-16 13:10:43 UTC
commit 4b731d50ff3df6b9141a6c12b088e8eb0109e83c
bsdacct: fix uid/gid misreporting