| Summary: | bld_eprog() signal leak [RHEL-7] | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Filip Krska <fkrska> |
| Component: | zsh | Assignee: | Kamil Dudka <kdudka> |
| Status: | CLOSED DUPLICATE | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 7.2 | CC: | jherrman, kdudka, qe-baseos-apps |
| Target Milestone: | rc | Keywords: | EasyFix, Patch |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Previously, if the zsh process received a signal during the execution of a memory allocation function and the signal handler attempted to allocate or free memory, zsh entered a deadlock and became unresponsive. With this update, signal handlers are no longer enabled while handling the global state of zsh or while using the heap memory allocator, which ensures that the described deadlock no longer occurs.
|
Story Points: | --- |
| Clone Of: | 1311166 | Environment: | |
| Last Closed: | 2016-03-01 12:40:07 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Filip Krska
2016-02-23 14:43:48 UTC
(In reply to Filip Krska from comment #0) > zsh-5.0.2-18.el7 will suffer as well. Fixed in upstream zsh-5.2, backport > patch proposal: > > diff -up zsh-4.3.11/Src/parse.c.bld_eprog_sigleak zsh-4.3.11/Src/parse.c > --- zsh-4.3.11/Src/parse.c.bld_eprog_sigleak 2016-02-23 15:34:15.063441138 > +0100 > +++ zsh-4.3.11/Src/parse.c 2016-02-23 15:35:04.369447251 +0100 > @@ -391,6 +391,8 @@ bld_eprog(void) > Eprog ret; > int l; > > + queue_signals(); > + > ecadd(WCB_END()); > > ret = (Eprog) zhalloc(sizeof(*ret)); > @@ -413,6 +415,8 @@ bld_eprog(void) > zfree(ecbuf, eclen); > ecbuf = NULL; > > + unqueue_signals(); > + > return ret; > } Thanks! This hunk is taken from a bigger upstream commit: https://sourceforge.net/p/zsh/code/ci/99586845 Would it also make sense to pick the other hunk for parse.c? --- a/Src/parse.c +++ b/Src/parse.c @@ -456,6 +456,8 @@ init_parse_status(void) void init_parse(void) { + queue_signals(); + if (ecbuf) zfree(ecbuf, eclen); ecbuf = (Wordcode) zalloc((eclen = EC_INIT_SIZE) * sizeof(wordcode)); @@ -466,6 +468,8 @@ init_parse(void) ecnfunc = 0; init_parse_status(); + + unqueue_signals(); } /* Build eprog. */ > Please, consider re-initiating talks about calling free() (non signal safe > function i.e. not supposed to be called from signal handlers) from > zhandler() and re-scan of rhel6/7/upstream zsh code for any other possible > signal leaks again. I keep gathering commits like this at bug #1198671. The one you picked the hunk from is already mentioned there (bug #1198671 comment #5). The problem is that these upstream patches are not exactly safe. They introduced regressions when they landed upstream. I do not think we want to propagate them to RHEL. I am closing this as a duplicate of bug #1198671 because the proposed patch is already included in the patch for bug #1198671. *** This bug has been marked as a duplicate of bug 1198671 *** |