kernel - Document bugs in sendfile that we currently punt on
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 14 Jun 2013 01:32:19 +0000 (18:32 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 14 Jun 2013 01:32:19 +0000 (18:32 -0700)
commit77bf246999b6cb9b4e6a8962a1283d17b2430e54
treebaf9460b3956806dd4b230d9244b7f3a06d6b88b
parent984b6021df55b2feafc869d8fa5d29d3ee1e678e
kernel - Document bugs in sendfile that we currently punt on

* sendfile tries to soft-busy the VM pages it backs the mbuf with.  This
  is meant to prevent the VM page's data from being modified while TCP
  is playing with it.  However, it doesn't work.  There are two issues.

* (1) The page still may be mmap()'d writable.  A simple vm_page_protect()
      would fix this.

* (2) The page may be associated with a buffer cache buffer and can be
      modified via a VOP_WRITE through that buffer regardless of whether
      soft-busy or busy is set.  This is a real problem.

      Even if we find and discard the buffer it can just be reinstantiated
      and wind up with the same problem.

From-discussion-with: jeffr, rookie on IRC
sys/kern/uipc_syscalls.c