From patchwork Tue Jun 4 06:29:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Granados via B4 Relay X-Patchwork-Id: 13684736 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58033C25B7E for ; Tue, 4 Jun 2024 06:30:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48EA36B0093; Tue, 4 Jun 2024 02:30:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 342BF6B0099; Tue, 4 Jun 2024 02:30:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 037466B0096; Tue, 4 Jun 2024 02:30:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CB6516B0093 for ; Tue, 4 Jun 2024 02:30:05 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7C4661A016C for ; Tue, 4 Jun 2024 06:30:05 +0000 (UTC) X-FDA: 82192231170.14.503CC03 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 7151F140020 for ; Tue, 4 Jun 2024 06:30:03 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ov31VYfk; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717482603; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/Mc+1B74ff0zjQK+kuIvwLivKGehEPsFT+YLaIGLv1s=; b=QKEBLIyLoLxtZYgD8BKSXHpDGhC6WVzLEUjRZneqVdu0+QyfizTfxl0iz0iRyk3d/nomx7 AD+h/Hkdlw7IGhI5e/7tsobnhvafd+5emiML5ksQDMhlblGtyvH2NBpifhhFJvZsM9fvEg Q8if8jGLprtltpu5Y1/sqePmLV72Ks4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717482603; a=rsa-sha256; cv=none; b=4VI4v36tiUQ7ysvd4n0gn66JY/Rcr7MQMa2ONHrXDq9FH+bukNQBFCgKsNgTJ7zFSWqbPq lYGcOhRzV7ohmjV8gOZVmqt1E7FfZfFPX7KJuAIh2Iqcj/fQN60M653llzs3Inz8EjR0ze 02gfnwPUaL9Qx9HXw4q/j/QSFjLRcCo= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ov31VYfk; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of devnull+j.granados.samsung.com@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=devnull+j.granados.samsung.com@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id DA69861220; Tue, 4 Jun 2024 06:30:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id EDCD8C4AF4D; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717482600; bh=JGQT+4p7AHY1M4o7zhyH0qaV8X0DJMDz7KyqjSiOFsU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ov31VYfkZBszW6nagLY0k+JHZFiMxqJo3NcOel+En0isAe6LtNJ5y9FCZfVkctPXW 7LZXgH+PAQIjLBC9dyOCddavt9rrNFFKGGv6IMMcx3bY8Q7DqGre74pUdfLFZfUeNM hWdD2xN6klufntacPQjGZGfzu330vz/iZu8Nc3CaU4JkedUXKFzApi9J+FforQvK3M YIsRBX7BW2vwUnsRrgTn1x7qKJ1Af+hCmT3ykgBjrSZvvSwXqLZCZpZmizxPBxJYGG KGkvDazh0oyOkjL0uXlmsNAYBbMUKCvHSgZAiHOeVFQsshxaeKy8d+QttD2HlqsDLO QJJeoHRH5qHfA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4B6CC25B7E; Tue, 4 Jun 2024 06:29:59 +0000 (UTC) From: Joel Granados via B4 Relay Date: Tue, 04 Jun 2024 08:29:26 +0200 Subject: [PATCH 8/8] sysctl: Warn on an empty procname element MIME-Version: 1.0 Message-Id: <20240604-jag-sysctl_remset-v1-8-2df7ecdba0bd@samsung.com> References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> In-Reply-To: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , Kent Overstreet , Andrew Morton , Luis Chamberlain , Kees Cook , Joel Granados , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=837; i=j.granados@samsung.com; h=from:subject:message-id; bh=kiBCYRLAjKste0XuHE2np63NWadPBoIGUUndp1NrN98=; b=owJ4nAHtARL+kA0DAAoBupfNUreWQU8ByyZiAGZetGXOjyV9+/Ko/a1TAa0g3yQtd6zwj6D29 kW6R7OTXh/JPokBswQAAQoAHRYhBK5HCVcl5jElzssnkLqXzVK3lkFPBQJmXrRlAAoJELqXzVK3 lkFPABkL/0chps6Tybj/Jceo6dk5TxaNFxxf/9U5ng/iiwgx4Aud25nQYC/AmsWbL/his/ClEv4 8BuIUh8G4fFijVL56/El1GEAVxd9J8z8s6c3d83lZ+7po/aWsz9lvgO6nh3tTe8U6TKKV+Rh0jL EKXjAJ+S4/CNLT4NBhCuIY4P4LyQIjgAxHx3p/ryNWc08tJJAK0bG+L3cllECbQ7X+usHu9Q9dq mg5tVGmxkunsrP/nLQNrlC+xpppGWp+fc5g9y/QeTAXHVHQMCZkeV5pJfgBWVGMUv9F7juRGJAB B5ySh3sHHaIo8scZIIYsRqWs1/4dR8vxgpa8iXykL41Px3oJuinO01eFG2gdAht/skleaLIIW5y k36ZfB4mYUmXBtSq/YEGDd4IerIixbbq7Hc5F+g+l7Eby59/gbzU06uOy3mGyuXFVzB0WHcZFiz +zN9loEzcIEe/WaIq9hQLiHtkj3fwCmwXLuAOl6RzQgKnNf/jXmyJJL30Dsd9/INhxAp1Tc7SA6 74= X-Developer-Key: i=j.granados@samsung.com; a=openpgp; fpr=F1F8E46D30F0F6C4A45FF4465895FAAC338C6E77 X-Endpoint-Received: by B4 Relay for j.granados@samsung.com/default with auth_id=70 X-Original-From: Joel Granados Reply-To: j.granados@samsung.com X-Stat-Signature: xbrrxasxin1jtiz583uqnj1xsdnjgjma X-Rspamd-Queue-Id: 7151F140020 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1717482603-395248 X-HE-Meta: U2FsdGVkX19pMqJWCbhDGEvCSsXtlv01RAo8YP2Jfk2cav5LzAhSjpZSU8lJiXLguzklwYh3pftom2KLBnuyG6kxNiL5MryeT1w4ddi0TF9c1pKT+7hxmeqtrD18rFEjaVtmm18y7alcS85iHqUg4ezBzjIVZ9+wE2V1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dNT96ieqnPuiZpKcKMTNQ2hXW9584N+/2cgsj8ZqB0WBPoGyjGj9ed1gqe4BXrvTc93gSXa7bQrssFZlpoe7HeZL5J4DfGdc9lTPWRtnFEZyGQukNSPkhHFMHVVZpIndgDXLVcg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Joel Granados Add a pr_err warning in case a ctl_table is registered with a sentinel element containing a NULL procname. Signed-off-by: Joel Granados --- fs/proc/proc_sysctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 806700b70dea..f65098de5fcb 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1119,6 +1119,8 @@ static int sysctl_check_table(const char *path, struct ctl_table_header *header) struct ctl_table *entry; int err = 0; list_for_each_table_entry(entry, header) { + if (!entry->procname) + err |= sysctl_err(path, entry, "procname is null"); if ((entry->proc_handler == proc_dostring) || (entry->proc_handler == proc_dobool) || (entry->proc_handler == proc_dointvec) ||