git: kernel - Refactor kern_kevent(), fix timeout overflow (ppoll() bug)

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Jun 4 16:37:55 PDT 2020


commit 7eea59b754f37d04a34589c316dcf30bcd8e2b88
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Jun 4 16:33:04 2020 -0700

    kernel - Refactor kern_kevent(), fix timeout overflow (ppoll() bug)
    
    * Fix a bug where large timeouts or very small timeouts could
      overflow the ustimeout variable.  Change the internal timeout
      cap to ensure that no overflow occurs.
    
    * Fix another bug where the internal timeout cap could cause
      ppoll() to return early.  Internal tsleep (etc) timeouts
      need to be ignored because the external timeout might be
      larger and will handle the error return for us when it is
      checked.
    
    * Refactor kern_kevent() to be somewhat more efficient.
    
    Reported-by: rsmarples

Summary of changes:
 sys/kern/kern_event.c | 166 +++++++++++++++++++++++++++++---------------------
 sys/sys/event.h       |   4 ++
 2 files changed, 101 insertions(+), 69 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7eea59b754f37d04a34589c316dcf30bcd8e2b88


-- 
DragonFly BSD source repository


More information about the Commits mailing list