Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp671018pxb; Mon, 25 Oct 2021 16:19:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy0bmE9LOtJLxlM/+agXIk0qWMGiwuACbyAsuiatAQELj1LBH17JVVp5skB9eHSr38v1FP X-Received: by 2002:a05:6402:1658:: with SMTP id s24mr14092190edx.174.1635203985530; Mon, 25 Oct 2021 16:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635203985; cv=none; d=google.com; s=arc-20160816; b=OSA9WAw5ArAWX1+KhTH7GluzVyfef2Q2dFblr2DKVhGIRbwurr45YR1iO1PdZunozO gpRmTSEx+EnO1Ijxklc6K52R0ptwPPaRcd7aFpnqKY1eig5OohRxRLpPi60T8dqEfGns BJ80alIZt6sOwonjazUiwnIn3Twp1lUgz+gEQ7M7bWVY+/SFb+RLjlCtfcmlMZVDPkds E09nk7QQpuXc9TXPUNfrqUxvS11ggO6gfztJ2i/zs9ftMYcWpEPJfbtqvUjreOdJ7N6n KvLvVRdTcHm1v5JmSfNv1ptiilEd0jhjSvWUtui4kEy2dNv5ZVIyrys8+ujXZ9tj0YJy BAiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LYk0+xYCRDNtzGSQ6ZW70Vm/eOnm1cPUaM9lb+FSX68=; b=HRAXAC2h4leZT/Yj44kV6wKlXC4oIGZyy5URptyNwybu86UO4MYM71AW80Rt1QFHwN vHQqKz3iZ7Tfbo49YiJxTRiCu9/Xx5vkqfCWt8Fgunm+sc6Pwk91O1X8jgK2HcRAeD9p yLl65YD3McJHbMcsSVN0/bGhJq7Dqm2kUl22O0dRfWtm5a5eT/sjRWycLu+fN2nogUeO sjew79A5P844kc4ynzzbWVB62r1KC3YvtnZYZCQLsxabllbgd2o0OSYbWLbe7G1lhdZV LQOXY2hNKL4L+GsRgijJl6tlAYgzdmGc2LtATWAWCRpgpJvlP44vSkrVZY2LgGRJlteT gdIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZPNVQgeF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si15335419edf.321.2021.10.25.16.19.10; Mon, 25 Oct 2021 16:19:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZPNVQgeF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232763AbhJYTZS (ORCPT + 99 others); Mon, 25 Oct 2021 15:25:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234703AbhJYTV4 (ORCPT ); Mon, 25 Oct 2021 15:21:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7998B600D3; Mon, 25 Oct 2021 19:19:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635189574; bh=UbvRpCqW8LkiWGbZMCWvToPA2/IQxVOqCjf87XhExy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZPNVQgeFQkxz4hBLr7nz5F1lTegPuNKXswAvBnUmVIJXCwr2seVr8PmVf8chTgy9V 4N6/yESBm///WuMxOYjj/IkwIpTdQ3Q1uR0rZZxmef4dDBf1rkLnjlOImTkKTH26XR ZIoYAeQy2LZbXyRPHfnEQ509bzBTOUZRMXUGTp3o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antoine Tenart , Julian Anastasov , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 4.9 29/50] netfilter: ipvs: make global sysctl readonly in non-init netns Date: Mon, 25 Oct 2021 21:14:16 +0200 Message-Id: <20211025190938.397738242@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190932.542632625@linuxfoundation.org> References: <20211025190932.542632625@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Antoine Tenart [ Upstream commit 174c376278949c44aad89c514a6b5db6cee8db59 ] Because the data pointer of net/ipv4/vs/debug_level is not updated per netns, it must be marked as read-only in non-init netns. Fixes: c6d2d445d8de ("IPVS: netns, final patch enabling network name space.") Signed-off-by: Antoine Tenart Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/ipvs/ip_vs_ctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 4e08305a55c4..3ee198b3bfe2 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -3987,6 +3987,11 @@ static int __net_init ip_vs_control_net_init_sysctl(struct netns_ipvs *ipvs) tbl[idx++].data = &ipvs->sysctl_conn_reuse_mode; tbl[idx++].data = &ipvs->sysctl_schedule_icmp; tbl[idx++].data = &ipvs->sysctl_ignore_tunneled; +#ifdef CONFIG_IP_VS_DEBUG + /* Global sysctls must be ro in non-init netns */ + if (!net_eq(net, &init_net)) + tbl[idx++].mode = 0444; +#endif ipvs->sysctl_hdr = register_net_sysctl(net, "net/ipv4/vs", tbl); if (ipvs->sysctl_hdr == NULL) { -- 2.33.0