Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] Issues with seteuid()?
@ 2003-01-12 15:49 Luigi Gangitano
  2003-01-13  3:06 ` Matthew Wilcox
  2003-01-29 13:58 ` Joel Soete
  0 siblings, 2 replies; 11+ messages in thread
From: Luigi Gangitano @ 2003-01-12 15:49 UTC (permalink / raw)
  To: parisc-linux

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]


Hi all,
I'm the Debian package maintainer for Squid (HTTP Proxy). I received the
forwarded bug report describing issues in seteuid() on palinux. While
using seteuid(), forked processes terminate with SEGV.

Is it a known problem?

Thanks.

L

Please CC: me, I'm not subscribed to this list.

-----Forwarded Message-----
> This small mail to mentionned that I reach to make squid operational on
> a linux-2.4.20-pa17 thanks to the following tips:
> 
> in debian rules replace statement
>     ac_cv_func_setresuid=no \
> by
>     ac_cv_func_setresuid=yes \
> 
> so that function leave_suid() [into src/tools.c] will use setresuid() in
> place of seteuid() before launch fork().
> 
> Is it a know problem on palinux?
> 
> Greetings,
>     Joel
> 
> PS: Luigi, I also test it on 2.5.1 and it works also for parisc linux (testing
> config). HTH

-- 
 Luigi Gangitano -- <luigi@debian.org> -- <gangitano@lugroma3.org>
 GPG: 1024D/924C0C26: 12F8 9C03 89D3 DB4A 9972  C24A F19B A618 924C 0C26

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [parisc-linux] Issues with seteuid()?
@ 2003-01-13 10:19 jsoe0708
  0 siblings, 0 replies; 11+ messages in thread
From: jsoe0708 @ 2003-01-13 10:19 UTC (permalink / raw)
  To: Randolph Chung, Matthew Wilcox; +Cc: Luigi Gangitano, parisc-linux

Hi Randolph,

Being the author of bug report (and some other request on this ml about
subject), unfortunately I do not have test case. But what I can do is to
explain all what I did. I just grab squid-2.4.7-1 (hope still exist) and
rebuild as it is (check in rules that ac_cv_func_setresuid=3Dno).

Installed it and disabled the startup script (in case of reboot, it risks=

to make boot very slow).

I already noticed that the install procedure failled to create the spool
dir; dmesg would have to confirm you that squid do a segv. [ and there wa=
s
no squid process ]

What failled? In fact, the install script launched 'squid -z'.
It was interesting to launch it manually; the reason of the SEGV was more=

complete: fork failled because not enough memory available??

Well fork() failed... Searching in sources (MANY THANKS to RMS for FSF sp=
irit)
I find the place where fork() is used and what happened just before: acco=
rding
to configure param, it do first a setgroups(), setgid() then (in this cas=
e)
a seteuid() (function leave_suid() in src/tools.c).

So the problem seems to came from a kind of su. And I re-read Bach UNIX
bible to remember that one of the first think that do a su is to verify
that user memory is enough. In this case it considered that it was not th=
e
case?

So I tried to check if a real su presents the same problem. I let first
read access to the world for /etc/squid.conf (just for the test) and as
in the startup script 'ulimit -n 5120' (for example) then 'su - proxy'.

'ulimit -a' seems Ok.
Now, always as proxy user, relaunch 'squid -z' and ... it works.

I could be now quiet sure that the problem came from the setgroups(), set=
gid(),
seteuid(), fork() sequence used to switch user. Agree?

I first checked the value of the paramters transmitted to the seteuid()
which seem ok.

As I saw that the developper of squid foreseen other procedure to su, I
did so first investigate to use setreuid() (which seems to me also more
secure but I should be wrong?). As it was available, I test it and solved=

all the squid problem encounter since the begining: the creation of the
spool dir was now ok and the server worked fine. That is this final concl=
usion
that I transmitted as bug report near squid maintainer.

On this mailing list my question (<http://lists.parisc-linux.org/pipermai=
l/parisc-linux/2003-January/018801.html>)
was a bit wilder (I thought but wrongly):
is it a seteuid() [glic ?] or a fork() [kernel ?] problem?

Well that is only a summary a many other investigation and I hope this he=
lp
but if something is not clear or some other test would help you do not he=
sitate
to let me know,

Cheers,
    Joel


->> I wonder how it can be a problem at all.  The kernel ilements only
>> sys_setresuid() and i would imagine that glibc implements both
>> seteuid() and setresuid() in terms of this system call.
>>
>> Perhaps someone who's willing to touch glibc would care to comment?
>
>seteuid() works fine in simple tests. i don't think it's seteuid...
>something else is broken. can someone provide a simple test case for the=

>segfault?
>
>randolph
>--
>Randolph Chung
>Debian GNU/Linux Developer, hppa/ia64 ports
>http://www.tausq.org/
>_______________________________________________
>parisc-linux mailing list
>parisc-linux@lists.parisc-linux.org
>http://lists.parisc-linux.org/mailman/listinfo/parisc-linux



*********************************************
Vous surfez toujours avec une ligne classique ?
Faites des economies avec Tiscali Complete...
Plus d'info sur ... http://complete.tiscali.be

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <20030130073214.GJ20940@tausq.org>]

end of thread, other threads:[~2003-02-19 15:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-12 15:49 [parisc-linux] Issues with seteuid()? Luigi Gangitano
2003-01-13  3:06 ` Matthew Wilcox
2003-01-13  3:11   ` Randolph Chung
2003-01-29 17:01     ` Joel Soete
2003-01-30  7:03       ` Randolph Chung
2003-01-30  7:37         ` Joel Soete
2003-01-29 13:58 ` Joel Soete
  -- strict thread matches above, loose matches on Subject: below --
2003-01-13 10:19 jsoe0708
     [not found] <20030130073214.GJ20940@tausq.org>
     [not found] ` <3E35C33F0000094B@ocpmta3.freegates.net>
2003-01-30  7:54   ` Randolph Chung
2003-01-30  8:28     ` Joel Soete
2003-01-30 13:03       ` Joel Soete

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox