Bug 481146 - phosphor crashes due to derefencing NULL FILE*
Summary: phosphor crashes due to derefencing NULL FILE*
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: xscreensaver
Version: 9
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Mamoru TASAKA
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-22 12:58 UTC by John Sullivan
Modified: 2009-01-24 02:43 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-01-24 02:43:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
proposed fix (526 bytes, patch)
2009-01-22 12:58 UTC, John Sullivan
no flags Details | Diff

Description John Sullivan 2009-01-22 12:58:44 UTC
Created attachment 329709 [details]
proposed fix

Description of problem:

When (without -pipe) the child exits, state->pipe is cleared but state->pid is not. Later on, state->pid is used to determine whether to send a message to the child (via state->pipe) it tests only the value of state->pid.

This can be forced by running with -window and resizing the window between child runs (which attempts to ioctl TIOCWINSZ on the pipe).

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

xscreensaver-extras-5.08-1.fc9.x86_64

How reproducible:

The resize case, very. I think there's another semi-random crash case too though.

Steps to Reproduce:
1. Run phosphor with -window
2. Resize window
3.
  
Actual results:

SEGV

Expected results:

No SEGV

Additional info:

Attached patch does two things: clear state->pid once we know the child has exited, and check state->pipe before attempting to dereference it.

Comment 1 Mamoru TASAKA 2009-01-22 13:54:40 UTC
Well, I can reproduce what you see and your proposal patch
seems reasonable. I will release the modified xscreensaver,
thanks.

Comment 2 Mamoru TASAKA 2009-01-22 15:45:11 UTC
5.08-5.fc{11,10,9} is submitted:
For F-9:
http://koji.fedoraproject.org/koji/buildinfo?buildID=79778

Comment 3 Fedora Update System 2009-01-24 02:39:42 UTC
xscreensaver-5.08-5.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2009-01-24 02:43:10 UTC
xscreensaver-5.08-5.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.


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