| Summary: | UsePrivilegeSeparation crashed sshd under Linux 2.2 | ||
|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Mathias Koerber <mathias> |
| Component: | sshd | Assignee: | OpenSSH Bugzilla mailing list <openssh-bugs> |
| Status: | CLOSED FIXED | ||
| Severity: | major | CC: | Al.Smith |
| Priority: | P2 | ||
| Version: | -current | ||
| Hardware: | ix86 | ||
| OS: | Linux | ||
|
Description
Mathias Koerber
2002-05-28 21:32:03 AEST
Linux 2.2 defines MAP_ANON in <bits/mman.h>, however it can seen in
/usr/src/linux/mm/mmap.c (lines 200 onwards) that if MAP_ANON is used
then the system call will return -EINVAL.
The following is a quick hack to get openssh to compile on linux 2.2:
diff -ur openssh-3.3p1-orig/monitor_mm.c openssh-3.3p1/monitor_mm.c
--- openssh-3.3p1-orig/monitor_mm.c Fri Jun 7 03:57:25 2002
+++ openssh-3.3p1/monitor_mm.c Tue Jun 25 10:06:06 2002
@@ -84,6 +84,7 @@
*/
mm->mmalloc = mmalloc;
+#undef MAP_ANON
#if defined(HAVE_MMAP) && defined(MAP_ANON)
address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
-1, 0);
diff -ur openssh-3.3p1-orig/servconf.c openssh-3.3p1/servconf.c
--- openssh-3.3p1-orig/servconf.c Fri Jun 21 08:20:44 2002
+++ openssh-3.3p1/servconf.c Tue Jun 25 10:06:02 2002
@@ -257,6 +257,7 @@
if (use_privsep == -1)
use_privsep = 1;
+#undef MAP_ANON
#if !defined(HAVE_MMAP) || !defined(MAP_ANON)
if (use_privsep && options->compression == 1) {
error("This platform does not support both privilege "
Fixed in CVS tree. Mass change of RESOLVED bugs to CLOSED |