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] [day] [month] [year] [list]
Message-Id: <20250324131558.1633796-1-cuiguoqi@kylinos.cn>
Date: Mon, 24 Mar 2025 21:15:58 +0800
From: cuiguoqi <cuiguoqi@...inos.cn>
To: bigeasy@...utronix.de
Cc: anna-maria@...utronix.de,
	clrkwllms@...nel.org,
	cuiguoqi@...inos.cn,
	frederic@...nel.org,
	linux-kernel@...r.kernel.org,
	linux-rt-devel@...ts.linux.dev,
	rostedt@...dmis.org,
	tglx@...utronix.de,
	guoqi0226@....com
Subject: Re: [PATCH] hrtimer: Fix the incorrect initialization of timer->is_hard

Here,it is not set but referenced. When !PREEMPT, is_hard does not match
the actual situation.In the original logic, the actual mode selection is 
mainly based on softtimer.

When the HARD/SOFT mode is not explicitly configured, the following logic 
is used to select the hard/soft mode:

> bool softtimer = !!(mode & HRTIMER_MODE_SOFT); //PREEMPT_RT:flase/!PREEMPT_RT: flase
> if (IS_ENABLED(CONFIG_PREEMPT_RT) && !(mode & HRTIMER_MODE_HARD))
	softtimer = true;                        //PREEMPT_RT:true  
> base = softtimer ? HRTIMER_MAX_CLOCK_BASES/2:0;//PREEMPT_RT:soft mode/!PREEMPT_RT: hard mode
> base += hrtimer_clockid_to_base(clock_id);
> timer->base = &cpu_base->clock_base[base];
> timer->is_soft = softtimer;                   //PREEMPT_RT:true /!PREEMPT_RT: false
- timer->is_hard = !!(mode & HRTIMER_MODE_HARD);//PREEMPT_RT:false/!PREEMPT_RT: false
+ timer->is_hard = !softtimer;                  //PREEMPT_RT:false/!PREEMPT_RT: true 

Thus, under !PREEMPT, the distinction in is_hard is clear.
while it does not affect the logic of the hrtimer_start_range_ns: 
>	if (!IS_ENABLED(CONFIG_PREEMPT_RT))             
>		WARN_ON_ONCE(!(mode & HRTIMER_MODE_SOFT) ^ !timer->is_soft);
>	else
>		WARN_ON_ONCE(!(mode & HRTIMER_MODE_HARD) ^ !timer->is_hard);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ