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: <e8a57823-3c5a-886a-e114-b5e7b2bb4f01@roeck-us.net>
Date:   Tue, 9 Jun 2020 16:03:19 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     Peter Zijlstra <peterz@...radead.org>,
        Eric Biggers <ebiggers@...nel.org>
Cc:     tglx@...utronix.de, frederic@...nel.org,
        linux-kernel@...r.kernel.org, x86@...nel.org, cai@....pw,
        mgorman@...hsingularity.net
Subject: Re: [RFC][PATCH 7/7] sched: Replace rq::wake_list

On 6/9/20 3:06 PM, Peter Zijlstra wrote:
> On Tue, Jun 09, 2020 at 02:38:29PM -0700, Eric Biggers wrote:
>> Does the struct actually have to be named?  How about:
>>
>> diff --git a/include/linux/sched.h b/include/linux/sched.h
>> index c5d96e3e7fff42..14ca25cda19150 100644
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -653,8 +653,14 @@ struct task_struct {
>>  	unsigned int			ptrace;
>>  
>>  #ifdef CONFIG_SMP
>> -	struct llist_node		wake_entry;
>> -	unsigned int			wake_entry_type;
>> +	/*
>> +	 * wake_entry_type must follow wake_entry, even when
>> +	 * CONFIG_GCC_PLUGIN_RANDSTRUCT=y.
>> +	 */
>> +	struct {
>> +		struct llist_node	wake_entry;
>> +		unsigned int		wake_entry_type;
>> +	};
>>  	int				on_cpu;
>>  #ifdef CONFIG_THREAD_INFO_IN_TASK
>>  	/* Current CPU: */
>>
>>
>> However, it would be preferable to not rely on different structs sharing the
>> same field order, but rather write proper C code that uses the same struct
>> everywhere to encapsulate these 2 fields...
> 
> https://lkml.kernel.org/r/20200605093704.GB2948@hirez.programming.kicks-ass.net
> 
> And I have more patches on top to clean up some of the anonymous union
> stuff, that that's quite a lot of frobbing.
> 

That is why I tried to keep it simple as hackish fixup patch.

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ