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]
Message-ID: <20091102174029.GD4075@hmsreliant.think-freely.org>
Date:	Mon, 2 Nov 2009 12:40:29 -0500
From:	Neil Horman <nhorman@...driver.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	marcin.slusarz@...il.com, tglx@...utronix.de, mingo@...hat.com,
	hpa@...or.com
Subject: Re: [PATCH 2/3] extend get/setrlimit to support setting rlimits
	external to a process (v7)

On Mon, Nov 02, 2009 at 04:10:32PM +0100, Ingo Molnar wrote:
> 
> two small comments:
> 
> this is a really dangerous pattern:
> 
> > +	if (!lock_task_sighand(tsk, &flags))
> > +		goto out_put_all;
> > +
> 
> as it's followed by:
> 
> > +	else {
> > +		struct rlimit val;
> > +
> > +		task_lock(tsk->group_leader);
> > +		val = current->signal->rlim[resource];
> > +		task_unlock(tsk->group_leader);
> > +		retval = copy_to_user(rlim, &val, sizeof(*rlim)) ? -EFAULT : 0;
> > +	}
> 
> please turn that into the regular:
> 
> 	if () {
> 		...
> 	} else {
> 		...
> 	}
> 
> pattern that is a lot harder to mess up later on.
> 
Yeah, ok, I can do that.

> > +	return retval;
> > +}
> > +
> > +
> >  #ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT
> 
> one too many newlines?
> 
Probably, I'll trim it.  Thanks.
Neil

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