diff options
Diffstat (limited to 'net/compat.c')
-rw-r--r-- | net/compat.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/compat.c b/net/compat.c index 6ded6c821d7a..22381719718c 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -185,6 +185,13 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, | |||
185 | ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); | 185 | ucmsg = cmsg_compat_nxthdr(kmsg, ucmsg, ucmlen); |
186 | } | 186 | } |
187 | 187 | ||
188 | /* | ||
189 | * check the length of messages copied in is the same as the | ||
190 | * what we get from the first loop | ||
191 | */ | ||
192 | if ((char *)kcmsg - (char *)kcmsg_base != kcmlen) | ||
193 | goto Einval; | ||
194 | |||
188 | /* Ok, looks like we made it. Hook it up and return success. */ | 195 | /* Ok, looks like we made it. Hook it up and return success. */ |
189 | kmsg->msg_control = kcmsg_base; | 196 | kmsg->msg_control = kcmsg_base; |
190 | kmsg->msg_controllen = kcmlen; | 197 | kmsg->msg_controllen = kcmlen; |