git: kernel - Fix sendfile() bugs / nginx

Matthew Dillon dillon at crater.dragonflybsd.org
Sat Aug 23 10:58:48 PDT 2014


commit 799312a2b6e22a583d98633ea6b62146afa8eb45
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sat Aug 23 10:53:25 2014 -0700

    kernel - Fix sendfile() bugs / nginx
    
    * Fix a sendfile() bug tickled by nginx.  When sending partial file bodies the
      nbytes test was improperly included the header bytes in its file body limit
      test.  This caused sendfile() to return 0 (complete success) but not
      actually output the entirety of the requested file segment.
    
    * sendfile() now holds VM pages instead of wiring them.  Wiring the pages
      prevents truncation operations from succeeded and can further cause a
      kernel panic if the underlying file is deleted and the descriptor is
      closed while mbufs related to the sendfile() are still pending on the
      socket.
    
    Massive-debugging-by: joris

Summary of changes:
 sys/kern/uipc_syscalls.c | 43 +++++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/799312a2b6e22a583d98633ea6b62146afa8eb45


-- 
DragonFly BSD source repository



More information about the Commits mailing list