diff options
author | Alex Williamson <alex.williamson@hp.com> | 2005-09-26 17:28:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-26 17:28:02 -0400 |
commit | b9d717a7b413f227ebb2d61d9c118335f7292137 (patch) | |
tree | fc1bd234ab42678c08a06bcf72a92ea1497c69b6 /net/socket.c | |
parent | 8ddec7460d2f5db3ac35812c03676b1473d1d668 (diff) |
[NET]: Make sure ctl buffer is aligned properly in sys_sendmsg().
It's on the stack and declared as "unsigned char[]", but pointers
and similar can be in here thus we need to give it an explicit
alignment attribute.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c index f9264472377f..dbd1a6851edd 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1700,7 +1700,9 @@ asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) | |||
1700 | struct socket *sock; | 1700 | struct socket *sock; |
1701 | char address[MAX_SOCK_ADDR]; | 1701 | char address[MAX_SOCK_ADDR]; |
1702 | struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; | 1702 | struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; |
1703 | unsigned char ctl[sizeof(struct cmsghdr) + 20]; /* 20 is size of ipv6_pktinfo */ | 1703 | unsigned char ctl[sizeof(struct cmsghdr) + 20] |
1704 | __attribute__ ((aligned (sizeof(__kernel_size_t)))); | ||
1705 | /* 20 is size of ipv6_pktinfo */ | ||
1704 | unsigned char *ctl_buf = ctl; | 1706 | unsigned char *ctl_buf = ctl; |
1705 | struct msghdr msg_sys; | 1707 | struct msghdr msg_sys; |
1706 | int err, ctl_len, iov_size, total_len; | 1708 | int err, ctl_len, iov_size, total_len; |