summaryrefslogtreecommitdiffstats
path: root/net/core/scm.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-04-16 11:35:38 -0700
committerDavid S. Miller <davem@davemloft.net>2021-04-16 11:41:07 -0700
commite7ad33fa7bc5f788cdb14eea68c65c4da0f06edf (patch)
tree3960209242c0498745155bce657875612e589982 /net/core/scm.c
parent392c36e5be1dee19ffce8c8ba8f07f90f5aa3f7c (diff)
downloadlinux-e7ad33fa7bc5f788cdb14eea68c65c4da0f06edf.tar.bz2
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/core/scm.c')
-rw-r--r--net/core/scm.c2
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,