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: 13951447 X-Patchwork-Delegate: kuba@kernel.org 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: netdev@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 X-Patchwork-Delegate: kuba@kernel.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, }, }; From patchwork Mon Jan 27 14:19:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951445 X-Patchwork-Delegate: kuba@kernel.org 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 BC71D10A3E; Mon, 27 Jan 2025 14:20:36 +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=1737987639; cv=none; b=QrDILofS8CZDIet9SCsb30esDiapD4nQAaWj61GLp1F/61GY5wxEGKtpH7ZhxY9/rsItIu2SErHzVIYE2nnymtZEhdFSbQzBi3NWHwwAyJRzE7ZuTYsZCvMghHATPNPCaNCdDwMGueAn13Wax2LTt8FJt2StvFcTgFOl3WV8p6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987639; c=relaxed/simple; bh=uOM6tJrJ5zFAqB9991Cmwb9IscRLSSl/ju7jaqZLfNU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ig4i0aFFvH/VLJ2BFR9/brGiMdcONkXclwPG3FlPR6Ivn9GMDiLVV0TvHIfNHnrLNv8dDOTjA5JDmYLa2y8kvDLH9/tQmqkCBojrzgQUEUIhNjvsoVdb6GZN7/gE4aDafBmXVWmRT04ni0su4lNBpIxzBEU9xwrmAaR7rUzY5x0= 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=oGfM8hEc; 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="oGfM8hEc" Received: by mail.gandi.net (Postfix) with ESMTPSA id F3F7F44110; Mon, 27 Jan 2025 14:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987635; 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=Oh2Oh3J91gJ6kMI4DpWRpPpzvF6a8IlOhQ3OUmVv56o=; b=oGfM8hEcKeVYftipEUcCIgrl3RS5xlEqAGFYdkhoUKn1Pch0bzV+vwXNsglCz24FGDOAbn Iy2BjzrK70hn7hpqby5VCKBJXrDxl2+xIZr+wucN6kywcmrXV8jRlzTr2HmZ15GRDb8tAs cx0hXXUdREn7ePmSnMoz3e3UPWlQerAQI/spJZ9ozyrygdmvijfAwxobnulxJvaYX0LrsD uU/7MxG9x9Wb/09ga9tRAAOk5TDT2CYHJrwUjf7Ta4Fn2Fgr22vR4yewwPRreqVjuWRymv 3H3XkeZkqo1jiFDt9vM9BYVx+cUNc+FbPV/qBpm0WZXqMuCE8oFi3M+YjOQEPg== 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 2/9] sysctl: Fixes nf_conntrack_expect_max bounds Date: Mon, 27 Jan 2025 15:19:59 +0100 Message-ID: <20250127142014.37834-3-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org X-Patchwork-Delegate: kuba@kernel.org From: Nicolas Bouchinet Bound nf_conntrack_expect_max sysctl writings between SYSCTL_ONE and SYSCTL_INT_MAX. The proc_handler has thus been updated to proc_dointvec_minmax. The lower bound is SYSCTL_ONE as defined in the sysctl documentation. Signed-off-by: Nicolas Bouchinet --- net/netfilter/nf_conntrack_standalone.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index 40ed3ef9cb22d..3ea60ff7a6a49 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c @@ -657,7 +657,9 @@ static struct ctl_table nf_ct_sysctl_table[] = { .data = &nf_ct_expect_max, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ONE, + .extra2 = SYSCTL_INT_MAX, }, [NF_SYSCTL_CT_ACCT] = { .procname = "nf_conntrack_acct", From patchwork Mon Jan 27 14:20:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951448 X-Patchwork-Delegate: kuba@kernel.org 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 5F74D5227; 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=k9dltnkXJWjPXe0JTPY9vUV/DmTlZpzC3/v00z10te3IYvxe+WF7bBUjQ0gEm5fPCHRAGTk9qszk9G4sqWk6voF6AWiSh0Y5iGcsyDkYg67GSxbXGGaMhrnz+vJ4/7FsnKwu4qdlmA61wZqh5G/wEZxgsPbZ0tferlbRP1d68+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987642; c=relaxed/simple; bh=97ADXBXDYjLiWkFnG2eS2DyefDeyBmrbsRan0jQu6w8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kkSv+vLpbrXILroVVEVwBRHKTqdAD0CYnesFF7+nRyUoLVEZi4lZtknTA/oWUqmk2HgvowOrBcg/gInjIvUGlH1DUFuAblBFvW9Ic7SziuRUNNOrdzO07OR7v/x9aykhQ22VcQAXEg5JkD+3bZJKkFLNVF3O2kD9hbl3HoK+UG4= 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=g17JKPgT; 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="g17JKPgT" Received: by mail.gandi.net (Postfix) with ESMTPSA id 8701A44118; Mon, 27 Jan 2025 14:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987637; 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=bKjsgdxqxGVnKL23e6ycxXg/6q5rwmey2bKDVijyk58=; b=g17JKPgT68s8jnDGNKH3EExGJ0Z9xyCcHjbW2rYdI0EgAWm1OiX1jwsb4bLg+fiZS90QsJ +HH/mZZXGPYi7ulodybh0MLANDt4l8XPCOKSzFfqSfk6TxMOGy093/rPw7hsdAUC0BPR5q ifDUGnvpQCW+X7SqsuCirCqvLNOqhiRZR/5FQF5iRnH/tyJOc6dzxpZD2wjIAkVO9QWqdc FY09giEeVlwdyuUUbfwXLJnrjfMIDS3IRuax0krX2vnzQH7YzOrbNT0ocnrjShVPsOyQB4 8uFS4mT0rSBbtKKkCQqD7WPTUK7XRAn5JZXctxLflhqguiaa71VmZCtI135gSQ== 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 3/9] sysctl: Fixes gc_thresh bounds Date: Mon, 27 Jan 2025 15:20:00 +0100 Message-ID: <20250127142014.37834-4-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org X-Patchwork-Delegate: kuba@kernel.org From: Nicolas Bouchinet Bound ipv4, ipv6 and xfrm6 gc_thresh 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/ipv4/route.c | 4 +++- net/ipv6/route.c | 4 +++- net/ipv6/xfrm6_policy.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 0fbec35096186..f13b25b7f0071 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -3453,7 +3453,9 @@ static struct ctl_table ipv4_route_table[] = { .data = &ipv4_dst_ops.gc_thresh, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, { .procname = "max_size", diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 67ff16c047180..3542a9d7b0f3f 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -6379,7 +6379,9 @@ static struct ctl_table ipv6_route_table_template[] = { .data = &ip6_dst_ops_template.gc_thresh, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, { .procname = "flush", diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 1f19b6f14484c..37f0aafd31c41 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c @@ -189,7 +189,9 @@ static struct ctl_table xfrm6_policy_table[] = { .data = &init_net.xfrm.xfrm6_dst_ops.gc_thresh, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, }; From patchwork Mon Jan 27 14:20:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951449 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 564777FBA2; Mon, 27 Jan 2025 14:20:42 +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=1737987644; cv=none; b=iegfQpvTuwsTWPhHAcYVNWZGEJgbcZ4Og0VuW4EGEzmK/fLg4pvVp8K8gv308fjY3DWNUW52CyAkMBoiPb/ckAz2RKRvviHto4PYbqeeQKjWXn5HgREGZemYtF7GpSjjzQz9r0J6z/I/v0rWcfFOqVjiR8tImb9omwwX6L2xPyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987644; c=relaxed/simple; bh=eaici6kMKguAiwAIR6kmucgLNh/3Rh4aaO9DHxjQxQ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nfj9NeyIEtdJk/OX9LvfkHp5FAqxHc19Ux5Z++OVvyB+TP/6iaKns3bi3tE8RoejkPsfpbbQihyOvG250BjUiHtKtFcWhm2FUta2Ojy0iyuE68ehBCvj1yUWTwTBh3Io0sS8c0B3cWOqrsUICvMT4Bmg6flBxqhdheGuEbpqYic= 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=JhkW9CV8; 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="JhkW9CV8" Received: by mail.gandi.net (Postfix) with ESMTPSA id BE0A144111; Mon, 27 Jan 2025 14:20:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987641; 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=DKq0qJ4Jwp5ptNgb4smRxT9YS5MaNZw8pYb67U4FfcQ=; b=JhkW9CV8A/c5sHljnLvnmWkNn52EaFfTVB33BregFnP7jDz2LdPQbNifE1xFp/Q/wxs+Of NGpzLUA7kjbcNANzhdyzXn5fIj3T03i+BPYkRPwurDEV18Xop9r9qOEUYwv70ry4OxpM+S 4TsednrCLDzIcrEapVowvCB4rCJbe9pLxa20kHoEKEp5G2+0V6H0HPaqZGkBR0204MPstS aV6/mTmltMDA/Ws5cKvRDO1onNldyqmtN7ljPeyCXDkb6s/3Tjxsu4OZ7DMel2OLj6tQvq lhweiWlTy3uJFkWo2vhR7H/wDSvgFOjwwj4iWoDOq2ZEeFaKcWc3xs8Am62jVA== 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 4/9] sysctl: Fixes idmap_cache_timeout bounds Date: Mon, 27 Jan 2025 15:20:01 +0100 Message-ID: <20250127142014.37834-5-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org From: Nicolas Bouchinet Bound idmap_cache_timeout 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 --- fs/nfs/nfs4sysctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4sysctl.c b/fs/nfs/nfs4sysctl.c index 886a7c4c60b35..19c1b7ff89f74 100644 --- a/fs/nfs/nfs4sysctl.c +++ b/fs/nfs/nfs4sysctl.c @@ -32,7 +32,9 @@ static struct ctl_table nfs4_cb_sysctls[] = { .data = &nfs_idmap_cache_timeout, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, }; From patchwork Mon Jan 27 14:20:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951450 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 08257155747; Mon, 27 Jan 2025 14:20:45 +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=1737987648; cv=none; b=GxbJWlpCklbncGJZY+nxyh8sqWVBMBMp7zbQjjiqqzuKHiXy6caoumgRtXRurKBbzpzXF1j4iOxnzCqCIh49w0YNsP+cx3U2VDTplWhuvAGbSLBZT0PQXXveDsAWIkLAdr2mIvvHZCS4sTlgfEou6LebX3gImi7v+qpVFabhCLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987648; c=relaxed/simple; bh=C7EQBwFwMT89/Rd4X93SE6Y8ImjJa4MR5t8f/2AXViM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SotzUwDFHZO5UrvtEFXXwBh/7XL40Zt8MCkxT1xptMeN9/hWLsMc4U/hQ/iWX+U7DsaJ9Q5sM05q4zStgULkSYA00Rhg3VMAyBIexob8HSuBn3shngz641JHqqEhyhblBGuFtiOwEWwrI039stast1RWmq2mP/Kr1LyW1XBRmGQ= 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=YHSBX8/J; 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="YHSBX8/J" Received: by mail.gandi.net (Postfix) with ESMTPSA id 21EFE440FC; Mon, 27 Jan 2025 14:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987644; 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=WgivBUMYj657OYvxESBYxd1xBssg7E3u24chPtywJeY=; b=YHSBX8/JZlTQrmOu9q79eGbSYd64j0Wv2Kp3qogOlzYCsXOJOq8HjvzDsVqF2bIt9aCxkO pNMC2x17TEOp3r/1/f5OAiAxtQ6kk7eRXs2ttetnSy7MAg0jkOz98LUWbS46eMBID4E8RP dlxjashR+xQAmpEIqARjYVIr+f00YFh9pgvGjX2L9DfL+WsVxd9PlNloLfpGx9Td+BVENH f5hFHud/0L11IcAIJKVngXYQluJPcf99mD8MYI9nM3UUctr1E25nvJgHijnhc93SVSTpaL /j25628idAAx9LCu0bUsb/PzKqurfxKVLRI8H59E5V0u97LVsGpXwSIcP+QIug== 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 5/9] sysctl: Fixes nsm_local_state bounds Date: Mon, 27 Jan 2025 15:20:02 +0100 Message-ID: <20250127142014.37834-6-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org From: Nicolas Bouchinet Bound nsm_local_state 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 --- fs/lockd/svc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 4ec22c2f2ea3c..84752d27d0072 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -468,7 +468,9 @@ static struct ctl_table nlm_sysctls[] = { .data = &nsm_local_state, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, }; From patchwork Mon Jan 27 14:20:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951451 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 E2AA615EFA1; Mon, 27 Jan 2025 14:20:48 +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=1737987651; cv=none; b=aGA1kHKpJw5D0LuYm4Udc5EiwJnICsLT5mJYC2+29qsM9grmLnR3W0+fg12iJSFwuYtkMuQFydls+ckNNXvnozICpd4y0s9NlN+aqAuaFpDFvWmmxgbciHV0q5vUxr4ovi/eFNcFQSkqEhsY76KSy6Ogh3U9DUOBCeDG1M8RZJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987651; c=relaxed/simple; bh=QVW6+AudYsmUldqtr943V3avAI/kNy4VK7bZUAfma8Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CgXO453OJaZuYfIquqre7pqObj+Nn31qITpl6GRhAGvItT1ssP6xByn5jNv1QBy5NTU8i+DOx/6y1g4KMN89J4hl2glRbj+sDtoNQORWWeSt1SmzGYpqqdLGOu9LmsMKkbONS/2Coru0+4THX9TRmhjrwHAeqTM+5RWGfjO/ngw= 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=OAotX0X+; 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="OAotX0X+" Received: by mail.gandi.net (Postfix) with ESMTPSA id 005E34410C; Mon, 27 Jan 2025 14:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987647; 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=KibZbzZo3TB3J4k1DB83wl5gFCd90FiiNovI3HiLcX0=; b=OAotX0X+7p4Lis1yPaWQsYekuDjhkei/lI4Pc18KMKZuT7Kl6xpRDzcdZXX/+oXY0xWzs6 M5C0nZu6QoKo401n61yu+d97ipDboruf1yc3LVzwoRKSN+b+yFAfsTTHoWtVcZRmmmoikc 2PomCh2vFRI3AxqV5LDdDRM3Zf6u+NfMr9n/OvTI+0KIJm4gnuHrt7Ntn7PmrgBQchuBMF zVJLod31tC23t5oVi1P1tjX+GL65KOGpeEA+awE0GYlv4BSP6C39RqBB5CHEWkjHfBD4ni GI82C9K06/3GHcnZwOxGfNwh91gmHlrd4mXmIVD/MMHebGrf6S8pLYa233V6Ng== 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 6/9] sysctl/coda: Fixes timeout bounds Date: Mon, 27 Jan 2025 15:20:03 +0100 Message-ID: <20250127142014.37834-7-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpeehnecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org From: Nicolas Bouchinet Bound coda timeout 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 --- fs/coda/sysctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c index 9f2d5743e2c89..2cba42c46ff10 100644 --- a/fs/coda/sysctl.c +++ b/fs/coda/sysctl.c @@ -20,7 +20,9 @@ static struct ctl_table coda_table[] = { .data = &coda_timeout, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, { .procname = "hard", From patchwork Mon Jan 27 14:20:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951452 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 39D6316D9DF; Mon, 27 Jan 2025 14:20:49 +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=1737987652; cv=none; b=hh1BYQKp3eW6AART1wIudxxRLQIVvgemFifA+o9y1lw0Iit5MQBBR1Y+2vypEAbK6radokEZ81dYMv8s8K6bq1Tq0zKr2WiqvSSRGw4o/iTmDy8E1+S1HVOe2kQCWgxUr9Tc9Wl9GcfH4+amm99w+VzuRrVRC832yu2+a2EAXxA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987652; c=relaxed/simple; bh=dtCM/2rTO6hQHUFKNOpSXZbQ6MpIrnXNhlitlu8keJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=stwh74CucrjVEkbiUKZjQc1Jl1EZZWWDPW5e7gourKyREwPF20iY8QmCG2gwkVOVZV3tgM1lYVgdBuPauyHKw1O1k6nyIsKaCqV+cP1WvtLXwwacibxHQgdqNkOFwm7DFhW/TkZct2cc3Dj4fJLyNznrKL3oCe7VrFmawjREtoo= 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=hExcmwFZ; 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="hExcmwFZ" Received: by mail.gandi.net (Postfix) with ESMTPSA id 6318B44118; Mon, 27 Jan 2025 14:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987648; 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=oy9mnNGO393wqosoSMbVdOa+z9tvMzdFR3iw5n3nHF0=; b=hExcmwFZHb6kogE3OgWTKbWv47BHB82iHzQGPJzUKnESqYmaCTAUgvSaIUtBjD7mIPtqeN DnUtqKk4KzwBtxmBCQxl5EufztwKmQqR4I9sTMeGl8XQpoG/541oNfaYmBj7PvpSq1z/yj netoKy7XYcYAhte+xUCSkQnwsr4B7gOlmR1fdnERgU5CEgPSgj9wyM/pKjxMJkJH7ggvCW OJ8SglVWA55nmc9v9U75FpbSsHXoy/LwqAOvqd59eQ2brPX6Jhd2MZUOVdbWGjk2vppkez eELodaxcOW4xfZtYUprBhWmP5AEXWKysZu/l3yXZDJ0A5JhSf/nzR6qTqJNUGw== 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 7/9] sysctl: Fixes scsi_logging_level bounds Date: Mon, 27 Jan 2025 15:20:04 +0100 Message-ID: <20250127142014.37834-8-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpeehnecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org From: Nicolas Bouchinet Bound scsi_logging_level 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 --- drivers/scsi/scsi_sysctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_sysctl.c b/drivers/scsi/scsi_sysctl.c index 093774d775346..daa160459c9b3 100644 --- a/drivers/scsi/scsi_sysctl.c +++ b/drivers/scsi/scsi_sysctl.c @@ -17,7 +17,9 @@ static struct ctl_table scsi_table[] = { .data = &scsi_logging_level, .maxlen = sizeof(scsi_logging_level), .mode = 0644, - .proc_handler = proc_dointvec }, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX }, }; static struct ctl_table_header *scsi_table_header; From patchwork Mon Jan 27 14:20:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951453 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 9F0A917B50A; Mon, 27 Jan 2025 14:20:51 +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=1737987654; cv=none; b=H//jENXMCsIwQ8ywNR1SSOJ1AexCTe2c+iulUuyfBnTZqm0aJ4f+N1agNRccFcNJwIlpRsAWUjSFHjxtiex9MQ+mmgsG2Y9L7BO2l4SBM9zyen6qnGD2pQPoeeV+mzwwii3cdiPNSCoCWi2HalKpbuX5XvDRkgRE436UQ/SIDTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987654; c=relaxed/simple; bh=Ea19bN/vjnrpIUiyzr84w6ttaRjcsA+GtfYkhI4u6CY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xid+H6AlUpKtEvgW+SHttCpRt+7D4qbY9CJKS+dbfNxIVYd59OMTNK9hWVmD5vps/Ph+/pWarYb9fDlY0R6O575OdwVj4KXix8mhVl71s2HWDtyhRPXFLGAbPkfLIgq37lVSN/qY3f5pv73RRifbknNtnotJO0n3AJT2Id5LE0o= 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=oK4RMpI3; 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="oK4RMpI3" Received: by mail.gandi.net (Postfix) with ESMTPSA id C5C5844111; Mon, 27 Jan 2025 14:20:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987650; 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=bpK9rjA2Iyr1/4shXdCRa2AwF0Vk//SchKoDcQ5rZXo=; b=oK4RMpI3dzKiZRHAJg6VLOWUv10jeXjgka3xPpn2banC7QoavnAzWYsrSfCr/5NRbaVy+L fEsfE3xAmzqzAFWKw3CcYE01wanBlLgI8dhPIymIH0VovltVSiWVQGSjkbWx9UbJSXZ08Q ubnh7IXwdftT78C5C8IVBFD94tPdYOhfEGEmHutHQNoxrtf/CEs//5G4jkvyTJ7Gb9x0tK W/PrZpK/vI5bVETkTvsYPFM4gpNmNQ/t+PdcXJtjC17qCX1kT/KtkrLAPTNz4L3Z+FdUCs zI7aD/Zj9Hw1RdsESqboMgQhAuV7de9KQW/67xYJ9sTV8OCOEb+xpZk374t8zw== 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 8/9] sysctl/infiniband: Fixes infiniband sysctl bounds Date: Mon, 27 Jan 2025 15:20:05 +0100 Message-ID: <20250127142014.37834-9-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpeehnecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org From: Nicolas Bouchinet Bound infiniband iwcm and ucma 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 --- drivers/infiniband/core/iwcm.c | 4 +++- drivers/infiniband/core/ucma.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c index 7e3a55349e107..f4486cbd8f45a 100644 --- a/drivers/infiniband/core/iwcm.c +++ b/drivers/infiniband/core/iwcm.c @@ -109,7 +109,9 @@ static struct ctl_table iwcm_ctl_table[] = { .data = &default_backlog, .maxlen = sizeof(default_backlog), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, }; diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 02f1666f3cbab..6e700b9740331 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -69,7 +69,9 @@ static struct ctl_table ucma_ctl_table[] = { .data = &max_backlog, .maxlen = sizeof max_backlog, .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, }; From patchwork Mon Jan 27 14:20:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Bouchinet X-Patchwork-Id: 13951454 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 0A23E188926; Mon, 27 Jan 2025 14:20:52 +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=1737987655; cv=none; b=SqVgPn9vqXweMnMZj7KJM2gBRcnox9+YOEU88/cC8HrwdhCQOiblR+GYhlGVuSLm23Vb0eEF23gx4CRlMqyvPDAOSeGafV1Ub22mOi071ZTVFPGTgQx13Z9SqC0xYYKa2gs7uraed/gWnmaeudfGSX3LQF2mTgS3KFTUVzcz0LM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737987655; c=relaxed/simple; bh=s4FGh8+Jt0+W5EtK2lxHVEDvNUFrgHmLElUFdHDZ5wo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TQDwoUawxnSE4YKQ4WGEh3ojaqKqiODkcnlOXyZ/K5v7x0OPdm0OY7uOT0ZAj/2D0aXEAC+TmxNzuvwZsEXX9ftmIAE4xpvVVdm5Zij7gx974/4lkKOIi8itpO2AZdlBfOb0HrMKCEfIqIxkuSYH/4J08UabjNYIVB/PT54SYE0= 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=WMJpchMr; 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="WMJpchMr" Received: by mail.gandi.net (Postfix) with ESMTPSA id 2D60F440FC; Mon, 27 Jan 2025 14:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clip-os.org; s=gm1; t=1737987651; 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=1sxrIc3JChwt94nC6YIZ2Rtxk2QrX9t8Sx5zP8GJlJ8=; b=WMJpchMr/d9IWQ30ZHv8W7O+2o/suSR7o6FzrqGnScIcv/5d77JhXcHXGgp0IKyaC0X+We rwDKUf9qzjgbKvgWK1QnhyzlEVB69oOzUFJlK+1fSwHe1znef1hJSU3tbtRaf+/yMwAYa/ 8YmAap3vzf5bXjBWUS6vm2iIAbBysahbjEdOuL067dq3/84W/rSTHQOw8LPrfPPsObte0f f+cGA5WvQcfFlU/eYtolXeAKHFtzIjh7VuHPUhGuspwLyvlQW/WBLJeKhwXMaEDDneF1UZ pgo4eMOIgq/taBshBEjX3XO/WNK9k1ixQrwgNLFFB+UqxR+k/dvGI85j7in73Q== 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 9/9] sysctl: Fixes max-user-freq bounds Date: Mon, 27 Jan 2025 15:20:06 +0100 Message-ID: <20250127142014.37834-10-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -60 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefgedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenogfuohhrthgvugftvggtihhpvdculdegtddmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepnhhitgholhgrshdrsghouhgthhhinhgvthestghlihhpqdhoshdrohhrghenucggtffrrghtthgvrhhnpeetheefteekueejtefhheeilefhjeefudetjeeileevgeeffeeiueehieettefhveenucfkphepledtrdeifedrvdegiedrudekjeenucevlhhushhtvghrufhiiigvpeehnecurfgrrhgrmhepihhnvghtpeeltddrieefrddvgeeirddukeejpdhhvghloheprghrtghhlhhinhhugidrrddpmhgrihhlfhhrohhmpehnihgtohhlrghsrdgsohhutghhihhnvghtsegtlhhiphdqohhsrdhorhhgpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhrughmrgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhstghsihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohgurghlihhsthestghouggrrdgtshdrtghmuhdrvgguuhdpr hgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthhfihhlthgvrhdquggvvhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegtohhrvghtvggrmhesnhgvthhfihhlthgvrhdrohhrgh X-GND-Sasl: nicolas.bouchinet@clip-os.org From: Nicolas Bouchinet Bound max-user-freq 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 --- drivers/char/hpet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 48fe96ab46490..02d2e76b7ef7e 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -730,7 +730,9 @@ static struct ctl_table hpet_table[] = { .data = &hpet_max_freq, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_INT_MAX, }, };