[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220124151611.30db4381d910c853fc0c9728@linux-foundation.org>
Date: Mon, 24 Jan 2022 15:16:11 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: kernel test robot <lkp@...el.com>
Cc: Tong Zhang <ztong0001@...il.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Eric Biederman <ebiederm@...ssion.com>,
Kees Cook <keescook@...omium.org>,
Luis Chamberlain <mcgrof@...nel.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
Linux Memory Management List <linux-mm@...ck.org>,
Luis Chamberlain <mcgrof@...nel.org>
Subject: Re: [PATCH v1] binfmt_misc: fix crash when load/unload module
On Mon, 24 Jan 2022 19:40:53 +0800 kernel test robot <lkp@...el.com> wrote:
> Hi Tong,
>
>
> >> fs/binfmt_misc.c:828:21: error: incompatible pointer types assigning to 'struct ctl_table_header *' from 'struct sysctl_header *' [-Werror,-Wincompatible-pointer-types]
> binfmt_misc_header = register_sysctl_mount_point("fs/binfmt_misc");
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
>
>
> vim +828 fs/binfmt_misc.c
>
> 821
> 822 static int __init init_misc_binfmt(void)
> 823 {
> 824 int err = register_filesystem(&bm_fs_type);
> 825 if (!err)
> 826 insert_binfmt(&misc_format);
> 827
> > 828 binfmt_misc_header = register_sysctl_mount_point("fs/binfmt_misc");
> 829 if (!binfmt_misc_header) {
> 830 pr_warn("Failed to create fs/binfmt_misc sysctl mount point");
> 831 return -ENOMEM;
> 832 }
> 833 return 0;
> 834 }
> 835
This is actually a blooper in Luis's "sysctl: add helper to register a
sysctl mount point".
Please test, review, ridicule, etc:
From: Andrew Morton <akpm@...ux-foundation.org>
Subject: include/linux/sysctl.h: fix register_sysctl_mount_point() return type
The CONFIG_SYSCTL=n stub returns the wrong type.
Fixes: ee9efac48a082 ("sysctl: add helper to register a sysctl mount point")
Cc: Luis Chamberlain <mcgrof@...nel.org>
Cc: Tong Zhang <ztong0001@...il.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
include/linux/sysctl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/sysctl.h~a
+++ a/include/linux/sysctl.h
@@ -265,7 +265,7 @@ static inline struct ctl_table_header *r
return NULL;
}
-static inline struct sysctl_header *register_sysctl_mount_point(const char *path)
+static inline struct ctl_table_header *register_sysctl_mount_point(const char *path)
{
return NULL;
}
_
Powered by blists - more mailing lists