[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZW+lQqOSYFfeh8z2@bombadil.infradead.org>
Date: Tue, 5 Dec 2023 14:33:38 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: Thomas Weißschuh <linux@...ssschuh.net>
Cc: Kees Cook <keescook@...omium.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Iurii Zaikin <yzaikin@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Joel Granados <j.granados@...sung.com>,
linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v2 13/18] sysctl: move sysctl type to ctl_table_header
On Mon, Dec 04, 2023 at 08:52:26AM +0100, Thomas Weißschuh wrote:
> @@ -231,7 +231,8 @@ static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header)
> return -EROFS;
>
> /* Am I creating a permanently empty directory? */
> - if (sysctl_is_perm_empty_ctl_header(header)) {
> + if (header->ctl_table == sysctl_mount_point ||
> + sysctl_is_perm_empty_ctl_header(header)) {
> if (!RB_EMPTY_ROOT(&dir->root))
> return -EINVAL;
> sysctl_set_perm_empty_ctl_header(dir_h);
While you're at it.
This just made me cringe, and curious if some other changes
could be done to make this obviously clear during patch review
that this is safe.
Luis
Powered by blists - more mailing lists