* [PATCH 07/14] staging: tidspbridge: check return code of get_user
@ 2010-09-05 18:32 Kulikov Vasiliy
0 siblings, 0 replies; only message in thread
From: Kulikov Vasiliy @ 2010-09-05 18:32 UTC (permalink / raw)
To: kernel-janitors
Cc: Vasiliy Kulikov, Greg Kroah-Hartman, Ernesto Ramos,
Nishanth Menon, Ivan Gomez Castellanos, Felipe Contreras, devel,
linux-kernel
From: Vasiliy Kulikov <segooon@gmail.com>
Function get_user may fail. Check for it.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
I couldn't compile this driver at all, so it is not tested.
drivers/staging/tidspbridge/pmgr/dspapi.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c
index b23591b..faf8304 100644
--- a/drivers/staging/tidspbridge/pmgr/dspapi.c
+++ b/drivers/staging/tidspbridge/pmgr/dspapi.c
@@ -872,7 +872,11 @@ u32 procwrap_load(union trapped_args *args, void *pr_ctxt)
/* number of elements in the envp array including NULL */
count = 0;
do {
- get_user(temp, args->args_proc_load.user_envp + count);
+ if (get_user(temp,
+ args->args_proc_load.user_envp + count)) {
+ status = -EFAULT;
+ goto func_cont;
+ }
count++;
} while (temp);
envp = kmalloc(count * sizeof(u8 *), GFP_KERNEL);
--
1.7.0.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-09-05 18:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-05 18:32 [PATCH 07/14] staging: tidspbridge: check return code of get_user Kulikov Vasiliy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox