lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 8 Jan 2019 21:01:41 +0100 (CET)
From:   Kadlecsik József 
        <kadlecsik.jozsef@...ner.mta.hu>
To:     Aditya Pakki <pakki001@....edu>
cc:     kjlu@....edu, Pablo Neira Ayuso <pablo@...filter.org>,
        Florian Westphal <fw@...len.de>,
        "David S. Miller" <davem@...emloft.net>,
        Kirill Tkhai <ktkhai@...tuozzo.com>,
        Stefano Brivio <sbrivio@...hat.com>,
        "Gustavo A. R. Silva" <garsilva@...eddedor.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>,
        netfilter-devel@...r.kernel.org, coreteam@...filter.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [v2] netfilter: ipset: fix a missing check of
 nla_parse

Hi,

On Sat, 5 Jan 2019, Aditya Pakki wrote:

> When nla_parse fails, we should not use the results (the first
> argument). The fix checks if it fails, and if so, returns its error code
> upstream.

Patch is applied in the ipset git tree, thanks!

Best regards,
Jozsef

> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
>  net/netfilter/ipset/ip_set_core.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
> index 45a257695bef..3ee0fda05a3b 100644
> --- a/net/netfilter/ipset/ip_set_core.c
> +++ b/net/netfilter/ipset/ip_set_core.c
> @@ -1546,8 +1546,13 @@ call_ad(struct sock *ctnl, struct sk_buff *skb, struct ip_set *set,
>  		memcpy(&errmsg->msg, nlh, nlh->nlmsg_len);
>  		cmdattr = (void *)&errmsg->msg + min_len;
>  
> -		nla_parse(cda, IPSET_ATTR_CMD_MAX, cmdattr,
> -			  nlh->nlmsg_len - min_len, ip_set_adt_policy, NULL);
> +		ret = nla_parse(cda, IPSET_ATTR_CMD_MAX, cmdattr,
> +				nlh->nlmsg_len - min_len, ip_set_adt_policy,
> +				NULL);
> +		if (ret) {
> +			nlmsg_free(skb2);
> +			return ret;
> +		}
>  
>  		errline = nla_data(cda[IPSET_ATTR_LINENO]);
>  
> -- 
> 2.17.1
> 
> 

--
E-mail : kadlecsik.jozsef@...ner.mta.hu
PGP key: http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address: Wigner Research Centre for Physics, Hungarian Academy of Sciences
         H-1525 Budapest 114, POB. 49, Hungary

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ