Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
New spawning mechanism in Cherokee 0.99.12
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alvaro Lopez Ortega  
View profile  
 More options Apr 25 2009, 5:55 am
From: Alvaro Lopez Ortega <alv...@alobbs.com>
Date: Sat, 25 Apr 2009 11:55:49 +0200
Local: Sat, Apr 25 2009 5:55 am
Subject: [Cherokee] New spawning mechanism in Cherokee 0.99.12
Hi folks!

I've just integrated (r3168) a new spawning mechanism in trunk (the  
upcoming Cherokee 0.99.12 release). It's basically a much more refined  
and powerful way of launching new interpreters - such as php, django,  
ror, etc. It allows to do things like this:

\-+= 09736 root cherokee
   |-+= 09763 www-data /usr/bin/php-cgi -b /tmp/cherokee-php.socket
   | |--- 09764 www-data /usr/bin/php-cgi -b /tmp/cherokee-php.socket
   | |--- 09765 www-data /usr/bin/php-cgi -b /tmp/cherokee-php.socket
   | |--- 09766 www-data /usr/bin/php-cgi -b /tmp/cherokee-php.socket
   | |--- 09767 www-data /usr/bin/php-cgi -b /tmp/cherokee-php.socket
   | \--- 09768 www-data /usr/bin/php-cgi -b /tmp/cherokee-php.socket
   \--- 09747 nobody /usr/sbin/cherokee-worker

This means that, even if cherokee-worker (the actual web server) was  
running as nobody, it was able to spawn a new PHP fastcgi daemon  
running as the www-data user.

If you guys have the chance, give it a try. I'd love to get feedback  
from you before releasing 0.99.12. The change has been quite big, and  
I wouldn't like to introduce any regression in the upcoming release.

Cheers!

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan de Konink  
View profile  
 More options Apr 25 2009, 6:11 am
From: Stefan de Konink <ste...@konink.de>
Date: Sat, 25 Apr 2009 12:11:21 +0200 (CEST)
Local: Sat, Apr 25 2009 6:11 am
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12

On Sat, 25 Apr 2009, Alvaro Lopez Ortega wrote:
> This means that, even if cherokee-worker (the actual web server) was
> running as nobody, it was able to spawn a new PHP fastcgi daemon
> running as the www-data user.

> If you guys have the chance, give it a try. I'd love to get feedback
> from you before releasing 0.99.12. The change has been quite big, and
> I wouldn't like to introduce any regression in the upcoming release.

What did you do to prevent executable code to execute the spawn function?
Is it possible to explictly disable respawn as root at configure? (Stack
initialisation of non-zero etc.)

Stefan

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alvaro Lopez Ortega  
View profile  
 More options Apr 25 2009, 6:33 am
From: Alvaro Lopez Ortega <alv...@alobbs.com>
Date: Sat, 25 Apr 2009 12:33:19 +0200
Local: Sat, Apr 25 2009 6:33 am
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12
On 25-abr-09, at 12:11, Stefan de Konink wrote:

> On Sat, 25 Apr 2009, Alvaro Lopez Ortega wrote:

>> This means that, even if cherokee-worker (the actual web server) was
>> running as nobody, it was able to spawn a new PHP fastcgi daemon
>> running as the www-data user.

>> If you guys have the chance, give it a try. I'd love to get feedback
>> from you before releasing 0.99.12. The change has been quite big, and
>> I wouldn't like to introduce any regression in the upcoming release.

> What did you do to prevent executable code to execute the spawn  
> function?

What do you mean by executable code? Cherokee-worker is the only  
process that can access the spawning mechanism. No other external  
process can interfere with the spawning (except of other root  
processes of course).

> Is it possible to explictly disable respawn as root at configure?  
> (Stack
> initialisation of non-zero etc.)

r3169 has fixed the problem - I knew I needed some feedback for a  
reason. :-)

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan de Konink  
View profile  
 More options Apr 25 2009, 6:46 am
From: Stefan de Konink <ste...@konink.de>
Date: Sat, 25 Apr 2009 12:46:56 +0200 (CEST)
Local: Sat, Apr 25 2009 6:46 am
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12

On Sat, 25 Apr 2009, Alvaro Lopez Ortega wrote:
> What do you mean by executable code? Cherokee-worker is the only
> process that can access the spawning mechanism. No other external
> process can interfere with the spawning (except of other root
> processes of course).

We all know some of us are great programmers, but we all make mistakes. It
would be really nice if ever an exploit is possible, cherokee would
bitmask the UID field so it could never be zero.

> > Is it possible to explictly disable respawn as root at configure?
> > (Stack
> > initialisation of non-zero etc.)

> r3169 has fixed the problem - I knew I needed some feedback for a
> reason. :-)

;) I would make this number configurable in code... maybe with a hardmask.

Stefan

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Peddicord  
View profile  
 More options Apr 25 2009, 11:53 am
From: Jacob Peddicord <jpeddic...@ubuntu.com>
Date: Sat, 25 Apr 2009 11:53:26 -0400
Local: Sat, Apr 25 2009 11:53 am
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12

Great! I'm anxious to try this out, though I can't seem to get it to build
now. It dies on linking: "./.libs/libcherokee-base.so: undefined reference
to `shm_open'". Tried running configure again as `LDFLAGS="-lrt"
./configure`, which solves the initial shm_open problem, but then:

In function ‘open’,
    inlined from ‘do_spawn’ at main.c:359,
    inlined from ‘spawn_thread_func’ at main.c:608:
/usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared
with attribute error: open with O_CREAT in second argument needs 3 arguments

I have glibc 2.9 if it matters. Anything I might be missing?

Thanks,
Jacob

On Sat, Apr 25, 2009 at 5:55 AM, Alvaro Lopez Ortega <alv...@alobbs.com>wrote:

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alvaro Lopez Ortega  
View profile  
 More options Apr 25 2009, 1:12 pm
From: Alvaro Lopez Ortega <alv...@alobbs.com>
Date: Sat, 25 Apr 2009 19:12:47 +0200
Local: Sat, Apr 25 2009 1:12 pm
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12
Hello Jacob,

I have committed a little patch to fix it (r3171).
It ought to compile in Linux now.

On 25-abr-09, at 17:53, Jacob Peddicord wrote:

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Peddicord  
View profile  
 More options Apr 25 2009, 1:50 pm
From: Jacob Peddicord <jpeddic...@ubuntu.com>
Date: Sat, 25 Apr 2009 13:50:41 -0400
Local: Sat, Apr 25 2009 1:50 pm
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12

Thanks, but it still doesn't quite build, exiting with the second error in
the previous message. main.c:359 has this:
    fd = open (log_file, O_WRONLY | O_APPEND | O_CREAT);

Apparently newer versions of glibc now enforce a third parameter (mode) if
O_CREAT is specified. I changed that line to:
    fd = open (log_file, O_WRONLY | O_APPEND | O_CREAT, 0600);
but I'm not sure if 0600 is exactly the right mode needed; it's just a bit
of guesswork.

Anyway, _that_ error is gone with that change, but then I'm left with
"undefined reference to `cherokee_logger_get_error_writer'" - which I made a
shoddy attempt to work around by including logger.h into files that
referenced it - needless to say that didn't work. :)

Thanks again for your work on this, I'm excited to see this all in action.
Jacob

On Sat, Apr 25, 2009 at 1:12 PM, Alvaro Lopez Ortega <alv...@alobbs.com>wrote:

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alvaro Lopez Ortega  
View profile  
 More options Apr 25 2009, 1:56 pm
From: Alvaro Lopez Ortega <alv...@alobbs.com>
Date: Sat, 25 Apr 2009 19:56:54 +0200
Local: Sat, Apr 25 2009 1:56 pm
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12
Hello Jacob,

On 25-abr-09, at 19:50, Jacob Peddicord wrote:

> Thanks, but it still doesn't quite build, exiting with the second  
> error in the previous message. main.c:359 has this:
>     fd = open (log_file, O_WRONLY | O_APPEND | O_CREAT);

> Apparently newer versions of glibc now enforce a third parameter  
> (mode) if O_CREAT is specified.

That's pretty interesting; thanks for pointing it out.

> Anyway, _that_ error is gone with that change, but then I'm left  
> with "undefined reference to `cherokee_logger_get_error_writer'" -  
> which I made a shoddy attempt to work around by including logger.h  
> into files that referenced it - needless to say that didn't work. :)

Have you tried to clean the previous build? It happened to me as well,  
and a plain "make clean all" worked it out.

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Peddicord  
View profile  
 More options Apr 25 2009, 2:49 pm
From: Jacob Peddicord <jpeddic...@ubuntu.com>
Date: Sat, 25 Apr 2009 14:49:46 -0400
Local: Sat, Apr 25 2009 2:49 pm
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12

On Sat, Apr 25, 2009 at 1:56 PM, Alvaro Lopez Ortega <alv...@alobbs.com>wrote:

> Have you tried to clean the previous build? It happened to me as well, and
> a plain "make clean all" worked it out.

Just tried with a fresh checkout.

Seems it is a problem with something in cget, though I couldn't find
cherokee_logger_get_error_writer anywhere in it:
http://pastebin.com/f4c6ac20f

Building in cherokee/ only seems to work fine. Now to play around with this
spawning. :)

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alberto Caso  
View profile  
 More options Apr 26 2009, 12:11 pm
From: Alberto Caso <alberto.c...@adaptia.es>
Date: Sun, 26 Apr 2009 18:11:14 +0200
Local: Sun, Apr 26 2009 12:11 pm
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12
El sáb, 25-04-2009 a las 11:55 +0200, Alvaro Lopez Ortega escribió:

> This means that, even if cherokee-worker (the actual web server) was  
> running as nobody, it was able to spawn a new PHP fastcgi daemon  
> running as the www-data user.

Awesome! No more suid wrappers!!

Thank you very much,

--
Alberto Caso Palomino      | Adaptia
alberto.c...@adaptia.es    | http://www.adaptia.es

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jacob Peddicord  
View profile  
 More options Apr 27 2009, 3:13 pm
From: Jacob Peddicord <jpeddic...@ubuntu.com>
Date: Mon, 27 Apr 2009 15:13:52 -0400
Local: Mon, Apr 27 2009 3:13 pm
Subject: Re: [Cherokee] New spawning mechanism in Cherokee 0.99.12

Been playing around with this for a couple of days, and so far no problems
have arose. Looking good! :)

Jacob Peddicord
http://jacob.peddicord.net

On Sat, Apr 25, 2009 at 5:55 AM, Alvaro Lopez Ortega <alv...@alobbs.com>wrote:

_______________________________________________
Cherokee mailing list
Chero...@lists.octality.com
http://lists.octality.com/listinfo/cherokee


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google