• Russell King's avatar
    [PATCH] fix problematic flush_cache_page in kernel/ptrace.c · 7f0424f9
    Russell King authored
    At present, flush_cache_page() is used to handle the case where we
    unmap a page or alter the page permissions on the target page with
    one exception - access_process_vm().  Based upon the former, the
    decision to implement this function is:
    
            do we need to flush the cache when we unmap or change
            the mapping permissions?
    
    However, kernel/ptrace.c: access_process_vm() also includes into this:
    
            or we need to ensure cache coherency between the kernel
            and user space mapping of this page.
    
    I argue that the use of flush_cache_page() here in the generic
    code is wrong, and if an architecture wishes to use it for this
    purpose, it should do so within it's architecture private
    implementation of copy_to_user_page() and copy_from_user_page().
    
    So this patch removes the flush_cache_page() from kernel/ptrace.c,
    adding it to the arch-specific copy_{to,from}_user_page() where
    flush_cache_page is non-empty.
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    7f0424f9
ptrace.c 7.6 KB