* [PATCH] bsdacct: fix uid/gid misreporting (#14676)
@ 2009-11-30 22:40 Alexey Dobriyan
2009-12-01 14:43 ` Serge E. Hallyn
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Alexey Dobriyan @ 2009-11-30 22:40 UTC (permalink / raw)
To: akpm; +Cc: jkj, linux-kernel, mschmidt, dhowells, serue, jmorris
commit d8e180dcd5bbbab9cd3ff2e779efcf70692ef541
"bsdacct: switch credentials for writing to the accounting file"
introduced credential switching during final acct data collecting.
However, uid/gid pair continued to be collected from current which
became credentials of who created acct file, not who exits.
Fix http://bugzilla.kernel.org/show_bug.cgi?id=14676
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
Juho, please, confirm.
kernel/acct.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -536,7 +536,8 @@ static void do_acct_process(struct bsd_acct_struct *acct,
do_div(elapsed, AHZ);
ac.ac_btime = get_seconds() - elapsed;
/* we really need to bite the bullet and change layout */
- current_uid_gid(&ac.ac_uid, &ac.ac_gid);
+ ac.ac_uid = orig_cred->uid;
+ ac.ac_gid = orig_cred->gid;
#if ACCT_VERSION==2
ac.ac_ahz = AHZ;
#endif
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] bsdacct: fix uid/gid misreporting (#14676)
2009-11-30 22:40 [PATCH] bsdacct: fix uid/gid misreporting (#14676) Alexey Dobriyan
@ 2009-12-01 14:43 ` Serge E. Hallyn
2009-12-01 15:38 ` David Howells
2009-12-01 17:49 ` Michal Schmidt
2 siblings, 0 replies; 5+ messages in thread
From: Serge E. Hallyn @ 2009-12-01 14:43 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: akpm, jkj, linux-kernel, mschmidt, dhowells, jmorris
Quoting Alexey Dobriyan (adobriyan@gmail.com):
> commit d8e180dcd5bbbab9cd3ff2e779efcf70692ef541
> "bsdacct: switch credentials for writing to the accounting file"
> introduced credential switching during final acct data collecting.
> However, uid/gid pair continued to be collected from current which
> became credentials of who created acct file, not who exits.
>
> Fix http://bugzilla.kernel.org/show_bug.cgi?id=14676
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Yeah seems like it wouuld be needed, thanks.
Acked-by: Serge Hallyn <serue@us.ibm.com>
> ---
>
> Juho, please, confirm.
>
> kernel/acct.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- a/kernel/acct.c
> +++ b/kernel/acct.c
> @@ -536,7 +536,8 @@ static void do_acct_process(struct bsd_acct_struct *acct,
> do_div(elapsed, AHZ);
> ac.ac_btime = get_seconds() - elapsed;
> /* we really need to bite the bullet and change layout */
> - current_uid_gid(&ac.ac_uid, &ac.ac_gid);
> + ac.ac_uid = orig_cred->uid;
> + ac.ac_gid = orig_cred->gid;
> #if ACCT_VERSION==2
> ac.ac_ahz = AHZ;
> #endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] bsdacct: fix uid/gid misreporting (#14676)
2009-11-30 22:40 [PATCH] bsdacct: fix uid/gid misreporting (#14676) Alexey Dobriyan
2009-12-01 14:43 ` Serge E. Hallyn
@ 2009-12-01 15:38 ` David Howells
2009-12-01 17:49 ` Michal Schmidt
2 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2009-12-01 15:38 UTC (permalink / raw)
To: Alexey Dobriyan
Cc: dhowells, akpm, jkj, linux-kernel, mschmidt, serue, jmorris
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> commit d8e180dcd5bbbab9cd3ff2e779efcf70692ef541
> "bsdacct: switch credentials for writing to the accounting file"
> introduced credential switching during final acct data collecting.
> However, uid/gid pair continued to be collected from current which
> became credentials of who created acct file, not who exits.
>
> Fix http://bugzilla.kernel.org/show_bug.cgi?id=14676
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: David Howells <dhowells@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] bsdacct: fix uid/gid misreporting (#14676)
2009-11-30 22:40 [PATCH] bsdacct: fix uid/gid misreporting (#14676) Alexey Dobriyan
2009-12-01 14:43 ` Serge E. Hallyn
2009-12-01 15:38 ` David Howells
@ 2009-12-01 17:49 ` Michal Schmidt
2009-12-02 3:49 ` James Morris
2 siblings, 1 reply; 5+ messages in thread
From: Michal Schmidt @ 2009-12-01 17:49 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: akpm, jkj, linux-kernel, dhowells, serue, jmorris, stable
On Tue, 1 Dec 2009 01:40:32 +0300 Alexey Dobriyan wrote:
> commit d8e180dcd5bbbab9cd3ff2e779efcf70692ef541
> "bsdacct: switch credentials for writing to the accounting file"
> introduced credential switching during final acct data collecting.
> However, uid/gid pair continued to be collected from current which
> became credentials of who created acct file, not who exits.
>
> Fix http://bugzilla.kernel.org/show_bug.cgi?id=14676
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Ah, indeed. The original commit went into 2.6.31-stable so this one
should too.
Reviewed-by: Michal Schmidt <mschmidt@redhat.com>
>
> Juho, please, confirm.
>
> kernel/acct.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- a/kernel/acct.c
> +++ b/kernel/acct.c
> @@ -536,7 +536,8 @@ static void do_acct_process(struct
> bsd_acct_struct *acct, do_div(elapsed, AHZ);
> ac.ac_btime = get_seconds() - elapsed;
> /* we really need to bite the bullet and change layout */
> - current_uid_gid(&ac.ac_uid, &ac.ac_gid);
> + ac.ac_uid = orig_cred->uid;
> + ac.ac_gid = orig_cred->gid;
> #if ACCT_VERSION==2
> ac.ac_ahz = AHZ;
> #endif
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] bsdacct: fix uid/gid misreporting (#14676)
2009-12-01 17:49 ` Michal Schmidt
@ 2009-12-02 3:49 ` James Morris
0 siblings, 0 replies; 5+ messages in thread
From: James Morris @ 2009-12-02 3:49 UTC (permalink / raw)
To: Michal Schmidt
Cc: Alexey Dobriyan, akpm, jkj, linux-kernel, dhowells, serue, stable
On Tue, 1 Dec 2009, Michal Schmidt wrote:
> Ah, indeed. The original commit went into 2.6.31-stable so this one
> should too.
>
> Reviewed-by: Michal Schmidt <mschmidt@redhat.com>
>
This should probably go to Linus' tree in akpm's next batch.
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-02 3:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30 22:40 [PATCH] bsdacct: fix uid/gid misreporting (#14676) Alexey Dobriyan
2009-12-01 14:43 ` Serge E. Hallyn
2009-12-01 15:38 ` David Howells
2009-12-01 17:49 ` Michal Schmidt
2009-12-02 3:49 ` James Morris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox