diff options
author | Christoph Hellwig <hch@lst.de> | 2022-01-04 10:21:26 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-01-04 12:36:01 +0000 |
commit | 3087a6f36ee028ec095c04a8531d7d33899b7fed (patch) | |
tree | 1343cf3615f8ef34ae0bffd9571eee9fc02aa47b /net/netrom | |
parent | d2d9a6d0b4c2b4d2cd07378e190469f030c7d126 (diff) | |
download | linux-3087a6f36ee028ec095c04a8531d7d33899b7fed.tar.gz linux-3087a6f36ee028ec095c04a8531d7d33899b7fed.tar.bz2 linux-3087a6f36ee028ec095c04a8531d7d33899b7fed.zip |
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: a7b75c5a8c41 ("net: pass a sockptr_t into ->setsockopt")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netrom')
-rw-r--r-- | net/netrom/af_netrom.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 775064cdd0ee..f1ba7dd3d253 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -306,7 +306,7 @@ static int nr_setsockopt(struct socket *sock, int level, int optname, if (optlen < sizeof(unsigned int)) return -EINVAL; - if (copy_from_sockptr(&opt, optval, sizeof(unsigned int))) + if (copy_from_sockptr(&opt, optval, sizeof(unsigned long))) return -EFAULT; switch (optname) { |