Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9d717a7 authored by Alex Williamson's avatar Alex Williamson Committed by David S. Miller
Browse files

[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: default avatarAlex Williamson <alex.williamson@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ddec746
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;