Bug 633 - Crash running with close-from option
Crash running with close-from option
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.9
PC Linux
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-04 00:10 MST by Natrio
Modified: 2014-02-04 10:24 MST (History)
0 users

See Also:


Attachments
Fix for ecalloc(0) failure with -C option. (440 bytes, patch)
2014-02-04 05:48 MST, Todd C. Miller
Details | Diff
Better fix for ecalloc(0) failure with -C option. (1.62 KB, patch)
2014-02-04 06:25 MST, Todd C. Miller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Natrio 2014-02-04 00:10:39 MST
sudo-1.8.9p4 crashes with option -C , if closefrom_override enabled in sudoers:
Defaults:root   closefrom_override

# sudo -C 9 -u user /usr/bin/command
sudo: internal error, tried to ecalloc(0)

sudo-1.8.8 works normally.

Tested on latest Arch Linux, builds i686 and armv7h
Comment 1 Natrio 2014-02-04 01:17:55 MST
UPD:
sudo-1.8.9p3 works too.
Comment 2 Natrio 2014-02-04 01:48:12 MST
UPD:
sudo-1.8.10b1 crashes.
The bug is between 1.8.9p3 and 1.8.9p4 versions.
Comment 3 Todd C. Miller 2014-02-04 05:48:33 MST
Created attachment 395 [details]
Fix for ecalloc(0) failure with -C option.

I've attached a trivial fix.  I need to do a bit more checking to make sure something more complicated is not needed.
Comment 4 Natrio 2014-02-04 06:01:27 MST
It works for me, thanks!
Comment 5 Todd C. Miller 2014-02-04 06:25:40 MST
Created attachment 396 [details]
Better fix for ecalloc(0) failure with -C option.

Updated fix with what I just checked in to the source tree.
Comment 6 Natrio 2014-02-04 06:36:13 MST
It works.
Is it final patch?
Comment 7 Todd C. Miller 2014-02-04 06:40:13 MST
Yes, sudo 1.8.9p5 will be released today with that patch.
Comment 8 Natrio 2014-02-04 06:42:47 MST
Thank you!
Comment 9 Todd C. Miller 2014-02-04 10:24:00 MST
Fixed in sudo 1.8.9p5, available now.