[InterNetNews/inn] 69ee8b: innd: Ensure channels do not have a large fd

Julien ÉLIE noreply at github.com
Sun Jul 9 12:24:47 UTC 2023


  Branch: refs/heads/main
  Home:   https://github.com/InterNetNews/inn
  Commit: 69ee8b6d0df48dd6bef129dc5bdc7c4328e2de90
      https://github.com/InterNetNews/inn/commit/69ee8b6d0df48dd6bef129dc5bdc7c4328e2de90
  Author: Julien ÉLIE <Julien-Elie at users.noreply.github.com>
  Date:   2023-07-09 (Sun, 09 Jul 2023)

  Changed paths:
    M doc/pod/libinn.pod
    M doc/pod/news.pod
    M include/inn/libinn.h
    M innd/cc.c
    M innd/chan.c
    M innd/innd.c
    M innd/lc.c
    M innd/rc.c
    M innd/site.c
    M innfeed/endpoint.c
    M lib/fdlimit.c
    M tests/innd/chan-t.c

  Log Message:
  -----------
  innd: Ensure channels do not have a large fd

innd no longer malfunctions nor throttles when the maximum number of
file descriptors supported by the system is reached.  It was happily
select'ing on those and corrupting data structures in memory.

Add a new function isvalidfd() in lib/fdlimit.c used by innfeed and
innd.  Call it before CHANcreate() and NCcreate() so that they do not
create a channel with a too high file descriptor.

Also limit the file descriptors to (sizeof(fd_set) * CHAR_BIT - 1) when
FD_SETSIZE is not set.

Thanks to Jesse Rehmer for the bug report.

close #273




More information about the inn-committers mailing list