On Mon, 2015-03-16 at 19:18 +0300, Konstantin Khlebnikov wrote: > On 16.03.2015 17:50, Davidlohr Bueso wrote: > > On Mon, 2015-03-16 at 15:07 +0100, Oleg Nesterov wrote: > >> 3. and we can remove down_write(mmap_sem) from prctl paths. > >> > >> Actually we can do this even without xchg() above, but we might > >> want to kill MMF_EXE_FILE_CHANGED and test_and_set_bit() check. > > > > Yeah I was waiting for security folks input about this, otherwise this > > still doesn't do it for me as we still have to deal with mmap_sem. > > > > Why? mm->flags are updated atomically. mmap_sem isn't required here. Right, nm I was thinking of the set but Oleg's xchg() idea is obviously correct and a much better approach to mine. The only thing I'd suggest is explicitly commenting the lockless get_mm_exe_file callers, if useful, you can take it from my patch 1. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>