Bugzilla – Attachment 2879 Details for
Bug 2619
infinite loop, 100% cpu use in ssh if ^Z is pressed at password prompt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
readpassphrase: mask off signals while we resend them.
openssh-readpassphrase-sigmask.patch (text/plain), 1.25 KB, created by
Darren Tucker
on 2016-10-15 03:26:11 AEDT
(
hide
)
Description:
readpassphrase: mask off signals while we resend them.
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2016-10-15 03:26:11 AEDT
Size:
1.25 KB
patch
obsolete
>diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c >index c99b4e2..4011be4 100644 >--- a/openbsd-compat/readpassphrase.c >+++ b/openbsd-compat/readpassphrase.c >@@ -67,6 +67,7 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) > struct termios term, oterm; > struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; > struct sigaction savetstp, savettin, savettou, savepipe; >+ sigset_t currset, saveset; > > /* I suppose we could alloc on demand in this case (XXX). */ > if (bufsiz == 0) { >@@ -174,9 +175,16 @@ restart: > (void)close(input); > > /* >- * If we were interrupted by a signal, resend it to ourselves >- * now that we have restored the signal handlers. >+ * If we were interrupted by a signal, resend it to ourselves now that >+ * we have restored the signal handlers. We need to mask off those >+ * signals while we do this otherwise kill(2) may block. > */ >+ sigemptyset(&currset); >+ for (i = 0; i < _NSIG; i++) >+ if (signo[i]) >+ sigaddset(&currset, i); >+ sigprocmask(SIG_BLOCK, &currset, &saveset); >+ > for (i = 0; i < _NSIG; i++) { > if (signo[i]) { > kill(getpid(), i); >@@ -188,6 +196,7 @@ restart: > } > } > } >+ sigprocmask(SIG_SETMASK, &saveset, NULL); > if (need_restart) > goto restart; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2619
:
2879
|
2881