Bug 1031384

Summary: anacron segfaults with certain config data
Product: Red Hat Enterprise Linux 7 Reporter: Martin Poole <mpoole>
Component: cronieAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED CURRENTRELEASE QA Contact: Jakub Prokes <jprokes>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: bugproxy, hannsj_uhl, jscotka, ksrot, pbunyan, pkis
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cronie-1.4.11-11.el7 Doc Type: Bug Fix
Doc Text:
Cause: Anacron didn't check configuration file well. Consequence: Anacron segfaulted with incorrect configuration like START_HOURS_RANGE=0 Fix: Configuration is now checked properly. Result: No segfaults by anacron configuration.
Story Points: ---
Clone Of: 1031383 Environment:
Last Closed: 2014-06-13 11:50:53 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:
Bug Depends On: 1031383    
Bug Blocks: 744225    
Attachments:
Description Flags
patch to correctly check match_rx return codes
none
dmesg trace logs none

Description Martin Poole 2013-11-17 14:06:46 UTC
Created attachment 825148 [details]
patch to correctly check match_rx return codes

+++ This bug was initially created as a clone of Bug #1031383 +++

Description of problem:

anacron does not correctly check configuration parameters for validity and can segfault on certain data types

The return code from the match_rx calls in readtab.c are not being checked correctly, 

Version-Release number of selected component (if applicable):

cronie-1.4.4-10.el6

How reproducible:

Always

Steps to Reproduce:
1. Set  START_HOURS_RANGE=0

Actual results:

Segmentation fault


Additional info:

There is also a possible divide-by-zero segfault if RANDOM_DELAY=0.

Comment 2 Karel Srot 2014-01-20 13:31:37 UTC
Switching back to ASSIGNED. I believe the patch introduced a regression.

# rpm -qa | grep cron
cronie-anacron-1.4.11-7.el7.x86_64
cronie-1.4.11-7.el7.x86_64

with 
RANDOM_DELAY=45
in /etc/anacrontab I am getting:

# anacron -f -d 
Anacron started on 2014-01-20
anacron: Regex error reading /etc/anacrontab
anacron: Aborted

It worked with cronie-1.4.11-6.el7

Comment 3 Marcela Mašláňová 2014-01-20 17:12:37 UTC
It was already opened as rhbz#1031384. Which one do you want to close?

Comment 4 Karel Srot 2014-01-21 07:19:10 UTC
(In reply to Marcela Mašláňová from comment #3)
> It was already opened as rhbz#1031384. Which one do you want to close?

Hi Marcela, seems like a wrong bug reference (or wrong bug for this comment).

Comment 5 Marcela Mašláňová 2014-01-21 08:01:12 UTC
*** Bug 1055549 has been marked as a duplicate of this bug. ***

Comment 6 Marcela Mašláňová 2014-01-22 14:15:41 UTC
Coverity found another problem in checking values. Fixed in new build.

Comment 9 Marcela Mašláňová 2014-02-06 09:49:56 UTC
*** Bug 1062132 has been marked as a duplicate of this bug. ***

Comment 10 IBM Bug Proxy 2014-02-06 09:56:10 UTC
Created attachment 860082 [details]
dmesg trace logs

default comment by bridge

Comment 11 Marcela Mašláňová 2014-02-09 08:24:17 UTC
*** Bug 1062666 has been marked as a duplicate of this bug. ***

Comment 12 IBM Bug Proxy 2014-02-21 09:01:45 UTC
------- Comment From mgrf.com 2014-02-21 08:55 EDT-------
This is verified included in snap 7 - closing on IBM site (for System z only as this is a DUP on Red Hat site)

Comment 15 Ludek Smid 2014-06-13 11:50:53 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 17 IBM Bug Proxy 2019-04-08 16:25:06 UTC
------- Comment From hannsj_uhl.com 2019-04-08 10:13 EDT-------
.