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:	Mon, 5 Mar 2007 15:40:33 +0100
From:	Andi Kleen <ak@...e.de>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Mathieu Desnoyers <compudj@...gle.com>,
	"Martin J. Bligh" <mbligh@...gle.com>,
	linux-kernel@...r.kernel.org, Andi Kleen <ak@...e.de>,
	"David S. Miller" <davem@...emloft.net>,
	Paul Mackerras <paulus@...ba.org>,
	"Luck, Tony" <tony.luck@...el.com>,
	Haavard Skinnemoen <hskinnemoen@...el.com>
Subject: Re: Thread flags modified without set_thread_flag() (non atomically)

> It does seem risky.  Perhaps it is a micro-optimisation which utilises
> knowledge that this thread_struct cannot be looked up via any path in this
> context.
> 
> Or perhaps it is a bug.  Andi, can you please comment?

On flush_thread nobody else can mess with the thread, so yes it's a micro
optimization.

> 
> > And about this specific flush_thread, I am puzzled about the t->flags ^= 
> > (_TIF_ABI_PENDING | _TIF_IA32); line. The XOR will clearly flip the 
> > _TIF_ABI_PENDING bit to 0, and very likely set _TIF_IA32 to the opposite 
> > of its current value. Why does this change need to be written atomically 
> > (can other threads play with these flags ?) ?
> > 
> 
> Don't know.

iirc it came from DaveM originally. He just likes to write things in 
comp^wclever ways :0) It's just a little shorter.

> No, I don't immediately see anything in the flush_old_exec() code path
> which tells us that nobody else can look up this thread_info (or be holding
> a ref to it) in this context.

Normally the process flags atomicity should only matter with signals;
i don't think you can send a signal to a process being in exec this way.

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