RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1177852 - managesieve can segfault compiling certain sieve scripts
Summary: managesieve can segfault compiling certain sieve scripts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dovecot
Version: 7.0
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-30 22:12 UTC by Orion Poplawski
Modified: 2016-11-04 07:22 UTC (History)
3 users (show)

Fixed In Version: dovecot-2.2.10-7.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 07:22:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2477 0 normal SHIPPED_LIVE dovecot bug fix and enhancement update 2016-11-03 14:08:22 UTC

Description Orion Poplawski 2014-12-30 22:12:17 UTC
Description of problem:

The sieve plugin for Thundirbird likes to rapidly compile work in progress sieve scripts to continually give feedback on any errors in the script.  This can trigger segmentation faults in lib-sieve with certain pathologically incomplete sieve scripts.  One example:

#0  tag_comparator_validate (valdtr=0x7f291aa713a0, arg=0x7fff5c3cfa58,
    cmd=0x7f291aa69360) at sieve-comparators.c:143
143        if ( (*arg)->type != SAAT_STRING ) {
(gdb) list
138        *arg = sieve_ast_argument_next(*arg);
139   
140        /* Check syntax:
141         *   ":comparator" <comparator-name: string>
142         */
143        if ( (*arg)->type != SAAT_STRING ) {
144            sieve_argument_validate_error(valdtr, *arg,
145                ":comparator tag requires one string argument, but %s was found",
146                sieve_ast_argument_name(*arg) );
147            return FALSE;
(gdb) print arg
$1 = (struct sieve_ast_argument **) 0x7fff5c3cfa58
(gdb) print *arg
$2 = (struct sieve_ast_argument *) 0x0

So sieve_ast_argument_next() is returning NULL and we're trying to dereference it without checking.

Fix has been checked in upstream: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/b6c55ac6460d

Version-Release number of selected component (if applicable):
dovecot-2.2.10-4.el7_0.1.x86_64

Comment 4 Frantisek Sumsal 2016-09-26 08:48:21 UTC
Verified with dovecot-2.2.10-7.el7.

Old package:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: [BZ#1177852] managesieve segfault
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'touch mail' (Expected 0, got 0)
:: [   INFO   ] :: Testing sieve: if address :comparator { }
:: [   PASS   ] :: Command 'echo 'if address :comparator { }' > sieve' (Expected 0, got 0)
:: [   FAIL   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 139)
:: [   INFO   ] :: Testing sieve: if address :comparator 1 "from" "frop" { }
:: [   PASS   ] :: Command 'echo 'if address :comparator 1 "from" "frop" { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   INFO   ] :: Testing sieve: if address :comparator ["a", "b"] "from" "frop" { }
:: [   PASS   ] :: Command 'echo 'if address :comparator ["a", "b"] "from" "frop" { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   INFO   ] :: Testing sieve: if address :comparator :frop "from" "frop" { }
:: [   PASS   ] :: Command 'echo 'if address :comparator :frop "from" "frop" { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   INFO   ] :: Testing sieve: if address :comparator :all "from" "frop" { }
:: [   PASS   ] :: Command 'echo 'if address :comparator :all "from" "frop" { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 10 good, 1 bad
:: [   FAIL   ] :: RESULT: [BZ#1177852] managesieve segfault


New package:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: [BZ#1177852] managesieve segfault
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Command 'touch mail' (Expected 0, got 0)
:: [   INFO   ] :: Testing sieve: if address :comparator { }
:: [   PASS   ] :: Command 'echo 'if address :comparator { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   INFO   ] :: Testing sieve: if address :comparator 1 "from" "frop" { }
:: [   PASS   ] :: Command 'echo 'if address :comparator 1 "from" "frop" { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   INFO   ] :: Testing sieve: if address :comparator ["a", "b"] "from" "frop" { }
:: [   PASS   ] :: Command 'echo 'if address :comparator ["a", "b"] "from" "frop" { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   INFO   ] :: Testing sieve: if address :comparator :frop "from" "frop" { }
:: [   PASS   ] :: Command 'echo 'if address :comparator :frop "from" "frop" { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   INFO   ] :: Testing sieve: if address :comparator :all "from" "frop" { }
:: [   PASS   ] :: Command 'echo 'if address :comparator :all "from" "frop" { }' > sieve' (Expected 0, got 0)
:: [   PASS   ] :: Command 'sieve-test sieve mail' (Expected 0,1,89, got 89)
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 11 good, 0 bad
:: [   PASS   ] :: RESULT: [BZ#1177852] managesieve segfault

Comment 6 errata-xmlrpc 2016-11-04 07:22:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2477.html


Note You need to log in before you can comment on or make changes to this bug.