提交 b9d717a7 编写于 作者: A Alex Williamson 提交者: David S. Miller

[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: NAlex Williamson <alex.williamson@hp.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8ddec746
...@@ -1700,7 +1700,9 @@ asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags) ...@@ -1700,7 +1700,9 @@ asmlinkage long sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags)
struct socket *sock; struct socket *sock;
char address[MAX_SOCK_ADDR]; char address[MAX_SOCK_ADDR];
struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; 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; unsigned char *ctl_buf = ctl;
struct msghdr msg_sys; struct msghdr msg_sys;
int err, ctl_len, iov_size, total_len; int err, ctl_len, iov_size, total_len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册