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: <20230912173833.rjrc7zpnvk6tcveb@revolver>
Date:   Tue, 12 Sep 2023 13:38:33 -0400
From:   "Liam R. Howlett" <Liam.Howlett@...cle.com>
To:     Christophe Leroy <christophe.leroy@...roup.eu>
Cc:     "Paul E. McKenney" <paulmck@...nel.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        "linux-renesas-soc@...r.kernel.org" 
        <linux-renesas-soc@...r.kernel.org>,
        Shanker Donthineni <sdonthineni@...dia.com>
Subject: Re: [PATCH v2 1/2] maple_tree: Disable mas_wr_append() when other
 readers are possible

* Christophe Leroy <christophe.leroy@...roup.eu> [230912 13:09]:
> 
> 
> Le 12/09/2023 à 17:44, Liam R. Howlett a écrit :
> > diff --git a/init/main.c b/init/main.c
> > index dbe1fe76be34..fd4739918a94 100644
> > --- a/init/main.c
> > +++ b/init/main.c
> > @@ -696,7 +696,7 @@ noinline void __ref __noreturn rest_init(void)
> >   	 */
> >   	rcu_read_lock();
> >   	tsk = find_task_by_pid_ns(pid, &init_pid_ns);
> > -	tsk->flags |= PF_NO_SETAFFINITY;
> > +	tsk->flags |= PF_NO_SETAFFINITY & PF_IDLE;
> 
> Is it really what you want to do ?
> 
> PF_NO_SETAFFINITY is 0x04000000 and PF_IDLE is 0x00000002 so
> 
> PF_NO_SETAFFINITY & PF_IDLE is 0
> 
> 
> Didn't you mean to do PF_NO_SETAFFINITY | PF_IDLE  ?

Yes, certainly.

> 
> 
> Regardless, with either change I don't get the warning anymore.

I don't have it fully tested but we avoid getting the call_rcu() setting
the TIF_... flag by avoiding the task having PF_IDLE set in the flags.
I'm not entirely sure if I have added the set/clear in the best
locations either.

The largest concern I have is that this could potentially change arch or
platfrom code if anything depends on this being idle.

> 
> 
> 
> >   	set_cpus_allowed_ptr(tsk, cpumask_of(smp_processor_id()));
> >   	rcu_read_unlock();
> >   
> > @@ -943,6 +943,7 @@ void start_kernel(void)
> >   	 * time - but meanwhile we still have a functioning scheduler.
> >   	 */
> >   	sched_init();
> > +	current->flags &= ~PF_IDLE;
> >   
> >   	if (WARN(!irqs_disabled(),
> >   		 "Interrupts were enabled *very* early, fixing it\n"))
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ