public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium•org>
To: Luis Chamberlain <mcgrof@kernel•org>
Cc: jack@suse•cz, rafael@kernel•org, airlied@linux•ie,
	amir73il@gmail•com, clemens@ladisch•de,
	dri-devel@lists•freedesktop.org, joseph.qi@linux•alibaba.com,
	sfr@canb•auug.org.au, mark@fasheh•com, rdna@fb•com,
	yzaikin@google•com, joonas.lahtinen@linux•intel.com,
	arnd@arndb•de, intel-gfx@lists•freedesktop.org,
	jani.nikula@linux•intel.com, julia.lawall@lip6•fr,
	jlbec@evilplan•org, rodrigo.vivi@intel•com,
	nixiaoming@huawei•com, vbabka@suse•cz, axboe@kernel•dk,
	tytso@mit•edu, gregkh@linuxfoundation•org,
	linux-kernel@vger•kernel.org, ebiederm@xmission•com,
	daniel@ffwll•ch, akpm@linux-foundation•org,
	linuxppc-dev@lists•ozlabs.org, ocfs2-devel@oss•oracle.com,
	viro@zeniv•linux.org.uk
Subject: Re: [PATCH 13/13] fs: move binfmt_misc sysctl to its own file
Date: Fri, 29 May 2020 01:14:50 -0700	[thread overview]
Message-ID: <202005290113.53AEED2176@keescook> (raw)
In-Reply-To: <20200529074108.16928-14-mcgrof@kernel.org>

On Fri, May 29, 2020 at 07:41:08AM +0000, Luis Chamberlain wrote:
> This moves the binfmt_misc sysctl to its own file to help remove
> clutter from kernel/sysctl.c.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel•org>
> ---
>  fs/binfmt_misc.c | 1 +
>  kernel/sysctl.c  | 7 -------
>  2 files changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
> index f69a043f562b..656b3f5f3bbf 100644
> --- a/fs/binfmt_misc.c
> +++ b/fs/binfmt_misc.c
> @@ -821,6 +821,7 @@ static int __init init_misc_binfmt(void)
>  	int err = register_filesystem(&bm_fs_type);
>  	if (!err)
>  		insert_binfmt(&misc_format);
> +	register_sysctl_empty_subdir("fs", "binfmt_misc");
>  	return err;

Nit: let's make the dir before registering the filesystem. I can't
imagine a realistic situation where userspace is reacting so fast it
would actually fail to mount the fs on /proc/sys/fs/binfmt_misc, but why
risk it?

-Kees

>  }
>  
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index 460532cd5ac8..7714e7b476c2 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -3042,13 +3042,6 @@ static struct ctl_table fs_table[] = {
>  		.extra1		= SYSCTL_ZERO,
>  		.extra2		= SYSCTL_TWO,
>  	},
> -#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
> -	{
> -		.procname	= "binfmt_misc",
> -		.mode		= 0555,
> -		.child		= sysctl_mount_point,
> -	},
> -#endif
>  	{
>  		.procname	= "pipe-max-size",
>  		.data		= &pipe_max_size,
> -- 
> 2.26.2
> 

-- 
Kees Cook

  reply	other threads:[~2020-05-29  8:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  7:40 [PATCH 00/13] sysctl: spring cleaning Luis Chamberlain
2020-05-29  7:40 ` [PATCH 01/13] sysctl: add new register_sysctl_subdir() helper Luis Chamberlain
2020-05-29  8:13   ` Jani Nikula
2020-05-29 12:16     ` Luis Chamberlain
2020-05-29 12:40   ` Eric W. Biederman
2020-05-29 12:42     ` Eric W. Biederman
2020-05-29  7:40 ` [PATCH 02/13] cdrom: use new sysctl subdir helper register_sysctl_subdir() Luis Chamberlain
2020-05-29 12:46   ` Eric W. Biederman
2020-05-29  7:40 ` [PATCH 03/13] hpet: " Luis Chamberlain
2020-05-29  7:40 ` [PATCH 04/13] i915: " Luis Chamberlain
2020-05-29  7:41 ` [PATCH 05/13] macintosh/mac_hid.c: " Luis Chamberlain
2020-05-29  7:41 ` [PATCH 06/13] ocfs2: " Luis Chamberlain
2020-05-29  8:23   ` Kees Cook
2020-05-29 11:49     ` [Intel-gfx] " Luis Chamberlain
2020-05-29 14:49       ` Kees Cook
2020-05-29  7:41 ` [PATCH 07/13] test_sysctl: " Luis Chamberlain
2020-05-29  7:41 ` [PATCH 08/13] inotify: simplify sysctl declaration with register_sysctl_subdir() Luis Chamberlain
2020-05-29  7:41 ` [PATCH 09/13] firmware_loader: " Luis Chamberlain
2020-05-29 10:26   ` Greg KH
2020-05-29 11:59     ` Xiaoming Ni
2020-05-29 12:09     ` Luis Chamberlain
2020-05-29  7:41 ` [PATCH 10/13] eventpoll: " Luis Chamberlain
2020-05-29  7:41 ` [PATCH 11/13] random: " Luis Chamberlain
2020-05-29 10:26   ` Greg KH
2020-05-29 12:09     ` Xiaoming Ni
2020-05-29  7:41 ` [PATCH 12/13] sysctl: add helper to register empty subdir Luis Chamberlain
2020-05-29  8:15   ` Kees Cook
2020-05-29 13:03   ` Eric W. Biederman
2021-11-17  3:30     ` Luis Chamberlain
2020-05-29  7:41 ` [PATCH 13/13] fs: move binfmt_misc sysctl to its own file Luis Chamberlain
2020-05-29  8:14   ` Kees Cook [this message]
2020-06-04  8:45   ` Xiaoming Ni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202005290113.53AEED2176@keescook \
    --to=keescook@chromium$(echo .)org \
    --cc=airlied@linux$(echo .)ie \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=amir73il@gmail$(echo .)com \
    --cc=arnd@arndb$(echo .)de \
    --cc=axboe@kernel$(echo .)dk \
    --cc=clemens@ladisch$(echo .)de \
    --cc=daniel@ffwll$(echo .)ch \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=ebiederm@xmission$(echo .)com \
    --cc=gregkh@linuxfoundation$(echo .)org \
    --cc=intel-gfx@lists$(echo .)freedesktop.org \
    --cc=jack@suse$(echo .)cz \
    --cc=jani.nikula@linux$(echo .)intel.com \
    --cc=jlbec@evilplan$(echo .)org \
    --cc=joonas.lahtinen@linux$(echo .)intel.com \
    --cc=joseph.qi@linux$(echo .)alibaba.com \
    --cc=julia.lawall@lip6$(echo .)fr \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mark@fasheh$(echo .)com \
    --cc=mcgrof@kernel$(echo .)org \
    --cc=nixiaoming@huawei$(echo .)com \
    --cc=ocfs2-devel@oss$(echo .)oracle.com \
    --cc=rafael@kernel$(echo .)org \
    --cc=rdna@fb$(echo .)com \
    --cc=rodrigo.vivi@intel$(echo .)com \
    --cc=sfr@canb$(echo .)auug.org.au \
    --cc=tytso@mit$(echo .)edu \
    --cc=vbabka@suse$(echo .)cz \
    --cc=viro@zeniv$(echo .)linux.org.uk \
    --cc=yzaikin@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox