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]
Date:	Fri, 23 Jul 2010 19:40:36 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Roland McGrath <roland@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	"Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>,
	LKML <linux-kernel@...r.kernel.org>, andi.kleen@...el.com,
	stable@...nel.org
Subject: Re: [PATCH] Don't apply for write lock on tasklist_lock if parent
	doesn't ptrace other processes

On 07/22, Roland McGrath wrote:
>
> > So, this list_empty() check needs taskslit at least for reading. But, we
> > are going to take it for writing right after exit_ptrace() returns, afaics
> > we can add this fastpatch check for free.
>
> That looks good to me, but it could use some more scare comments.

Good. Hopfully Zhang can test it to confirm it has the same effect.
It should, but I am still wondering about 10% improvement.

> >  /*
> > - * Detach all tasks we were using ptrace on.
> > + * Detach all tasks we were using ptrace on. Called with tasklist held.
>
>  * Called with tasklist held for writing, and returns with it held too.
>  * But note it can release and reacquire the lock.

OK.

> > +	write_lock_irq(&tasklist_lock);
> > +
> 	/*
> 	 * Note that exit_ptrace() might drop tasklist_lock and reacquire it.
> 	 */
> >  	exit_ptrace(father);

Well, this comment a bit "unfair", please see below.

> > -	write_lock_irq(&tasklist_lock);
> >  	reaper = find_new_reaper(father);

Note that find_new_reaper() can drop/reacquire tasklist too.

Perhaps,

	/* These two might drop and reacquire tasklist_lock */
	exit_ptrace(father);
	reaper = find_new_reaper(father);

	...

?

Oleg.

--
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