From patchwork Wed Feb 12 01:44:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong X-Patchwork-Id: 319474 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 990AC2C00B5 for ; Wed, 12 Feb 2014 12:46:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619AbaBLBqr (ORCPT ); Tue, 11 Feb 2014 20:46:47 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:42716 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752545AbaBLBqq (ORCPT ); Tue, 11 Feb 2014 20:46:46 -0500 Received: from 172.24.2.119 (EHLO szxeml209-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BPR76915; Wed, 12 Feb 2014 09:45:30 +0800 (CST) Received: from szxeml459-hub.china.huawei.com (10.82.67.202) by szxeml209-edg.china.huawei.com (172.24.2.184) with Microsoft SMTP Server (TLS) id 14.3.158.1; Wed, 12 Feb 2014 09:44:46 +0800 Received: from localhost (10.177.18.75) by szxeml459-hub.china.huawei.com (10.82.67.202) with Microsoft SMTP Server id 14.3.158.1; Wed, 12 Feb 2014 09:44:46 +0800 From: Wang Weidong To: , , CC: , , Subject: [PATCH v3 1/2] sctp: fix a missed .data initialization Date: Wed, 12 Feb 2014 09:44:43 +0800 Message-ID: <1392169484-8256-2-git-send-email-wangweidong1@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1392169484-8256-1-git-send-email-wangweidong1@huawei.com> References: <1392169484-8256-1-git-send-email-wangweidong1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.18.75] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org As commit 3c68198e75111a90("sctp: Make hmac algorithm selection for cookie generation dynamic"), we miss the .data initialization. If we don't use the net_namespace, the problem that parts of the sysctl configuration won't be isolation and won't occur. In sctp_sysctl_net_register(), we register the sysctl for each net, in the for(), we use the 'table[i].data' as check condition, so when the 'i' is the index of sctp_hmac_alg, the data is NULL, then break. So add the .data initialization. Acked-by: Neil Horman Signed-off-by: Wang Weidong --- net/sctp/sysctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 7135e61..d354de5 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c @@ -151,6 +151,7 @@ static struct ctl_table sctp_net_table[] = { }, { .procname = "cookie_hmac_alg", + .data = &init_net.sctp.sctp_hmac_alg, .maxlen = 8, .mode = 0644, .proc_handler = proc_sctp_do_hmac_alg,