Bug 453099 - Cups crashed when reloading config which has the same printer listed more than once
Cups crashed when reloading config which has the same printer listed more tha...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: cups (Show other bugs)
4.6
All Linux
low Severity medium
: rc
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-27 05:54 EDT by Mathijs Brands
Modified: 2009-06-08 10:52 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
* printers in CUPS should have unique names. However, if a CUPS configuration file somehow contained entries for more than one device with the same name, the CUPS scheduler would create a segmentation fault and crash while starting up. CUPS now includes code that examines each printer while loading it from the configuration file. CUPS will not attempt to load duplicate entries, but will log an error.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-18 16:21:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Example printers.conf that causes a segfault (371 bytes, application/octet-stream)
2008-06-27 06:58 EDT, Mathijs Brands
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
CUPS Bugs and Features 3068 None None None Never

  None (edit)
Description Mathijs Brands 2008-06-27 05:54:55 EDT
Description of problem:

If a printer is listed multiple times in /etc/cups/printers.conf, a 'restart'
operation will succeed but a 'reload' will cause a segfault in the scheduler.


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

1.1.22-0.rc1.9.20.2.el4_6.8


How reproducible:

Every time.


Steps to Reproduce:
1. Create a cups printer config (/etc/cups/printers.conf) and list the same
printer twice.
2. Run 'service cups reload'.
  

Actual results:

Cups segfaults (see additional info).


Expected results:

Cups should not segfault, but treat the (admittedly erronous) double entries in
the same way as it does when you (re)start cups.


Additional info:

Breakpoint 1, mimeDeleteType (mime=0x552abe9bd0, mt=0x552af54840) at mime.c:133
133       free(mt->type);
1: mt->type = 0x47ffffff7 <Address 0x47ffffff7 out of bounds>
(gdb)

The pointer that is being freed is not NULL.
Comment 1 Mathijs Brands 2008-06-27 06:56:34 EDT
Test case to reproduce needs to be modified a bit: the printer names must be the
same, but the device must be different.

I will attach an example that works.
Comment 2 Mathijs Brands 2008-06-27 06:58:20 EDT
Created attachment 310424 [details]
Example printers.conf that causes a segfault
Comment 3 RHEL Product and Program Management 2008-10-31 12:36:16 EDT
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 7 Tim Waugh 2009-01-20 12:32:35 EST
Filed upstream with patch.
Comment 9 Ruediger Landmann 2009-01-26 22:28:48 EST
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
* printers in CUPS should have unique names. However, if a CUPS configuration file somehow contained entries for more than one device containing the same name, the CUPS scheduler would create a segmentation fault and crash while starting up. CUPS now includes code that examines each printer while loading it from the configuration file. CUPS will not attempt to load duplicate entries, but will log an error.
Comment 10 Ruediger Landmann 2009-01-26 22:30:33 EST
Release note updated. If any revisions are required, please set the 
"requires_release_notes"  flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

Diffed Contents:
@@ -1 +1 @@
-* printers in CUPS should have unique names. However, if a CUPS configuration file somehow contained entries for more than one device containing the same name, the CUPS scheduler would create a segmentation fault and crash while starting up. CUPS now includes code that examines each printer while loading it from the configuration file. CUPS will not attempt to load duplicate entries, but will log an error.+* printers in CUPS should have unique names. However, if a CUPS configuration file somehow contained entries for more than one device with the same name, the CUPS scheduler would create a segmentation fault and crash while starting up. CUPS now includes code that examines each printer while loading it from the configuration file. CUPS will not attempt to load duplicate entries, but will log an error.
Comment 13 errata-xmlrpc 2009-05-18 16:21:20 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0989.html

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