All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] scm: fix a typo in put_cmsg()
@ 2021-04-16 18:35 Eric Dumazet
  2021-04-16 18:40 ` Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eric Dumazet @ 2021-04-16 18:35 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski; +Cc: netdev, Eric Dumazet, Eric Dumazet

From: Eric Dumazet <edumazet@google.com>

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>
---
 net/core/scm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/scm.c b/net/core/scm.c
index bd96c922041d22a2f3b7ee73e4b3183316f9b616..ae3085d9aae8adb81d3bb42c8a915a205476a0ee 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,
-- 
2.31.1.368.gbe11c130af-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] scm: fix a typo in put_cmsg()
  2021-04-16 18:35 [PATCH net-next] scm: fix a typo in put_cmsg() Eric Dumazet
@ 2021-04-16 18:40 ` Ido Schimmel
  2021-04-16 18:43 ` Jakub Kicinski
  2021-04-16 18:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2021-04-16 18:40 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David S . Miller, Jakub Kicinski, netdev, Eric Dumazet

On Fri, Apr 16, 2021 at 11:35:38AM -0700, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> 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>

Tested-by: Ido Schimmel <idosch@nvidia.com>

(I was about to bisect, but then noticed the report from Jakub)

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] scm: fix a typo in put_cmsg()
  2021-04-16 18:35 [PATCH net-next] scm: fix a typo in put_cmsg() Eric Dumazet
  2021-04-16 18:40 ` Ido Schimmel
@ 2021-04-16 18:43 ` Jakub Kicinski
  2021-04-16 18:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2021-04-16 18:43 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David S . Miller, netdev, Eric Dumazet

On Fri, 16 Apr 2021 11:35:38 -0700 Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> 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>

FWIW can confirm it fixes the issue:

Tested-by: Jakub Kicinski <kuba@kernel.org>

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] scm: fix a typo in put_cmsg()
  2021-04-16 18:35 [PATCH net-next] scm: fix a typo in put_cmsg() Eric Dumazet
  2021-04-16 18:40 ` Ido Schimmel
  2021-04-16 18:43 ` Jakub Kicinski
@ 2021-04-16 18:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-16 18:50 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, kuba, netdev, edumazet

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Fri, 16 Apr 2021 11:35:38 -0700 you wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> 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>
> 
> [...]

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-16 18:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 18:35 [PATCH net-next] scm: fix a typo in put_cmsg() Eric Dumazet
2021-04-16 18:40 ` Ido Schimmel
2021-04-16 18:43 ` Jakub Kicinski
2021-04-16 18:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.