Bug 741 - SIGSEGV on sudo cp pam_unix.so /usr/lib/security/
SIGSEGV on sudo cp pam_unix.so /usr/lib/security/
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.15
PC Linux
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-26 08:00 MDT by kitteboss
Modified: 2016-03-26 08:16 MDT (History)
1 user (show)

See Also:


Attachments
Output of valgrind and ltrace (37.79 KB, application/octet-stream)
2016-03-26 08:00 MDT, kitteboss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kitteboss 2016-03-26 08:00:28 MDT
Created attachment 473 [details]
Output of valgrind and ltrace

copying pam_unix.so to /usr/lib/security (Arch Linux) to overwrite the existing one will cause a segmentation fault

valgrind and ltrace are attached
Comment 1 Todd C. Miller 2016-03-26 08:16:45 MDT
This is not a bug in sudo.  If you overwrite a shared object that is in use by a program you almost guarantee that the program will crash.

You almost never want to install a shared object with cp since it will overwrite the existing file/inode which may be mapped by running processes.  It's better to use the install program which unlinks the destination first and thus doesn't suffer from this problem.

E.g.

$ sudo install pam_unix.so /usr/lib/security/