Commit 3087a6f3 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David S. Miller

netrom: fix copying in user data in nr_setsockopt

This code used to copy in an unsigned long worth of data before
the sockptr_t conversion, so restore that.

Fixes: a7b75c5a ("net: pass a sockptr_t into ->setsockopt")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2d9a6d0
...@@ -306,7 +306,7 @@ static int nr_setsockopt(struct socket *sock, int level, int optname, ...@@ -306,7 +306,7 @@ static int nr_setsockopt(struct socket *sock, int level, int optname,
if (optlen < sizeof(unsigned int)) if (optlen < sizeof(unsigned int))
return -EINVAL; return -EINVAL;
if (copy_from_sockptr(&opt, optval, sizeof(unsigned int))) if (copy_from_sockptr(&opt, optval, sizeof(unsigned long)))
return -EFAULT; return -EFAULT;
switch (optname) { switch (optname) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment