From: Jessica Yu <jeyu@redhat.com>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
Michael Ellerman <mpe@ellerman.id.au>,
Masami Hiramatsu <mhiramat@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kallsyms: Use bounded strnchr() when parsing string
Date: Mon, 24 Apr 2017 14:27:07 -0700 [thread overview]
Message-ID: <20170424212706.mp6vfa4dbgep3kzw@jeyu> (raw)
In-Reply-To: <20170423172343.12739-1-naveen.n.rao@linux.vnet.ibm.com>
+++ Naveen N. Rao [23/04/17 22:53 +0530]:
>When parsing for the <module:name> format, we use strchr() to look for
>the separator, when we know that the module name can't be longer than
>MODULE_NAME_LEN. Enforce the same using strnchr().
>
>Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Applied, thanks!
Jessica
>---
> kernel/module.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/kernel/module.c b/kernel/module.c
>index 7eba6dea4f41..d3bd56ed3541 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -4017,7 +4017,7 @@ unsigned long module_kallsyms_lookup_name(const char *name)
>
> /* Don't lock: we're in enough trouble already. */
> preempt_disable();
>- if ((colon = strchr(name, ':')) != NULL) {
>+ if ((colon = strnchr(name, MODULE_NAME_LEN, ':')) != NULL) {
> if ((mod = find_module_all(name, colon - name, false)) != NULL)
> ret = mod_find_symname(mod, colon+1);
> } else {
>--
>2.12.1
>
prev parent reply other threads:[~2017-04-24 21:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-23 17:23 Naveen N. Rao
2017-04-24 2:12 ` Masami Hiramatsu
2017-04-24 21:27 ` Jessica Yu [this message]
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=20170424212706.mp6vfa4dbgep3kzw@jeyu \
--to=jeyu@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=rusty@rustcorp.com.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®