mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 21:45:45 +02:00
netrom: fix copying in user data in nr_setsockopt
commit3087a6f36eupstream. This code used to copy in an unsigned long worth of data before the sockptr_t conversion, so restore that. Fixes:a7b75c5a8c("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
beeb0fdeda
commit
a7c2cae997
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user