[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170424212706.mp6vfa4dbgep3kzw@jeyu>
Date: Mon, 24 Apr 2017 14:27:07 -0700
From: Jessica Yu <jeyu@...hat.com>
To: "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
Cc: Rusty Russell <rusty@...tcorp.com.au>,
Michael Ellerman <mpe@...erman.id.au>,
Masami Hiramatsu <mhiramat@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kallsyms: Use bounded strnchr() when parsing string
+++ 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@...ux.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
>
Powered by blists - more mailing lists