public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org, jkj@kapsi.fi,
	linux-kernel@vger.kernel.org, dhowells@redhat.com,
	serue@us.ibm.com, jmorris@namei.org, stable@kernel.org
Subject: Re: [PATCH] bsdacct: fix uid/gid misreporting (#14676)
Date: Tue, 1 Dec 2009 18:49:57 +0100	[thread overview]
Message-ID: <20091201184957.27a2aaab@leela> (raw)
In-Reply-To: <20091130224032.GA5598@x200.malnet.ru>

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


  parent reply	other threads:[~2009-12-01 17:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-12-02  3:49   ` James Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091201184957.27a2aaab@leela \
    --to=mschmidt@redhat.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=jkj@kapsi.fi \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=serue@us.ibm.com \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox