1. 23 Jun, 2008 4 commits
    • Nick Piggin's avatar
      mm: fix race in COW logic · 945754a1
      Nick Piggin authored
      There is a race in the COW logic.  It contains a shortcut to avoid the
      COW and reuse the page if we have the sole reference on the page,
      however it is possible to have two racing do_wp_page()ers with one
      causing the other to mistakenly believe it is safe to take the shortcut
      when it is not.  This could lead to data corruption.
      
      Process 1 and process2 each have a wp pte of the same anon page (ie.
      one forked the other).  The page's mapcount is 2.  Then they both
      attempt to write to it around the same time...
      
        proc1				proc2 thr1			proc2 thr2
        CPU0				CPU1				CPU3
        do_wp_page()			do_wp_page()
      				 trylock_page()
      				  can_share_swap_page()
      				   load page mapcount (==2)
      				  reuse = 0
      				 pte unlock
      				 copy page to new_page
      				 pte lock
      				 page_remove_rmap(page);
         trylock_page()
          can_share_swap_page()
           load page mapcount (==1)
          reuse = 1
         ptep_set_access_flags (allow W)
      
        write private key into page
      								read from page
      				ptep_clear_flush()
      				set_pte...
      945754a1
    • Linus Torvalds's avatar
      Fix ZERO_PAGE breakage with vmware · 672ca28e
      Linus Torvalds authored
      Commit 89f5b7da
      
       ("Reinstate ZERO_PAGE
      optimization in 'get_user_pages()' and fix XIP") broke vmware, as
      reported by Jeff Chua:
      
        "This broke vmware 6.0.4.
         Jun 22 14:53:03.845: vmx| NOT_IMPLEMENTED
         /build/mts/release/bora-93057/bora/vmx/main/vmmonPosix.c:774"
      
      and the reason seems to be that there's an old bug in how we handle do
      FOLL_ANON on VM_SHARED areas in get_user_pages(), but since it only
      triggered if the whole page table was missing, nobody had apparently hit
      it before.
      
      The recent changes to 'follow_page()' made the FOLL_ANON logic trigger
      not just for whole missing page tables, but for individual pages as
      well, and exposed this problem.
      
      This fixes it by making the test for when FOLL_ANON is used more
      careful, and also makes the code easier to read and understand by moving
      the logic to a separate inline function.
      Reported-and-tested-by: default avatarJeff Chua <jeff.chua.linux@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      672ca28e
    • Gustavo Fernando Padovan's avatar
      removed unused var real_tty on n_tty_ioctl() · 96a331b1
      Gustavo Fernando Padovan authored
      
      I noted that the 'struct tty_struct *real_tty' is not used in this
      function, so I removed the code about 'real_tty'.
      Signed-off-by: default avatarGustavo Fernando Padovan <gustavo@las.ic.unicamp.br>
      Acked-by: default avatarAlan Cox <alan@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      96a331b1
    • Alan Cox's avatar
      tty_driver: Update required method documentation · 36c7343b
      Alan Cox authored
      
      Some of the requirement rules are now more relaxed. Also correct a
      contradiction in the previous update
      Signed-off-by: default avatarAlan Cox <alan@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      36c7343b
  2. 22 Jun, 2008 1 commit
  3. 21 Jun, 2008 9 commits
  4. 20 Jun, 2008 26 commits