From patchwork Mon Jan 27 14:19:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951457 Received: from relay0.mail.gandi.net (relay0.mail.gandi.net [217.70.178.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F79A5672; Mon, 27 Jan 2025 14:20:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.178.220 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987642; cv=none; b=c4wzwdBS0Kcm5l1AePe6OXpH5pKnBcbkxkbZfCBEhUhNlrsrJTPMM21DLRhLR3f35HaBsD4kZdODN4hJrOqXihRxW4NKKRcaOJcWvxdpmM015yEDliYBRK8QkfJp2QlFSSVfnaiD6obSAQWrWkzSodbWVB8B/C+56+lwcU6w98U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987642; c=relaxed/simple; bh=GDWPCGSt/7zsfTvMtYIvQY+Y/5xyDeZGGp9EKlQf3wo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m4sgOLrN8E6mbRUxhVSTgh1p6lWDBtcOhjPaPt63cQ4vxQxCWpZP6gYDEnYPFNpLPfN/QmHgb97SrnscYJ0J08bfkqcuNOFkFbYe61szOuHCkBP1VpwA5kBAs9GOE7b7rjFSL3kCj0Xhe/3Y3G/WHzdKonPUDFLQRYdMPr7co3o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=clip-os.org; spf=pass smtp.mailfrom=clip-os.org; dkim=pass (2048-bit key) header.d=clip-os.org header.i=@clip-os.org header.b=KD4QmWXb; arc=none smtp.client-ip=217.70.178.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=clip-os.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=clip-os.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=clip-os.org header.i=@clip-os.org header.b="KD4QmWXb" Received: by mail.gandi.net (Postfix) with ESMTPSA id 4C879440FC; Mon, 27 Jan 2025 14:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WbOGTsm14785asGLdNSxUyJMisFCbnrzbdzQwYCGMkg=; b=KD4QmWXbuOnUfqiu5m2nVVbqKQxGR3JOrAsXs5h9ggDWhfwxx7+vN5g867yT74zwv1DeuA zD8LvITxrnB52CURxNY6C3KcEzFYheIHrjZpIRAxdBTIzc5X8b6yEkUK8qKD339Alva4zR wGeD+Y4It9s8aC1FbiFT9lpWlXyjTxu2TwzIHNfPEOfP1d5YvdxHD+ITyuA6qBVtQiwpRL nNYD3bKfDWaHTsy+4hSVC0MxUUjSIU5b+6QXD+n4ATqFW/ANjbnpVmP1OMXKgUiwDkCdFP tbdQW/djpXcyJ5i+LB2HnaaJfF0GnsH7DU7CtXhR1sHGK7Sh3e5f23Da7BOL4A== From: nicolas.bouchinet@clip-os.org To: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-scsi@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-nfs@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org Cc: Nicolas Bouchinet , Joel Granados , Bart Van Assche , Leon Romanovsky , Zhu Yanjun , Jason Gunthorpe , Al Viro , Christian Brauner Subject: [PATCH v1 1/9] sysctl: Fixes nf_conntrack_max bounds Date: Mon, 27 Jan 2025 15:19:58 +0100 Message-ID: <20250127142014.37834-2-nicolas.bouchinet@clip-os.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250127142014.37834-1-nicolas.bouchinet@clip-os.org> References: <20250127142014.37834-1-nicolas.bouchinet@clip-os.org> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org From: Nicolas Bouchinet Bound nf_conntrack_max sysctl writings between SYSCTL_ZERO and SYSCTL_INT_MAX. The proc_handler has thus been updated to proc_dointvec_minmax. Signed-off-by: Nicolas Bouchinet --- net/netfilter/nf_conntrack_standalone.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index 7d4f0fa8b609d..40ed3ef9cb22d 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c @@ -619,7 +619,9 @@ static struct ctl_table nf_ct_sysctl_table[] = { .data = &nf_conntrack_max, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, [NF_SYSCTL_CT_COUNT] = { .procname = "nf_conntrack_count", @@ -948,7 +950,9 @@ static struct ctl_table nf_ct_netfilter_table[] = { .data = &nf_conntrack_max, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, };