mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:35:06 -05:00
ntp: fix handling of socket errors with error queue
In the next Linux version the recvmmsg() system call will be probably fixed to not return socket errors (e.g. due to ICMP) when reading from the error queue. The NTP I/O code assumed this was the correct behavior. When the system call is fixed, a socket error on a client socket will cause chronyd to enter a busy loop consuming the CPU until the receive timeout is reached (8 seconds by default). Use getsockopt(SO_ERROR) to clear the socket error when reading from the error queue failed.
This commit is contained in:
@@ -497,7 +497,7 @@ SYS_Linux_EnableSystemCallFilter(int level)
|
||||
SCMP_SYS(lseek), SCMP_SYS(rename), SCMP_SYS(stat), SCMP_SYS(stat64),
|
||||
SCMP_SYS(statfs), SCMP_SYS(statfs64), SCMP_SYS(unlink),
|
||||
/* Socket */
|
||||
SCMP_SYS(bind), SCMP_SYS(connect), SCMP_SYS(getsockname),
|
||||
SCMP_SYS(bind), SCMP_SYS(connect), SCMP_SYS(getsockname), SCMP_SYS(getsockopt),
|
||||
SCMP_SYS(recvfrom), SCMP_SYS(recvmmsg), SCMP_SYS(recvmsg),
|
||||
SCMP_SYS(sendmmsg), SCMP_SYS(sendmsg), SCMP_SYS(sendto),
|
||||
/* TODO: check socketcall arguments */
|
||||
|
||||
Reference in New Issue
Block a user