Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167578379
D29972.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
707 B
Referenced Files
None
Subscribers
None
D29972.diff
View Options
Index: sshd.c
===================================================================
--- sshd.c
+++ sshd.c
@@ -46,6 +46,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
+#include <sys/mman.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
@@ -2026,6 +2027,10 @@
/* Reinitialize the log (because of the fork above). */
log_init(__progname, options.log_level, options.log_facility, log_stderr);
+ /* Avoid killing the process in high-pressure swapping environments. */
+ if (!inetd_flag && madvise(NULL, 0, MADV_PROTECT) != 0)
+ debug("madvise(): %.200s", strerror(errno));
+
/*
* Chdir to the root directory so that the current disk can be
* unmounted if desired.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 23, 8:17 PM (4 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37091241
Default Alt Text
D29972.diff (707 B)
Attached To
Mode
D29972: sshd: avoid OOM kill
Attached
Detach File
Event Timeline
Log In to Comment