On Sat, Apr 04, 2009 at 05:35:18PM +0300, Izik Eidus wrote: > From v1 to v2: > > 1)Fixed security issue found by Chris Wright: > Ksm was checking if page is a shared page by running !PageAnon. > Beacuse that Ksm scan only anonymous memory, all !PageAnons > inside ksm data strctures are shared page, however there might > be a case for do_wp_page() when the VM_SHARED is used where > do_wp_page() would instead of copying the page into new anonymos > page, would reuse the page, it was fixed by adding check for the > dirty_bit of the virtual addresses pointing into the shared page. > I was not finding any VM code tha would clear the dirty bit from > this virtual address (due to the fact that we allocate the page > using page_alloc() - kernel allocated pages), ~but i still want > confirmation about this from the vm guys - thanks.~ As far as I can tell this wasn't a bug and this change is unnecessary. I already checked this bit but I may have missed something, so I ask here to be sure. As far as I can tell when VM_SHARED is set, no anonymous page can ever be allocated by in that vma range, hence no KSM page can ever be generated in that vma either. MAP_SHARED|MAP_ANONYMOUS is only a different API for /dev/shm, IPCSHM backing, no anonymous pages can live there. It surely worked like that in older 2.6, reading latest code it seems to still work like that, but if something has changed Hugh will surely correct me in a jiffy ;). I still see this in the file=null path. } else if (vm_flags & VM_SHARED) { error = shmem_zero_setup(vma); if (error) goto free_vma; } So you can revert your change for now. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html