FreeBSD Bugzilla – Attachment 229835 Details for
Bug 260126
syslog(3) spins the CPU with 4180 byte messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
syslog.c.diff
syslog.c.diff (text/plain), 823 bytes, created by
Dmitry Wagin
on 2021-12-01 21:45:50 UTC
(
hide
)
Description:
syslog.c.diff
Filename:
MIME Type:
Creator:
Dmitry Wagin
Created:
2021-12-01 21:45:50 UTC
Size:
823 bytes
patch
obsolete
>diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c >index 797c7389d..d62f29999 100644 >--- a/lib/libc/gen/syslog.c >+++ b/lib/libc/gen/syslog.c >@@ -308,6 +308,7 @@ vsyslog1(int pri, const char *fmt, va_list ap) > */ > > if (send(LogFile, tbuf, cnt, 0) < 0) { >+ int attempt = 1; > if (errno != ENOBUFS) { > /* > * Scenario 1: syslogd was restarted >@@ -322,7 +323,7 @@ vsyslog1(int pri, const char *fmt, va_list ap) > * possible scenario 2 > */ > } >- while (errno == ENOBUFS) { >+ while (errno == ENOBUFS && attempt < 1024) { > /* > * Scenario 2: out of socket buffer space > * possible DoS, fail fast on a privileged >@@ -333,6 +334,7 @@ vsyslog1(int pri, const char *fmt, va_list ap) > _usleep(1); > if (send(LogFile, tbuf, cnt, 0) >= 0) > return; >+ attempt++; > } > } else > return;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 260126
: 229835