summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@hp.com>2005-09-26 14:28:02 -0700
committerDavid S. Miller <davem@davemloft.net>2005-09-26 14:28:02 -0700
commitb9d717a7b413f227ebb2d61d9c118335f7292137 (patch)
treefc1bd234ab42678c08a06bcf72a92ea1497c69b6 /net
parent8ddec7460d2f5db3ac35812c03676b1473d1d668 (diff)
downloadlinux-b9d717a7b413f227ebb2d61d9c118335f7292137.tar.bz2
[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')
-rw-r--r--net/socket.c4
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)
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;