ravthan / all-eyes

Automatically exported from code.google.com/p/all-eyes
0 stars 0 forks source link

calling setgid after chroot in Ubuntu 12.04 craches in the system library - waiting for response from Ubuntu forum #67

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. check out latest code
2. perform make
3. cd to bin and run "sudo ./ae -a -p"

Ubuntu system will crash.  Although this is not following the full instructions 
for installing the product, for development work, user should be able to run ae 
at this point, without causing an entire system to crash.

Original issue reported on code.google.com by heyyoul...@gmail.com on 12 Nov 2012 at 9:49

GoogleCodeExporter commented 8 years ago
Additional notes:

1) After installing the product, ae run fine from /usr/local/bin.
2) However, even after running installation package, if I go back to running ae 
from src/bin dir, it will crash.   

Original comment by heyyoul...@gmail.com on 12 Nov 2012 at 10:15

GoogleCodeExporter commented 8 years ago
This crash is due to the problem in the Ubuntu 12.04 "Precise Gangolin" as at 
the end.  This problem has already been posted as a question to start with 
(will be filed as a bug based on the response, as there may be an update in 
works) as below:

==== Ubuntu Posting  ================

In “Precise Gangolin” release calling setguid() system call after chroot(), 
to drop priviliges results in segfault
up vote 0 down vote favorite

As below I found in Ubuntu 12.04, I found that I get the segfault, even though 
I follow the right procedure. The same code seem to work on RedHat distrubution:

    Establish a chroot-jail using debootstrap
    In the C program do a chroot into the jail created by dbootstrap.
    Then to drop priviliges, within the chroot jail, in the forked process, call setgid(existinguser).

Then one gets segfault as below. This doesn't happen, if the chroot is to "/". 
I wonder whether the choort environment created by debootstrap is a problem. 
The output is below:

======== start here ========
ubuntu12-04 kernel: [ 8595.902026] ae[9695]: segfault at 3ea ip b752ee29 sp 
bf986c70 error 4 in libc-2.15.so[b74ea000+1a3000]

============  segfault output from syslog =========
-04 kernel: [ 8595.902026] ae[9695]: segfault at 3ea ip b752ee29 sp bf986c70 
error 4 in libc-2.15.so[b74ea000+1a3000]

Original comment by ravt...@gmail.com on 13 Nov 2012 at 5:13

GoogleCodeExporter commented 8 years ago
The code in ae.c has been commented regarding the bug in Ubuntu 12.04 in the 
checkin r771 .

ravi.

Original comment by ravt...@gmail.com on 13 Nov 2012 at 5:18

GoogleCodeExporter commented 8 years ago
This bug is an Ubuntu issue.  Not AllEyes component related issue,
ravi.

Original comment by ravt...@gmail.com on 14 Nov 2012 at 3:55

GoogleCodeExporter commented 8 years ago
Ubuntu team informed recent update should fix it.  So, enabled setgid and 
setegid and it works.

Marking the bug fixed,
ravi.

r988

Original comment by ravt...@gmail.com on 29 Nov 2012 at 12:24

GoogleCodeExporter commented 8 years ago
Verified with unit testing

Original comment by tbrt....@gmail.com on 9 Dec 2012 at 9:24