* Fix stack alignment for clone()
authorMiklos Szeredi <miklos@szeredi.hu>
Thu, 18 Feb 2010 11:05:13 +0000 (11:05 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Thu, 18 Feb 2010 11:05:13 +0000 (11:05 +0000)
ChangeLog
include/fuse_lowlevel.h
util/fusermount.c

index fdb281d895a72ce979b601d0d9da23a317cab3cd..c4a949b1bfa49c0f7937acbac44c7c688541eddf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-03  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Fix stack alignment for clone()
+
 2010-02-01  Miklos Szeredi <miklos@szeredi.hu>
 
        * Released 2.8.3
index 8c04cd4c52fe1d7362f376f184b20805694e0b02..2855e51d868ab3acf42ad3e1c026845174b50b44 100644 (file)
@@ -411,6 +411,7 @@ struct fuse_lowlevel_ops {
         *
         * Valid replies:
         *   fuse_reply_buf
+        *   fuse_reply_iov
         *   fuse_reply_err
         *
         * @param req request handle
index f0d87323f3ce4176b8d90dee1e2d80d4c4aa0425..6123c66e30b4f6b3c6f0ddea0086d9184ffbc2f5 100644 (file)
@@ -262,9 +262,8 @@ static int check_is_mount_child(void *p)
 
 static pid_t clone_newns(void *a)
 {
-       long long buf[16384];
-       size_t stacksize = sizeof(buf) / 2;
-       char *stack = ((char *) buf) + stacksize;
+       char buf[131072];
+       char *stack = buf + (sizeof(buf) / 2 - ((size_t) buf & 15));
 
 #ifdef __ia64__
        extern int __clone2(int (*fn)(void *),
@@ -272,8 +271,8 @@ static pid_t clone_newns(void *a)
                            int flags, void *arg, pid_t *ptid,
                            void *tls, pid_t *ctid);
 
-       return __clone2(check_is_mount_child, stack, stacksize, CLONE_NEWNS, a,
-                       NULL, NULL, NULL);
+       return __clone2(check_is_mount_child, stack, sizeof(buf) / 2,
+                       CLONE_NEWNS, a, NULL, NULL, NULL);
 #else
        return clone(check_is_mount_child, stack, CLONE_NEWNS, a);
 #endif