Ingo Molnar wrote:If you get the Acked-by from Hiroshi-san it looks good to me. He modified this code last.True, but only when either or both of __copy_from_user() andif (!access_ok(VERIFY_READ, frame, sizeof(*frame)))I'm not sure why this eliminates that warning.
goto badframe;
- if (__get_user(set.sig[0], &frame->sc.oldmask) || (_NSIG_WORDS > 1
- && __copy_from_user(&set.sig[1], &frame->extramask,
- sizeof(frame->extramask))))
+
+ if ( (__copy_from_user(&set.sig[1], &frame->extramask,
+ sizeof(frame->extramask)) && _NSIG_WORDS > 1) || + __get_user(set.sig[0], &frame->sc.oldmask))
goto badframe;
set.sig[0] may not be initialized too, if __copy_from_user() failed.
(_NSIG_WORDS > 1) fails. But in all instances set.sig[1] gets
initialized.
I don't have enough time to look at this right now, sorry.Fine. Let Ingo/Thomas/Peter decide whether they would like this fix or
Another question, __copy_from_user() will be called even if
_NSIG_WORDS is less than 2, perhaps it never occurs.
I think, to check _NSIG_WORDS > 1 before calling __copy_from_user()
is better.
drop it.
This seriously looks wrong to me. If _NSIG_WORDS == 1, then calling
__copy_from_user here is a serious error.