]> err.no Git - linux-2.6/blobdiff - net/socket.c
[PATCH] proc_mkdir() should be used to create procfs directories
[linux-2.6] / net / socket.c
index c699e93c33d72141332fdfa0c16afa87ed4a971e..dbd1a6851edd7921a46879dca01505fe02055611 100644 (file)
@@ -1700,7 +1700,9 @@ asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags)
        struct socket *sock;
        char address[MAX_SOCK_ADDR];
        struct iovec iovstack[UIO_FASTIOV], *iov = iovstack;
-       unsigned char ctl[sizeof(struct cmsghdr) + 20]; /* 20 is size of ipv6_pktinfo */
+       unsigned char ctl[sizeof(struct cmsghdr) + 20]
+                       __attribute__ ((aligned (sizeof(__kernel_size_t))));
+                       /* 20 is size of ipv6_pktinfo */
        unsigned char *ctl_buf = ctl;
        struct msghdr msg_sys;
        int err, ctl_len, iov_size, total_len;
@@ -1862,7 +1864,8 @@ asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned int flag
                if (err < 0)
                        goto out_freeiov;
        }
-       err = __put_user(msg_sys.msg_flags, COMPAT_FLAGS(msg));
+       err = __put_user((msg_sys.msg_flags & ~MSG_CMSG_COMPAT),
+                        COMPAT_FLAGS(msg));
        if (err)
                goto out_freeiov;
        if (MSG_CMSG_COMPAT & flags)