lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Jun 2010 22:40:22 -0500
From:	"Serge E. Hallyn" <serge@...lyn.com>
To:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc:	linux-kernel@...r.kernel.org, dhowells@...hat.com,
	linux-security-module@...r.kernel.org
Subject: Re: [PATCH 2.6.29.6 - 2.6.35-rc3] CRED: Release spinlock before
 commit_creds().

Quoting Tetsuo Handa (penguin-kernel@...ove.SAKURA.ne.jp):
> reparent_to_kthreadd() is calling commit_creds() with tasklist_lock held. But
> commit_creds() calls key_fsuid_changed()/key_fsgid_changed()/proc_id_connector()
> which may sleep. Release tasklist_lock before calling commit_creds().
> 
> Signed-off-by: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>

The reparenting is done in current context, so current_cred can't go
away, and init_cred can't go away.  And I can't think of anything
nefarious anyone could do to the task on account of the previous
credentials (as a result of the reparenting) before commit_creds()
completes.  So it looks good to me, but David might know of a reason
why it isn't...  Anyway:

Acked-by: Serge E. Hallyn <serge@...lyn.com>

> ---
>  kernel/exit.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- security-testing-2.6.orig/kernel/exit.c
> +++ security-testing-2.6/kernel/exit.c
> @@ -348,8 +348,8 @@ static void reparent_to_kthreadd(void)
>  	       sizeof(current->signal->rlim));
>  
>  	atomic_inc(&init_cred.usage);
> -	commit_creds(&init_cred);
>  	write_unlock_irq(&tasklist_lock);
> +	commit_creds(&init_cred);
>  }
>  
>  void __set_special_pids(struct pid *pid)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ