Skip to content

Commit d9d5fea

Browse files
Local privilege escalation when using daemon mode. (CVE-2014-0240)
1 parent 4fbddb6 commit d9d5fea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

mod_wsgi.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10756,6 +10756,19 @@ static void wsgi_setup_access(WSGIDaemonProcess *daemon)
1075610756
ap_log_error(APLOG_MARK, WSGI_LOG_ALERT(errno), wsgi_server,
1075710757
"mod_wsgi (pid=%d): Unable to change to uid=%ld.",
1075810758
getpid(), (long)daemon->group->uid);
10759+
10760+
/*
10761+
* On true UNIX systems this should always succeed at
10762+
* this point. With certain Linux kernel versions though
10763+
* we can get back EAGAIN where the target user had
10764+
* reached their process limit. In that case will be left
10765+
* running as wrong user. Just exit on all failures to be
10766+
* safe. Don't die immediately to avoid a fork bomb.
10767+
*/
10768+
10769+
sleep(20);
10770+
10771+
exit(-1);
1075910772
}
1076010773

1076110774
/*

0 commit comments

Comments
 (0)