[Bug 259] UsePrivilegeSeparation crashed sshd under Linux 2.2

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue Jun 25 18:09:41 EST 2002


http://bugzilla.mindrot.org/show_bug.cgi?id=259





------- Additional Comments From Al.Smith at gold.net  2002-06-25 18:09 -------
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 "




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the openssh-unix-dev mailing list