From: Kees Cook <keescook@chromium.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <shuah@kernel.org>,
"Luis R . Rodriguez" <mcgrof@kernel.org>,
Chris Wilson <chris@chris-wilson.co.uk>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Masami Hiramatsu <masami.hiramatsu@linaro.org>
Subject: Re: [PATCH 2/4] lib: Make test_sysctl initialized as module
Date: Thu, 28 May 2020 22:52:18 -0700 [thread overview]
Message-ID: <202005282250.5E37391@keescook> (raw)
In-Reply-To: <159067753624.229397.13771427935697541820.stgit@devnote2>
On Thu, May 28, 2020 at 11:52:16PM +0900, Masami Hiramatsu wrote:
> test_sysctl.c is expected to be used as a module, but since
> it does not use module_init(), it never be registered as
> a module and not appeared under /sys/module/.
> In the result, the selftests/sysctl/sysctl.sh always fails
> to find the test module and is skipped.
>
> This makes test_sysctl.c initialized as a module by module_init()
> and allow sysctl.sh to find the test module is loaded.
>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> lib/test_sysctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/test_sysctl.c b/lib/test_sysctl.c
> index 566dad3f4196..ec4d0f03475d 100644
> --- a/lib/test_sysctl.c
> +++ b/lib/test_sysctl.c
> @@ -149,7 +149,7 @@ static int __init test_sysctl_init(void)
> }
> return 0;
> }
> -late_initcall(test_sysctl_init);
> +module_init(test_sysctl_init);
This is the only part I think we need to double check. As a non-module,
module_init() becomes device_initcall() not late_initcall().
I don't see any notes in the commit log for the original driver that
mention why this needs to be late_initcall(), though, so I *think* it's
safe. Luis?
--
Kees Cook
next prev parent reply other threads:[~2020-05-29 5:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-28 14:51 [PATCH 0/4] selftests, sysctl, lib: Fix prime_numbers and sysctl test to run Masami Hiramatsu
2020-05-28 14:52 ` [PATCH 1/4] lib: Make prime number generator independently selectable Masami Hiramatsu
2020-05-29 5:56 ` Kees Cook
2020-05-29 13:55 ` Masami Hiramatsu
2020-06-01 13:15 ` Luis Chamberlain
2020-05-28 14:52 ` [PATCH 2/4] lib: Make test_sysctl initialized as module Masami Hiramatsu
2020-05-29 5:52 ` Kees Cook [this message]
2020-06-01 13:14 ` Luis Chamberlain
2020-05-28 14:52 ` [PATCH 3/4] selftests/sysctl: Fix to load test_sysctl module Masami Hiramatsu
2020-05-29 5:57 ` Kees Cook
2020-06-01 13:15 ` Luis Chamberlain
2020-05-28 14:52 ` [PATCH 4/4] selftests/sysctl: Make sysctl test driver as a module Masami Hiramatsu
2020-05-29 5:57 ` Kees Cook
2020-06-01 13:15 ` Luis Chamberlain
2020-05-29 14:14 ` [PATCH 0/4] selftests, sysctl, lib: Fix prime_numbers and sysctl test to run Shuah Khan
2020-05-29 14:39 ` Masami Hiramatsu
2020-06-02 16:32 ` Shuah Khan
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=202005282250.5E37391@keescook \
--to=keescook@chromium.org \
--cc=chris@chris-wilson.co.uk \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=masami.hiramatsu@linaro.org \
--cc=mcgrof@kernel.org \
--cc=mhiramat@kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.