scm: fix a typo in put_cmsg()
Subsystems (3)
PATCH 1/1 scm: fix a typo in put_cmsg()
From: Eric Dumazet <[email protected]>
We need to store cmlen instead of len in cm->cmsg_len.
--- net/core/scm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/scm.c +1 -1
@@ -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,
Signature · 1 line
2.31.1.368.gbe11c130af-goog
Quoted 7 lines · Eric Dumazet
From: Eric Dumazet <[email protected]>
We need to store cmlen instead of len in
cm->cmsg_len.Fixes 38ebcf5096a8 ("scm: optimize put_cmsg()")Signed-off-by Eric Dumazet <[email protected]>Reported-by Jakub Kicinski <[email protected]>
(I was about to bisect, but then noticed the report from Jakub)
Thanks!
Quoted 7 lines · On Fri, 16 Apr 2021 11:35:38 -0700 Eric Dumazet wrote:
From: Eric Dumazet <[email protected]>
We need to store cmlen instead of len in
cm->cmsg_len.Fixes 38ebcf5096a8 ("scm: optimize put_cmsg()")Signed-off-by Eric Dumazet <[email protected]>Reported-by Jakub Kicinski <[email protected]>
FWIW can confirm it fixes the issue:
Thanks!
This patch was applied to netdev/net-next.git (refs/heads/master):
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Fri, 16 Apr 2021 11:35:38 -0700 you wrote:
From: Eric Dumazet <[email protected]>
We need to store cmlen instead of len in
cm->cmsg_len.Fixes 38ebcf5096a8 ("scm: optimize put_cmsg()")Signed-off-by Eric Dumazet <[email protected]>Reported-by Jakub Kicinski <[email protected]>[...]
Here is the summary with links:
- [net-next] scm: fix a typo in put_cmsg()
https://git.kernel.org/netdev/net-next/c/e7ad33fa7bc5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html