From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754519AbdGLV0o (ORCPT ); Wed, 12 Jul 2017 17:26:44 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44723 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754465AbdGLV0m (ORCPT ); Wed, 12 Jul 2017 17:26:42 -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> <20170701103504.GO9307@breakpoint.cc> From: Richard Weinberger Message-ID: <1daf1401-5009-df1c-a77a-a271811c0760@nod.at> Date: Wed, 12 Jul 2017 23:26:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170701103504.GO9307@breakpoint.cc> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Florian, Am 01.07.2017 um 12:35 schrieb Florian Westphal: >>> 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. > > Why will this not work? You are right, when we compute the ID from the whole object, it should be fine. >> Otherwise have nothing to compare against in the conntrack/expect remove case. > > Not following, sorry. The id is not used anywhere except when we send > info to userspace. > > The compare on removal is not needed afaics, and its also not used when > doing lookup to begin with, so we can just recompute it? Isn't this a way too much overhead? I personally favor Pablo's per-cpu counter approach. That way the IDs are unique again and we get rid of the info leak without much effort. Thanks, //richard