All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.4.17: sys_sigsuspend does not return value
@ 2002-01-18 21:08 Pavel Machek
  2002-01-18 23:59 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2002-01-18 21:08 UTC (permalink / raw)
  To: kernel list

Hi!

>From 2.4.17:

asmlinkage int
sys_sigsuspend(int history0, int history1, old_sigset_t mask)
{
        struct pt_regs * regs = (struct pt_regs *) &history0;
        sigset_t saveset;

        mask &= _BLOCKABLE;
        spin_lock_irq(&current->sigmask_lock);
        saveset = current->blocked;
        siginitset(&current->blocked, mask);
        recalc_sigpending(current);
        spin_unlock_irq(&current->sigmask_lock);

        regs->eax = -EINTR;
        while (1) {
                current->state = TASK_INTERRUPTIBLE;
                schedule();
                if (do_signal(regs, &saveset))
                        return -EINTR;
        }
}

...Which looks to me like it returns something undefined when
do_signal returns 0. What prevents gcc from having "top secret" value
in eax, and from returning that value to userspace?
									Pavel
-- 
(about SSSCA) "I don't say this lightly.  However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: 2.4.17: sys_sigsuspend does not return value
  2002-01-18 21:08 2.4.17: sys_sigsuspend does not return value Pavel Machek
@ 2002-01-18 23:59 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2002-01-18 23:59 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list

Pavel Machek <pavel@suse.cz> writes:

|> Hi!
|> 
|> >From 2.4.17:
|> 
|> asmlinkage int
|> sys_sigsuspend(int history0, int history1, old_sigset_t mask)
|> {
|>         struct pt_regs * regs = (struct pt_regs *) &history0;
|>         sigset_t saveset;
|> 
|>         mask &= _BLOCKABLE;
|>         spin_lock_irq(&current->sigmask_lock);
|>         saveset = current->blocked;
|>         siginitset(&current->blocked, mask);
|>         recalc_sigpending(current);
|>         spin_unlock_irq(&current->sigmask_lock);
|> 
|>         regs->eax = -EINTR;
|>         while (1) {
           ^^^^^^^^^
|>                 current->state = TASK_INTERRUPTIBLE;
|>                 schedule();
|>                 if (do_signal(regs, &saveset))
|>                         return -EINTR;
|>         }
|> }
|> 
|> ...Which looks to me like it returns something undefined when
|> do_signal returns 0.

There is only one return path from this function.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-18 23:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-18 21:08 2.4.17: sys_sigsuspend does not return value Pavel Machek
2002-01-18 23:59 ` Andreas Schwab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.