Thread (53 messages) flat view 53 messages, 7 authors, 2019-05-03

Re: [PATCH 12/31] netfilter: cttimeout: remove superfluous check on layer 4 netlink functions

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2018-11-02 08:31:08
Also in: netfilter-devel

Hi Eric,

On Thu, Nov 01, 2018 at 07:57:26AM -0700, Eric Dumazet wrote:
On 10/08/2018 04:01 PM, Pablo Neira Ayuso wrote:
[...]
quoted
@@ -412,21 +406,15 @@ cttimeout_default_fill_info(struct net *net, struct sk_buff *skb, u32 portid,
 	    nla_put_u8(skb, CTA_TIMEOUT_L4PROTO, l4proto->l4proto))
 		goto nla_put_failure;
 
-	if (likely(l4proto->ctnl_timeout.obj_to_nlattr)) {
-		struct nlattr *nest_parms;
-		int ret;
-
-		nest_parms = nla_nest_start(skb,
-					    CTA_TIMEOUT_DATA | NLA_F_NESTED);
-		if (!nest_parms)
-			goto nla_put_failure;
+	nest_parms = nla_nest_start(skb, CTA_TIMEOUT_DATA | NLA_F_NESTED);
+	if (!nest_parms)
+		goto nla_put_failure;
 
-		ret = l4proto->ctnl_timeout.obj_to_nlattr(skb, NULL);
-		if (ret < 0)
-			goto nla_put_failure;
+	ret = l4proto->ctnl_timeout.obj_to_nlattr(skb, NULL);
Hi Pablo

None of the obj_to_nlattr handlers can handle a NULL pointer.
What is the intent here ?
It seems this was accidentally set to NULL here.

commit c779e849608a875448f6ffc2a5c2a15523bdcd00
Author: Florian Westphal [off-list ref]
Date:   Fri Jun 29 07:46:50 2018 +0200

    netfilter: conntrack: remove get_timeout() indirection

Just sent patches to fix this to nf-devel ML.

Thanks for reporting !
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help