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:	Mon, 16 Feb 2009 15:23:24 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Dhaval Giani <dhaval@...ux.vnet.ibm.com>
Cc:	Corey Hickey <bugfood-ml@...ooh.org>, linux-kernel@...r.kernel.org,
	Bharata B Rao <bharata@...ux.vnet.ibm.com>,
	Balbir Singh <balbir@...ibm.com>,
	Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>, mtk.manpages@...il.com
Subject: Re: RT scheduling and a way to make a process hang, unkillable

On Mon, 2009-02-16 at 14:19 +0100, Peter Zijlstra wrote:
> On Mon, 2009-02-16 at 18:44 +0530, Dhaval Giani wrote:
> >  (This is not a good day!)
> 
> Monday strikes again ;-)
> 
> > @@ -572,6 +572,9 @@ static int set_user(struct cred *new)
> >  	if (!new_user)
> >  		return -EAGAIN;
> 
> So here we just allocated new_user and made sure we didn't fail that
> allocation.
> 
> > +	if (!task_can_switch_user(new->uid, current))
> > +		return -EAGAIN;
> 
> And here you bail, without freeing new_user. The idea was to do this
> check before alloc_uid().
> 
> >  	if (atomic_read(&new_user->processes) >=
> >  				current->signal->rlim[RLIMIT_NPROC].rlim_cur &&
> >  			new_user != INIT_USER) {

Ah, I now see I send you down a hole here,.. your find_user() in
task_can_switch_user() relies on that alloc_uid(). So you have to do it
after, and just free the new_user thingy when the test fails.

--
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