Re: [PATCH] Version 8 (2.6.23) Smack: Simplified Mandatory Access Control Kernel

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Casey Schaufler <casey@...>
Cc: <torvalds@...>, <akpm@...>, <linux-security-module@...>, <linux-kernel@...>
Date: Thursday, October 18, 2007 - 4:26 pm

On Thu, Oct 18, 2007 at 01:13:02PM -0700, Casey Schaufler wrote:


Why?  Writes from CPU1 don't have to be seen in the same order on CPU2.
Compiler has every right to turn that into
	load from smack_known
	store to ->smk_next
	...
	store to smack_known
and there's no reason whatsoever why these two stores won't be seen
out of order on CPU2 - there's no barrier and all we have is a bunch
of assignments from registers to various (nonrepeating) addresses in
memory.  On out-of-order architectures they can be reordered just fine
by CPU itself...

You need at least a barrier, assuming that you want to keep that kind
of lockless access in readers (actually, I wonder if that list is a
good choice of data structure here - you are using it as a symbol table
and depending on the expected use pattern there might be better choices
for that).
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Smackv8: Omit non-cipso labels in cipso_seq_start, Ahmed S. Darwish, (Sat Oct 20, 9:40 pm)
[PATCH] Smackv8: Safe lockless {cipso,load} read operation, Ahmed S. Darwish, (Sat Oct 20, 10:25 pm)
Re: [PATCH] Version 8 (2.6.23) Smack: Simplified Mandatory A..., Al Viro, (Thu Oct 18, 4:26 pm)