From patchwork Thu Feb 22 07:07:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13566783 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 53693F9D3; Thu, 22 Feb 2024 07:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708585706; cv=none; b=DsrkK+uf9J/ZT/bqXUVpWecxZxXd8R88fpULCeihHddkT0LE4FRaw4rq6DSXx8eDW4EDB386EUDRnwNvdX0qA1zNZpOhJ0dGvwMXJjUjfv8HUKLeyP6K6enuppqrUBZff9ZXgwg5nobi7clBGSZmYJGp1fTah9LBTYB6OcAqiRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708585706; c=relaxed/simple; bh=rBJrdZIe+s7xK7S2lsli6LzdtB7oW9aF4vhR2l0SL8A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k4/jtX5oXZ/jBFn/BPf07DWdGEaAbYQ5873E1e6hv5NDpsNonSEKWBSZ3M9fOvSxASd2jVe6CAVxoGszizZs77BNRFCkijlS+mX69OfwjtqHJSS/PHVerBQUowwAIwSYv9G68ZyTMjXtwmPJLk9vFGyViLnobxsHa/KoyNrDZYw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=eqfk8toY; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="eqfk8toY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1708585697; bh=rBJrdZIe+s7xK7S2lsli6LzdtB7oW9aF4vhR2l0SL8A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eqfk8toY1el32V/MPrbxgEpdTa0Hpy3mTXhGrT8zRUU/8yQPnZvswvVrDEUBNx/PA w9IXJ5hf+IFzgQ4levuO2YB4QCgEosLFzsLl63iohcoE2ZdFwJtL7+e4LYJXTYoJ/8 3RT8r+5HyD9xc45EQBk1Ms4OT8KNlLXROChzhucE= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 22 Feb 2024 08:07:36 +0100 Subject: [PATCH 1/4] sysctl: drop sysctl_is_perm_empty_ctl_table Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240222-sysctl-empty-dir-v1-1-45ba9a6352e8@weissschuh.net> References: <20240222-sysctl-empty-dir-v1-0-45ba9a6352e8@weissschuh.net> In-Reply-To: <20240222-sysctl-empty-dir-v1-0-45ba9a6352e8@weissschuh.net> To: "Eric W. Biederman" , Luis Chamberlain , Kees Cook , Joel Granados Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?T?= =?utf-8?q?homas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708585698; l=1782; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=rBJrdZIe+s7xK7S2lsli6LzdtB7oW9aF4vhR2l0SL8A=; b=7oyFr8FNzsmBv8BO9h8IoLO6rz1mnJRIVR631dGxVGtdMKPzisMzyDSluUjqUgS3jCK10TR++ tx/Y8YJsER3AWg0frDqiiuSIuTyXlCdeDX8NNyuLFXS14z0mnwxQdtT X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= It is used only twice and those callers are simpler with sysctl_is_perm_empty_ctl_header(). So use this sibling function. Signed-off-by: Thomas Weißschuh --- fs/proc/proc_sysctl.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 37cde0efee57..2f4d4329d83d 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -48,10 +48,8 @@ struct ctl_table_header *register_sysctl_mount_point(const char *path) } EXPORT_SYMBOL(register_sysctl_mount_point); -#define sysctl_is_perm_empty_ctl_table(tptr) \ - (tptr[0].type == SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) #define sysctl_is_perm_empty_ctl_header(hptr) \ - (sysctl_is_perm_empty_ctl_table(hptr->ctl_table)) + (hptr->ctl_table[0].type == SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) #define sysctl_set_perm_empty_ctl_header(hptr) \ (hptr->ctl_table[0].type = SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) #define sysctl_clear_perm_empty_ctl_header(hptr) \ @@ -233,7 +231,7 @@ static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header) /* Am I creating a permanently empty directory? */ if (header->ctl_table_size > 0 && - sysctl_is_perm_empty_ctl_table(header->ctl_table)) { + sysctl_is_perm_empty_ctl_header(header)) { if (!RB_EMPTY_ROOT(&dir->root)) return -EINVAL; sysctl_set_perm_empty_ctl_header(dir_h); @@ -1204,7 +1202,7 @@ static bool get_links(struct ctl_dir *dir, struct ctl_table *entry, *link; if (header->ctl_table_size == 0 || - sysctl_is_perm_empty_ctl_table(header->ctl_table)) + sysctl_is_perm_empty_ctl_header(header)) return true; /* Are there links available for every entry in table? */ From patchwork Thu Feb 22 07:07:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13566782 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 5374817583; Thu, 22 Feb 2024 07:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708585706; cv=none; b=NlXNkEVWOuJmH8FOiwQVkHwEoxM9/huggCaHG8tUcB/e9snrkrJX1q7Q6Sr/12LsaFxeSpBrksHwPQeuggw0GAEjSsEDKufgBi9sUSPZUEtVfirKhU0NVe5ArhIMPtqthKhR6hoGUZPIiaROkkUbGNTJ0Ap4etLUyukvv86NSwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708585706; c=relaxed/simple; bh=cR/IG5pmCHIdq4ymlgJjzjZH7hGnhfCNGmfTaQlgx2Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LrXFVmmcHsc9epTYneRAQM/4gXneZ6s38VyL1kDKL8C7/6KvuAjZ/i9FxSxM5pPYHSls9heZDB3ZeQcpah9w62h3rZjZ5S3Zn7V7NGuM8OH7P93fng2f5QKd244HLw+sE1+4lEGI1Y/EcjUMtKuyMv3viNc8/tRXgnXRe5F167Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=sI2FXOL4; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="sI2FXOL4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1708585697; bh=cR/IG5pmCHIdq4ymlgJjzjZH7hGnhfCNGmfTaQlgx2Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sI2FXOL4hfum+t+KTRgchDnOI8GtyZ+U2OlwsKV+xRYJbFv7ZXz4VosAWZQpGkL6y pMr9HTuWloFx/WLC/nWwYV57tcifWRfUl/ZljHF3zTYfgGEAwZpkFU7ZAjkkUjIduK 8zzs7J1mQvHCBvcLnPQLVjyDSwOMvdh32FtJTiwk= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 22 Feb 2024 08:07:37 +0100 Subject: [PATCH 2/4] sysctl: move sysctl type to ctl_table_header Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240222-sysctl-empty-dir-v1-2-45ba9a6352e8@weissschuh.net> References: <20240222-sysctl-empty-dir-v1-0-45ba9a6352e8@weissschuh.net> In-Reply-To: <20240222-sysctl-empty-dir-v1-0-45ba9a6352e8@weissschuh.net> To: "Eric W. Biederman" , Luis Chamberlain , Kees Cook , Joel Granados Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?T?= =?utf-8?q?homas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708585698; l=3419; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=cR/IG5pmCHIdq4ymlgJjzjZH7hGnhfCNGmfTaQlgx2Q=; b=mXTAh1XCV3sH20hmYe/pluA998xG0eK+HatacPk2BM4CJfLqM772dOjRU172Oi9MS6/nsEYW9 LnrVAjlwabKDyoAi0cWgrqrclnCoeEKm2sif+4xpz3CYvNATXoBnFnl X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= As static initialization of the is not possible anymore move it into init_header() where all the other header fields are also initialized. Reduce memory consumption as there are less instances of ctl_table_header than ctl_table. Removing this mutable member also opens the way to constify static instances of ctl_table. Signed-off-by: Thomas Weißschuh --- fs/proc/proc_sysctl.c | 10 ++++++---- include/linux/sysctl.h | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 2f4d4329d83d..fde7a2f773f0 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -31,7 +31,7 @@ static const struct inode_operations proc_sys_dir_operations; /* Support for permanently empty directories */ static struct ctl_table sysctl_mount_point[] = { - {.type = SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY } + { } }; /** @@ -49,11 +49,11 @@ struct ctl_table_header *register_sysctl_mount_point(const char *path) EXPORT_SYMBOL(register_sysctl_mount_point); #define sysctl_is_perm_empty_ctl_header(hptr) \ - (hptr->ctl_table[0].type == SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) + (hptr->type == SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) #define sysctl_set_perm_empty_ctl_header(hptr) \ - (hptr->ctl_table[0].type = SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) + (hptr->type = SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) #define sysctl_clear_perm_empty_ctl_header(hptr) \ - (hptr->ctl_table[0].type = SYSCTL_TABLE_TYPE_DEFAULT) + (hptr->type = SYSCTL_TABLE_TYPE_DEFAULT) void proc_sys_poll_notify(struct ctl_table_poll *poll) { @@ -208,6 +208,8 @@ static void init_header(struct ctl_table_header *head, node++; } } + if (table == sysctl_mount_point) + sysctl_set_perm_empty_ctl_header(head); } static void erase_header(struct ctl_table_header *head) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index ee7d33b89e9e..c87f73c06cb9 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -137,17 +137,6 @@ struct ctl_table { void *data; int maxlen; umode_t mode; - /** - * enum type - Enumeration to differentiate between ctl target types - * @SYSCTL_TABLE_TYPE_DEFAULT: ctl target with no special considerations - * @SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY: Used to identify a permanently - * empty directory target to serve - * as mount point. - */ - enum { - SYSCTL_TABLE_TYPE_DEFAULT, - SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY - } type; proc_handler *proc_handler; /* Callback for text formatting */ struct ctl_table_poll *poll; void *extra1; @@ -188,6 +177,17 @@ struct ctl_table_header { struct ctl_dir *parent; struct ctl_node *node; struct hlist_head inodes; /* head for proc_inode->sysctl_inodes */ + /** + * enum type - Enumeration to differentiate between ctl target types + * @SYSCTL_TABLE_TYPE_DEFAULT: ctl target with no special considerations + * @SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY: Used to identify a permanently + * empty directory target to serve + * as mount point. + */ + enum { + SYSCTL_TABLE_TYPE_DEFAULT, + SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY, + } type; }; struct ctl_dir { From patchwork Thu Feb 22 07:07:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13566780 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 53775175A4; Thu, 22 Feb 2024 07:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708585706; cv=none; b=K5s4PB4+r048+ywB1f8R+QHY5j7TUJImnTCn0uGpM6XwddUTAG7H6rPjZa7oYvQI2jaCD/6k2oyNCqJhPTdUPlK4QPrAwdKK+WCMzJIsp9yR/mUM1xz1X1gjePIfuUupKVFJdCMbsDpcVJtI/sb4kaaO9I/MYyYrQbBlR/vfkJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708585706; c=relaxed/simple; bh=JCJJxjzDXGYJItYXCEzMjq/GSfQbqYm3SGRGNchibxI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WC4/MsfvLXcCPbJJ8iRqbsmPWN2Su3YDCM5DKoT/cH844OB1wWNZWmVhsEgJPyQU5FqT4VIWiPxE3Ie3K7nUbzT+/TLUTLEcOJynTw/fhNWmtYVpoVG58ScpDIzcUDaUrVkMh4P9Ph6n8tQU+yLGerfiIp1JypMJGTjzXN5t1nI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=HcAI79BJ; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="HcAI79BJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1708585697; bh=JCJJxjzDXGYJItYXCEzMjq/GSfQbqYm3SGRGNchibxI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=HcAI79BJ0jlUL64zT1OuRh30+urTZW+qC87py30RIz7eGcHIx66WFDtT39zDGmBJm HM3AVr97CHd1Z8uGeyoAPguoaxClQUfFoLFvizAGCSHNeEYre8uZUt8gUbcb1VYQSC /WwVQMPXKIeLbMGJhKlB0+r/vFxcH0nAiNkLKK28= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 22 Feb 2024 08:07:38 +0100 Subject: [PATCH 3/4] sysctl: drop now unnecessary out-of-bounds check Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240222-sysctl-empty-dir-v1-3-45ba9a6352e8@weissschuh.net> References: <20240222-sysctl-empty-dir-v1-0-45ba9a6352e8@weissschuh.net> In-Reply-To: <20240222-sysctl-empty-dir-v1-0-45ba9a6352e8@weissschuh.net> To: "Eric W. Biederman" , Luis Chamberlain , Kees Cook , Joel Granados Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?T?= =?utf-8?q?homas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708585698; l=869; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=JCJJxjzDXGYJItYXCEzMjq/GSfQbqYm3SGRGNchibxI=; b=XWUZnHu/nkrMeHxEs4qbmkwfAlq1rR7FWvv8k9GTBVFOuFcu7uJK8PSl+A+MtiSLWEAvAhI0I j8M7KbOPm+UA6bCmIRyLxiSyxfCwt6TFMzbkTTAlz2f+gifo220SAsx X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The type field is now part of the header so sysctl_is_perm_empty_ctl_header() can safely be executed even without any ctl_tables. Signed-off-by: Thomas Weißschuh --- fs/proc/proc_sysctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index fde7a2f773f0..4cdf98c6a9a4 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -232,8 +232,7 @@ static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header) return -EROFS; /* Am I creating a permanently empty directory? */ - if (header->ctl_table_size > 0 && - sysctl_is_perm_empty_ctl_header(header)) { + if (sysctl_is_perm_empty_ctl_header(header)) { if (!RB_EMPTY_ROOT(&dir->root)) return -EINVAL; sysctl_set_perm_empty_ctl_header(dir_h); From patchwork Thu Feb 22 07:07:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13566779 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 536F4FBF4; Thu, 22 Feb 2024 07:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708585705; cv=none; b=fmU1zrJOudW0bPtaMZadLdgkSLprR7tYKkge/XFmqPcput0cnbjEDYfogjI+u+04OC10zvEhU0uLQJ2kzwLEiK8KmkRjgH5Cp/R5id6zryxy2v6l793trWN/SRGCPn3hNlGHS8UgxkXeMTA73p/BULKfg9ViIKwhqaxBIvYeedw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708585705; c=relaxed/simple; bh=4zCBJsh7fJS40bmuhRJsZyTvqmWDnPyWNdh+rXA5TBE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PNN/hJkXbVU+9gzBgDnwsGZAaUVn+lWvqGhd9R4hhbjNX/Wk5m27/ATumhNgd0ki7tnzeZYB8WIXORPaqWMD/GYjHS+Ufx4uZwHxnl1lDuXKqE4y6maCZv+4wdM+QhSVfAW48uSBjDn7PY0SyECc/wAhm80XfP37aSboSWc9qJA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=kfpfrpSn; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="kfpfrpSn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1708585697; bh=4zCBJsh7fJS40bmuhRJsZyTvqmWDnPyWNdh+rXA5TBE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kfpfrpSn5Sosahn9w0/N4Hwunvz/qC0SqCcA70XH9LYfF11Y1Bvyz/e2FzgXTVI80 D89tkTexwvJib32t8Nl+fWegmBEnjtoxweReaKb2iXzisfkAraIAMuHBgU9eAfTww1 u7QLIfFaam4nk6FIYvVD656XrP7G0Uta9mIg2B0Y= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 22 Feb 2024 08:07:39 +0100 Subject: [PATCH 4/4] sysctl: remove unnecessary sentinel element Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240222-sysctl-empty-dir-v1-4-45ba9a6352e8@weissschuh.net> References: <20240222-sysctl-empty-dir-v1-0-45ba9a6352e8@weissschuh.net> In-Reply-To: <20240222-sysctl-empty-dir-v1-0-45ba9a6352e8@weissschuh.net> To: "Eric W. Biederman" , Luis Chamberlain , Kees Cook , Joel Granados Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?T?= =?utf-8?q?homas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708585698; l=791; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=4zCBJsh7fJS40bmuhRJsZyTvqmWDnPyWNdh+rXA5TBE=; b=WV3z1hGVhUXi4muzHz37oKOsSKmI58FcQqf5wS6HJGnQ+1+6bAHJbYjCw1dcDstuNx872V0W9 QP2m1pZzqyFBT/bAmcNoZ6/2Z3Nv6g6kx4zPCXWQul/wG9igeJlNI6V X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The previous commits made this sentinel element unnecessary, remove it. Signed-off-by: Thomas Weißschuh --- fs/proc/proc_sysctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 4cdf98c6a9a4..7c0e27dc3d9d 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -30,9 +30,7 @@ static const struct file_operations proc_sys_dir_file_operations; static const struct inode_operations proc_sys_dir_operations; /* Support for permanently empty directories */ -static struct ctl_table sysctl_mount_point[] = { - { } -}; +static struct ctl_table sysctl_mount_point[] = { }; /** * register_sysctl_mount_point() - registers a sysctl mount point