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: <1413453002.24793.72.camel@tkhai>
Date:	Thu, 16 Oct 2014 13:50:02 +0400
From:	Kirill Tkhai <ktkhai@...allels.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Kirill Tkhai <tkhai@...dex.ru>, Oleg Nesterov <oleg@...hat.com>,
	<linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...hat.com>,
	"Vladimir Davydov" <vdavydov@...allels.com>
Subject: Re: [PATCH RFC] sched: Revert delayed_put_task_struct() and fix use
 after free

В Чт, 16/10/2014 в 11:43 +0200, Peter Zijlstra пишет:
> On Thu, Oct 16, 2014 at 12:16:44PM +0400, Kirill Tkhai wrote:
> > В Чт, 16/10/2014 в 09:59 +0200, Peter Zijlstra пишет:
> > > On Thu, Oct 16, 2014 at 01:46:07AM +0400, Kirill Tkhai wrote:
> > > > > --- x/kernel/sched/fair.c
> > > > > +++ x/kernel/sched/fair.c
> > > > > @@ -1165,7 +1165,7 @@ static void task_numa_compare(struct tas
> > > > >  
> > > > >  	rcu_read_lock();
> > > > >  	cur = ACCESS_ONCE(dst_rq->curr);
> > > > > -	if (cur->pid == 0) /* idle */
> > > > > +	if (is_idle_task(cur) || (curr->flags & PF_EXITING))
> > > > >  		cur = NULL;
> > > > >  
> > > > >  	/*
> > > > > 
> > > > 
> > > > Looks like, we have to use the same fix for task_numa_group().
> > > 
> > > Don't think so, task_numa_group() is only called from task_numa_fault()
> > > which is on 'current' and neither idle and PF_EXITING should be
> > > faulting.
> > 
> > Isn't task_numa_group() fully preemptible?
> 
> Not seeing how that is relevant.
> 
> > It seems cpu_rq(cpu)->curr is not always equal to p.
> 
> It should be afaict:
> 
>  task_numa_fault()
>   p = current;
> 
>   task_numa_group(p, ..);
> 
> And like said, idle tasks and PF_EXITING task should never get (numa)
> faults for they should never be touching userspace.

I mean p can be moved to other cpu.

tsk = ACCESS_ONCE(cpu_rq(cpu)->curr);

tsk is not p, (i.e current) here.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ