Bug 167127

Summary: cal writes across stack boundary
Product: [Fedora] Fedora Reporter: Jerry James <loganjerry>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED WORKSFORME QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-03 12:54:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jerry James 2005-08-30 17:18:26 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc4 Firefox/1.0.6

Description of problem:
When libsafe from Fedora Extras is installed, any attempt at using cal from the util-linux package results in output like this:

$ cal 2005
Libsafe version 2.0.16c
Detected an attempt to write across stack boundary.
Terminating /usr/bin/cal.
    uid=500  euid=500  pid=23879
Call stack:
    0x7a6a83    /lib/libsafe.so.2.0.16c
    0x7a71c5    /lib/libsafe.so.2.0.16c
    0x8049f3b   /usr/bin/cal
    0x804a1f2   /usr/bin/cal
    0x198d5a    /lib/libc-2.3.5.so
Overflow caused by wcscat()
Killed

Without libsafe installed, cal runs without complaint under both valgrind and Electric Fence.

Version-Release number of selected component (if applicable):
util-linux-2.12p-9.7

How reproducible:
Always

Steps to Reproduce:
1. Install libsafe from Fedora Extras
2. Run cal with any arguments
3.
  

Actual Results:  A libsafe error is produced and cal is shut down without producing output.

Expected Results:  Cal should have produced its requested output.

Additional info:

Comment 1 Karel Zak 2005-10-03 12:54:14 UTC
I haven't found anything wrong in the code. We use FORTIFY_SOURCE and
-fstack-protector -- it makes libsafe obsolete.