sock: unlock on error in sock_setsockopt()
Subsystems (4)
PATCH 1/1 sock: unlock on error in sock_setsockopt()
If copy_from_sockptr() then we need to unlock before returning.
Fixes d463126e23f1 ("net: sock: extend SO_TIMESTAMPING for PHC binding")
Signed-off-by Dan Carpenter <[email protected]>
--- net/core/sock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/core/sock.c +4 -2
@@ -1123,8 +1123,10 @@ int sock_setsockopt(struct socket *sock, int level, int optname,case SO_TIMESTAMPING_OLD :if (optlen ==sizeof (timestamping)) {if (copy_from_sockptr (×tamping, optval, -sizeof (timestamping))) -return -EFAULT ; +sizeof (timestamping))) { + ret = -EFAULT ; +break ; + } }else {memset (×tamping,0 ,sizeof (timestamping)); timestamping.flags = val;
Signature · 1 line
2.30.2
This patch was applied to netdev/net.git (refs/heads/master):
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
Quoted 7 lines · On Wed, 7 Jul 2021 13:01:00 +0300 you wrote:
If
copy_from_sockptr()then we need to unlock before returning.Fixes d463126e23f1 ("net: sock: extend SO_TIMESTAMPING for PHC binding")Signed-off-by Dan Carpenter <[email protected]>--- net/core/sock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Here is the summary with links:
- [net] sock: unlock on error in sock_setsockopt()
https://git.kernel.org/netdev/net/c/271dbc318432
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html