Commit e7ad33fa authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

scm: fix a typo in put_cmsg()

We need to store cmlen instead of len in cm->cmsg_len.

Fixes: 38ebcf50 ("scm: optimize put_cmsg()")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 392c36e5
...@@ -232,7 +232,7 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data) ...@@ -232,7 +232,7 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
if (!user_write_access_begin(cm, cmlen)) if (!user_write_access_begin(cm, cmlen))
goto efault; goto efault;
unsafe_put_user(len, &cm->cmsg_len, efault_end); unsafe_put_user(cmlen, &cm->cmsg_len, efault_end);
unsafe_put_user(level, &cm->cmsg_level, efault_end); unsafe_put_user(level, &cm->cmsg_level, efault_end);
unsafe_put_user(type, &cm->cmsg_type, efault_end); unsafe_put_user(type, &cm->cmsg_type, efault_end);
unsafe_copy_to_user(CMSG_USER_DATA(cm), data, unsafe_copy_to_user(CMSG_USER_DATA(cm), data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment