From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752736AbdF3UXa (ORCPT ); Fri, 30 Jun 2017 16:23:30 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44724 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752526AbdF3UX3 (ORCPT ); Fri, 30 Jun 2017 16:23:29 -0400 Subject: Re: nf_conntrack: Infoleak via CTA_ID and CTA_EXPECT_ID To: Florian Westphal Cc: "linux-kernel@vger.kernel.org" , Pablo Neira Ayuso , David Miller , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, "netdev@vger.kernel.org" , David Gstir , kaber@trash.net, "keescook@chromium.org" References: <20170630193544.GM9307@breakpoint.cc> <20170630195547.GN9307@breakpoint.cc> From: Richard Weinberger Message-ID: Date: Fri, 30 Jun 2017 22:23:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170630195547.GN9307@breakpoint.cc> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Florian, Am 30.06.2017 um 21:55 schrieb Florian Westphal: >>> Why not use a hash of the address? >> >> Would also work. Or xor it with a random number. >> >> On the other hand, for user space it would be more useful when the conntrack id >> does not repeat that often. That's why I favor the good old counter method. >> Currently the conntrack id is reused very fast. >> e.g. in one of our applications we use the conntack id via NFQUEUE and watch the >> destroy events via conntrack. It happens regularly that a new connection has the >> same id than a different connection we saw some moments before, before we receive >> the destroy event from the conntrack socket. > > Perhaps we can place that in a new extension (its not needed in any > fastpath ops)? To get rid of the infoleak we have to re-introduce the id field in struct nf_conn and struct nf_conntrack_expect. Otherwise have nothing to compare against in the conntrack/expect remove case. So the only question is what to store, IMHO a counter that can wrap around is the cheapest method and would also not harm the fast-path. Thanks, //richard