mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
net: Assert at build time the assumptions we make about the CMSG header.
It must always be the case that CMSG_ALIGN(sizeof(hdr)) == sizeof(hdr). Otherwise there are missing adjustments in the various calculations that parse and build these things. Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
1ff8cebf49
commit
ac4340fc3c
2 changed files with 5 additions and 0 deletions
|
|
@ -130,6 +130,9 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk,
|
|||
__kernel_size_t kcmlen, tmp;
|
||||
int err = -EFAULT;
|
||||
|
||||
BUILD_BUG_ON(sizeof(struct compat_cmsghdr) !=
|
||||
CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)));
|
||||
|
||||
kcmlen = 0;
|
||||
kcmsg_base = kcmsg = (struct cmsghdr *)stackbuf;
|
||||
ucmsg = CMSG_COMPAT_FIRSTHDR(kmsg);
|
||||
|
|
|
|||
Loading…
Reference in a new issue