Commit b9ab117c authored by Shi Weihua's avatar Shi Weihua Committed by Tony Luck

[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: default avatarShi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent bdc2619a
...@@ -98,7 +98,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr) ...@@ -98,7 +98,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
if ((flags & IA64_SC_FLAG_FPH_VALID) != 0) { if ((flags & IA64_SC_FLAG_FPH_VALID) != 0) {
struct ia64_psr *psr = ia64_psr(&scr->pt); struct ia64_psr *psr = ia64_psr(&scr->pt);
__copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16); err |= __copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16);
psr->mfh = 0; /* drop signal handler's fph contents... */ psr->mfh = 0; /* drop signal handler's fph contents... */
preempt_disable(); preempt_disable();
if (psr->dfh) if (psr->dfh)
...@@ -244,7 +244,7 @@ static long ...@@ -244,7 +244,7 @@ static long
setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratch *scr) setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratch *scr)
{ {
unsigned long flags = 0, ifs, cfm, nat; unsigned long flags = 0, ifs, cfm, nat;
long err; long err = 0;
ifs = scr->pt.cr_ifs; ifs = scr->pt.cr_ifs;
...@@ -257,12 +257,12 @@ setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratc ...@@ -257,12 +257,12 @@ setup_sigcontext (struct sigcontext __user *sc, sigset_t *mask, struct sigscratc
ia64_flush_fph(current); ia64_flush_fph(current);
if ((current->thread.flags & IA64_THREAD_FPH_VALID)) { if ((current->thread.flags & IA64_THREAD_FPH_VALID)) {
flags |= IA64_SC_FLAG_FPH_VALID; flags |= IA64_SC_FLAG_FPH_VALID;
__copy_to_user(&sc->sc_fr[32], current->thread.fph, 96*16); err = __copy_to_user(&sc->sc_fr[32], current->thread.fph, 96*16);
} }
nat = ia64_get_scratch_nat_bits(&scr->pt, scr->scratch_unat); nat = ia64_get_scratch_nat_bits(&scr->pt, scr->scratch_unat);
err = __put_user(flags, &sc->sc_flags); err |= __put_user(flags, &sc->sc_flags);
err |= __put_user(nat, &sc->sc_nat); err |= __put_user(nat, &sc->sc_nat);
err |= PUT_SIGSET(mask, &sc->sc_mask); err |= PUT_SIGSET(mask, &sc->sc_mask);
err |= __put_user(cfm, &sc->sc_cfm); err |= __put_user(cfm, &sc->sc_cfm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment