aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShi Weihua <shiwh@cn.fujitsu.com>2007-12-02 23:57:50 -0500
committerTony Luck <tony.luck@intel.com>2007-12-07 19:10:59 -0500
commitb9ab117c2f2eac8432def6a2ea03711bfa7f35d5 (patch)
tree28dc232ed814d137ad3db21759054420e41e526c
parentbdc2619ab95d45d434c16d5c216bc6243761f6fb (diff)
[IA64] signal : fix missing error checkings
Not all the return value of __copy_from_user and __put_user is checked.This patch fixed it. Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/kernel/signal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
index cdb64cc4d9c8..4c730099d58f 100644
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -98,7 +98,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
98 if ((flags & IA64_SC_FLAG_FPH_VALID) != 0) { 98 if ((flags & IA64_SC_FLAG_FPH_VALID) != 0) {
99 struct ia64_psr *psr = ia64_psr(&scr->pt); 99 struct ia64_psr *psr = ia64_psr(&scr->pt);
100 100
101 __copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16); 101 err |= __copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16);
102 psr->mfh = 0; /* drop signal handler's fph contents... */ 102 psr->mfh = 0; /* drop signal handler's fph contents... */
103 preempt_disable(); 103 preempt_disable();
104 if (psr->dfh) 104 if (psr->dfh)
@@ -244,7 +244,7 @@ static long
244setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratch *scr) 244setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratch *scr)
245{ 245{
246 unsigned long flags = 0, ifs, cfm, nat; 246 unsigned long flags = 0, ifs, cfm, nat;
247 long err; 247 long err = 0;
248 248
249 ifs = scr->pt.cr_ifs; 249 ifs = scr->pt.cr_ifs;
250 250
@@ -257,12 +257,12 @@ setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratc
257 ia64_flush_fph(current); 257 ia64_flush_fph(current);
258 if ((current->thread.flags & IA64_THREAD_FPH_VALID)) { 258 if ((current->thread.flags & IA64_THREAD_FPH_VALID)) {
259 flags |= IA64_SC_FLAG_FPH_VALID; 259 flags |= IA64_SC_FLAG_FPH_VALID;
260 __copy_to_user(&sc->sc_fr[32], current->thread.fph, 96*16); 260 err = __copy_to_user(&sc->sc_fr[32], current->thread.fph, 96*16);
261 } 261 }
262 262
263 nat = ia64_get_scratch_nat_bits(&scr->pt, scr->scratch_unat); 263 nat = ia64_get_scratch_nat_bits(&scr->pt, scr->scratch_unat);
264 264
265 err = __put_user(flags, &sc->sc_flags); 265 err |= __put_user(flags, &sc->sc_flags);
266 err |= __put_user(nat, &sc->sc_nat); 266 err |= __put_user(nat, &sc->sc_nat);
267 err |= PUT_SIGSET(mask, &sc->sc_mask); 267 err |= PUT_SIGSET(mask, &sc->sc_mask);
268 err |= __put_user(cfm, &sc->sc_cfm); 268 err |= __put_user(cfm, &sc->sc_cfm);