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: <20170206145908.GO6515@twins.programming.kicks-ass.net>
Date:   Mon, 6 Feb 2017 15:59:08 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Mike Galbraith <efault@....de>,
        Oleg Nesterov <oleg@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 78/89] sched/core: Remove the tsk_cpus_allowed() wrapper

On Mon, Feb 06, 2017 at 02:29:21PM +0100, Ingo Molnar wrote:
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 54903862cf57..f40e2a5cf044 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -796,7 +796,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
>  	 * se we pin us down to CPU 0 for a short while
>  	 */
>  	alloc_cpumask_var(&old_mask, GFP_NOWAIT);
> -	cpumask_copy(old_mask, tsk_cpus_allowed(current));
> +	cpumask_copy(old_mask, &current->cpus_allowed);
>  	set_cpus_allowed_ptr(current, cpumask_of(boot_cpuid));
>  	
>  	if (smp_ops && smp_ops->setup_cpu)

> diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c
> index 4808b6d23455..d63fc613e7a9 100644
> --- a/arch/sparc/kernel/sysfs.c
> +++ b/arch/sparc/kernel/sysfs.c
> @@ -106,7 +106,7 @@ static unsigned long run_on_cpu(unsigned long cpu,
>  	cpumask_t old_affinity;
>  	unsigned long ret;
>  
> -	cpumask_copy(&old_affinity, tsk_cpus_allowed(current));
> +	cpumask_copy(&old_affinity, &current->cpus_allowed);
>  	/* should return -EINVAL to userspace */
>  	if (set_cpus_allowed_ptr(current, cpumask_of(cpu)))
>  		return 0;
> diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c
> index b73feeb666f9..35ddb6da93aa 100644
> --- a/drivers/cpufreq/sparc-us2e-cpufreq.c
> +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c
> @@ -234,7 +234,7 @@ static unsigned int us2e_freq_get(unsigned int cpu)
>  	cpumask_t cpus_allowed;
>  	unsigned long clock_tick, estar;
>  
> -	cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
> +	cpumask_copy(&cpus_allowed, &current->cpus_allowed);
>  	set_cpus_allowed_ptr(current, cpumask_of(cpu));
>  
>  	clock_tick = sparc64_get_clock_tick(cpu) / 1000;
> @@ -252,7 +252,7 @@ static int us2e_freq_target(struct cpufreq_policy *policy, unsigned int index)
>  	unsigned long clock_tick, divisor, old_divisor, estar;
>  	cpumask_t cpus_allowed;
>  
> -	cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
> +	cpumask_copy(&cpus_allowed, &current->cpus_allowed);
>  	set_cpus_allowed_ptr(current, cpumask_of(cpu));
>  
>  	new_freq = clock_tick = sparc64_get_clock_tick(cpu) / 1000;
> diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c
> index 9bb42ba50efa..a8d86a449ca1 100644
> --- a/drivers/cpufreq/sparc-us3-cpufreq.c
> +++ b/drivers/cpufreq/sparc-us3-cpufreq.c
> @@ -82,7 +82,7 @@ static unsigned int us3_freq_get(unsigned int cpu)
>  	unsigned long reg;
>  	unsigned int ret;
>  
> -	cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
> +	cpumask_copy(&cpus_allowed, &current->cpus_allowed);
>  	set_cpus_allowed_ptr(current, cpumask_of(cpu));
>  
>  	reg = read_safari_cfg();
> @@ -99,7 +99,7 @@ static int us3_freq_target(struct cpufreq_policy *policy, unsigned int index)
>  	unsigned long new_bits, new_freq, reg;
>  	cpumask_t cpus_allowed;
>  
> -	cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
> +	cpumask_copy(&cpus_allowed, &current->cpus_allowed);
>  	set_cpus_allowed_ptr(current, cpumask_of(cpu));
>  
>  	new_freq = sparc64_get_clock_tick(cpu) / 1000;

Note that all those, and this is where I stopped looking, appear broken
vs userspace changing the mask right after.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ