Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752510AbdI1Rr5 (ORCPT ); Thu, 28 Sep 2017 13:47:57 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:50682 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752452AbdI1Rrz (ORCPT ); Thu, 28 Sep 2017 13:47:55 -0400 Date: Thu, 28 Sep 2017 10:47:54 -0700 (PDT) Message-Id: <20170928.104754.977799185628171706.davem@davemloft.net> To: yanhaishuang@cmss.chinamobile.com Cc: kuznet@ms2.inr.ac.ru, edumazet@google.com, weiwan@google.com, lucab@debian.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 3/4] ipv4: Namespaceify tcp_fastopen_key knob From: David Miller In-Reply-To: <1506483343-11544-3-git-send-email-yanhaishuang@cmss.chinamobile.com> References: <1506483343-11544-1-git-send-email-yanhaishuang@cmss.chinamobile.com> <1506483343-11544-3-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 28 Sep 2017 10:47:54 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 969 Lines: 34 From: Haishuang Yan Date: Wed, 27 Sep 2017 11:35:42 +0800 > Different namespace application might require different tcp_fastopen_key > independently of the host. > > David Miller pointed out there is a leak without releasing the context > of tcp_fastopen_key during netns teardown. So add the release action in > exit_batch path. > > Tested: > 1. Container namespace: > # cat /proc/sys/net/ipv4/tcp_fastopen_key: > 2817fff2-f803cf97-eadfd1f3-78c0992b > > cookie key in tcp syn packets: > Fast Open Cookie > Kind: TCP Fast Open Cookie (34) > Length: 10 > Fast Open Cookie: 1e5dd82a8c492ca9 > > 2. Host: > # cat /proc/sys/net/ipv4/tcp_fastopen_key: > 107d7c5f-68eb2ac7-02fb06e6-ed341702 > > cookie key in tcp syn packets: > Fast Open Cookie > Kind: TCP Fast Open Cookie (34) > Length: 10 > Fast Open Cookie: e213c02bf0afbc8a > > Signed-off-by: Haishuang Yan Applied.