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:   Thu, 14 Dec 2017 13:30:08 +0100
From:   Pablo Neira Ayuso <pablo@...filter.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Debabrata Banerjee <dbanerje@...mai.com>,
        "David S . Miller" <davem@...emloft.net>,
        netfilter-devel@...r.kernel.org, coreteam@...filter.org,
        netdev@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] Fix handling of verdicts after NF_QUEUE

Hi Greg,

I'd appreciate if you can take this patch into 4.9-stable. There is no
similar patch in tree, so this is not a backport.

On Wed, Dec 13, 2017 at 03:33:37PM -0500, Debabrata Banerjee wrote:
> A verdict of NF_STOLEN after NF_QUEUE will cause an incorrect return value
> and a potential kernel panic via double free of skb's
> 
> This was broken by commit 7034b566a4e7 ("netfilter: fix nf_queue handling")
> and subsequently fixed in v4.10 by commit c63cbc460419 ("netfilter:
> use switch() to handle verdict cases from nf_hook_slow()"). However that
> commit cannot be cleanly cherry-picked to v4.9
> 
> Signed-off-by: Debabrata Banerjee <dbanerje@...mai.com>

Acked-by: Pablo Neira Ayuso <pablo@...filter.org>

Thanks a lot!

> ---
> 
> This fix is only needed for v4.9 stable since v4.10+ does not have the
> issue
> ---
>  net/netfilter/core.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/net/netfilter/core.c b/net/netfilter/core.c
> index 004af030ef1a..d869ea50623e 100644
> --- a/net/netfilter/core.c
> +++ b/net/netfilter/core.c
> @@ -364,6 +364,11 @@ int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state)
>  		ret = nf_queue(skb, state, &entry, verdict);
>  		if (ret == 1 && entry)
>  			goto next_hook;
> +	} else {
> +		/* Implicit handling for NF_STOLEN, as well as any other
> +		 * non conventional verdicts.
> +		 */
> +		ret = 0;
>  	}
>  	return ret;
>  }
> -- 
> 2.15.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ