]> git.ipfire.org Git - thirdparty/ipset.git/commit
netfilter: ipset: Fix an error code in ip_set_sockfn_get()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 24 Aug 2019 14:49:55 +0000 (17:49 +0300)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Tue, 27 Aug 2019 18:20:14 +0000 (20:20 +0200)
commit7d9883dcdd90f09b8c0fb82781e74f1755966d3e
tree020dd1a7f7227d50022bba1c7701d259a1c9b626
parentb57ed2b171da53550e1b2068ca4a007d95b5e868
netfilter: ipset: Fix an error code in ip_set_sockfn_get()

The copy_to_user() function returns the number of bytes remaining to be
copied.  In this code, that positive return is checked at the end of the
function and we return zero/success.  What we should do instead is
return -EFAULT.

Fixes: a7b4f989a629 ("netfilter: ipset: IP set core support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
kernel/net/netfilter/ipset/ip_set_core.c