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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Sep 2016 08:59:14 +0200
From:   Florian Westphal <fw@...len.de>
To:     fgao@...ai8.com
Cc:     pablo@...filter.org, netfilter-devel@...r.kernel.org,
        coreteam@...filter.org, netdev@...r.kernel.org,
        gfree.wind@...il.com
Subject: Re: [PATCH v2 1/2 nf] netfilter: seqadj: Fix one possible panic in
 seqadj when mem is exhausted

fgao@...ai8.com <fgao@...ai8.com> wrote:
> From: Gao Feng <fgao@...ai8.com>
> 
> When memory is exhausted, nfct_seqadj_ext_add may fail to add the seqadj
> extension. But the function nf_ct_seqadj_init doesn't check if get valid
> seqadj pointer by the nfct_seqadj, while other functions perform the
> sanity check.
> 
> So the system would be panic when nfct_seqadj_ext_add failed.
> 
> Signed-off-by: Gao Feng <fgao@...ai8.com>

> diff --git a/net/netfilter/nf_conntrack_seqadj.c b/net/netfilter/nf_conntrack_seqadj.c
> index dff0f0c..2c8e201 100644
> --- a/net/netfilter/nf_conntrack_seqadj.c
> +++ b/net/netfilter/nf_conntrack_seqadj.c
> @@ -16,9 +16,14 @@ int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
>  	if (off == 0)
>  		return 0;
>  
> +	seqadj = nfct_seqadj(ct);
> +	if (unlikely(!seqadj)) {
> +		WARN_ONCE(1, "Missing nfct_seqadj_ext_add() setup call\n");
> +		return 0;
> +	}
> +

Not sure this WARN() is really needed, I would remove it (since its most
likely only missing due to memory shortage).

Other than that, this looks good.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ