diff options
author | Eric Dumazet <edumazet@google.com> | 2021-04-16 11:35:38 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-16 11:41:07 -0700 |
commit | e7ad33fa7bc5f788cdb14eea68c65c4da0f06edf (patch) | |
tree | 3960209242c0498745155bce657875612e589982 /net | |
parent | 392c36e5be1dee19ffce8c8ba8f07f90f5aa3f7c (diff) |
scm: fix a typo in put_cmsg()
We need to store cmlen instead of len in cm->cmsg_len.
Fixes: 38ebcf5096a8 ("scm: optimize put_cmsg()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/scm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/scm.c b/net/core/scm.c index bd96c922041d..ae3085d9aae8 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -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)) 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(type, &cm->cmsg_type, efault_end); unsafe_copy_to_user(CMSG_USER_DATA(cm), data, |