Skip to content

Commit 3087a6f

Browse files
Christoph Hellwigdavem330
authored andcommitted
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: a7b75c5 ("net: pass a sockptr_t into ->setsockopt") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d2d9a6d commit 3087a6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netrom/af_netrom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static int nr_setsockopt(struct socket *sock, int level, int optname,
306306
if (optlen < sizeof(unsigned int))
307307
return -EINVAL;
308308

309-
if (copy_from_sockptr(&opt, optval, sizeof(unsigned int)))
309+
if (copy_from_sockptr(&opt, optval, sizeof(unsigned long)))
310310
return -EFAULT;
311311

312312
switch (optname) {

0 commit comments

Comments
 (0)