File descriptor may leak in all libnl versions if pthreads are used.

Марк Коренберг socketpair at gmail.com
Tue Jun 14 11:17:57 EDT 2011


lib/nl.c:

-----
sk->s_fd = socket(AF_NETLINK, SOCK_RAW, protocol);
-----

should be changed to

-----
sk->s_fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, protocol);
-----

Note: SOCK_CLOEXEC should be checked in autotools via querying
fcntl(fd, F_GETFD) & FD_CLOEXEC)  after calling to socket() with
SOCK_CLOEXEC

-- 
Segmentation fault



More information about the libnl mailing list