bugGNU Screen - Bugs: bug #55511, Prevent Panic causing Panic, and...

 
 

bug #55511: Prevent Panic causing Panic, and children removing sockets

Submitter:  Scott Shambarger <sshambar>
Submitted:  Fri 18 Jan 2019 06:41:51 PM UTC
   
 
Category:  Program Logic Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  4.6.2
Fixed Release:  None Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 11 Feb 2019 09:02:19 PM UTC, comment #1: 

Thanks, applied to both screen-v4 and master (with some changes, I dropped the leaked file descriptor path, because it's closed after the switch, no need to close it twice ;) )

Amadeusz Sławiński <amade>
Group administrator
Fri 18 Jan 2019 06:41:51 PM UTC, original submission:  

While tracking down another screen bug, I noticed that I wasn't getting Panic messages from child processes, and my screen socket kept disappearing.

This is all related to suid root screen (tested on OSX, but probably applies to other suid ports).

The problem is that in several places forked child processes call setuid, but don't set eff_uid to the new uid.  Any child Panic will call SendErrorMsg, which will create a child socket, which calls xseteuid(eff_uid=0) after the socket is created -- and that leads to another Panic.

This prevented the error from being sent.

In addition, since ServerSocket is still valid, when the child Panic calls eexit(), it removes the socket file.

I've created a patch that fixes both of these bugs (and fixes a leaked file descriptor or fork fails, which probably doesn't happen often :)

Patch is attached.


Scott Shambarger <sshambar>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by amade (Posted a comment)
  • -email is unavailable- added by sshambar (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-11 amade StatusNone Fixed
        Open/ClosedOpen Closed
    2019-01-18 sshambar Attached File- Added Prevent-Panic-causing-Panic-and-children-removing-sockets.diff, #46014

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code