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: <ea8ef700-daf2-4408-888f-f5c93db82331@intel.com>
Date: Mon, 1 Apr 2024 11:12:23 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: <babu.moger@....com>, <fenghua.yu@...el.com>, <bp@...en8.de>,
	<james.morse@....com>, <tony.luck@...el.com>, <peternewman@...gle.com>,
	<tglx@...utronix.de>, <mingo@...hat.com>, <dave.hansen@...ux.intel.com>,
	<x86@...nel.org>
CC: <hpa@...or.com>, <james.greenhalgh@....com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/resctrl: Fix uninitialized memory read when last CPU
 of domain goes offline

Hi Babu,

On 4/1/2024 10:57 AM, Moger, Babu wrote:
> On 3/28/24 16:12, Reinette Chatre wrote:

>> --- a/arch/x86/kernel/cpu/resctrl/internal.h
>> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
>> @@ -85,6 +85,10 @@ cpumask_any_housekeeping(const struct cpumask *mask, int exclude_cpu)
>>  	if (cpu < nr_cpu_ids && !tick_nohz_full_cpu(cpu))
>>  		return cpu;
>>  
>> +	/* Only continue if tick_nohz_full_mask has been initialized. */
>> +	if (!tick_nohz_full_enabled())
>> +		return cpu;
>> +
> 
> I am curious why this below check didn't fail?
> 
> if (cpu < nr_cpu_ids && !tick_nohz_full_cpu(cpu))
>   		return cpu;
> 
> The tick_nohz_full_cpu() already checks tick_nohz_full_enabled().
> 
> It should returned 'false' and  returned cpu already.
> 
> Did i miss something?
> 

The scenario occurs when the last CPU of a domain goes offline and the cpu itself
is the cpu to be excluded. In this scenario cpu >= nr_cpu_ids in the check you
quote.

You may, as did I, wonder why continue the check on a smaller set of CPUs
if the first check already failed? James addressed that in:
https://lore.kernel.org/lkml/bd8a64fa-86d3-4417-a570-36469330508f@arm.com/

Reinette




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ