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: <1498831200.6130.13.camel@redhat.com>
Date:   Fri, 30 Jun 2017 10:00:00 -0400
From:   Rik van Riel <riel@...hat.com>
To:     mingo@...nel.org, fransklaver@...il.com, hpa@...or.com,
        fweisbec@...il.com, torvalds@...ux-foundation.org,
        tglx@...utronix.de, wanpeng.li@...mail.com,
        linux-kernel@...r.kernel.org, garsilva@...eddedor.com,
        sgruszka@...hat.com, peterz@...radead.org,
        linux-tip-commits@...r.kernel.org
Subject: Re: [tip:sched/core] sched/cputime: Refactor the cputime_adjust()
 code

On Fri, 2017-06-30 at 06:10 -0700, tip-bot for Gustavo A. R. Silva
wrote:

> +++ b/kernel/sched/cputime.c
> @@ -615,19 +615,13 @@ static void cputime_adjust(struct task_cputime
> *curr,
>  	 * userspace. Once a task gets some ticks, the monotonicy
> code at
>  	 * 'update' will ensure things converge to the observed
> ratio.
>  	 */
> -	if (stime == 0) {
> -		utime = rtime;
> -		goto update;
> +	if (stime != 0) {
> +		if (utime == 0)
> +			stime = rtime;
> +		else
> +			stime = scale_stime(stime, rtime, stime +
> utime);
>  	}
>  
> -	if (utime == 0) {
> -		stime = rtime;
> -		goto update;
> -	}
> -
> -	stime = scale_stime(stime, rtime, stime + utime);
> -
> -update:

Wait, what?

This get rid of the utime = rtime assignment, when
stime == 0.  That could be a correctness issue.

>  	/*
>  	 * Make sure stime doesn't go backwards; this preserves
> monotonicity
>  	 * for utime because rtime is monotonic.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ