mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Danek Duvall <duvall@emufarm.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: root-owned /proc/pid files for threaded apps?
Date: Fri, 8 Mar 2002 02:06:32 -0800	[thread overview]
Message-ID: <20020308100632.GA192@lorien.emufarm.org> (raw)
In-Reply-To: <20020307060110.GA303@lorien.emufarm.org> <E16iyBW-0002HP-00@the-village.bc.nu>
In-Reply-To: <E16iyBW-0002HP-00@the-village.bc.nu>

On Thu, Mar 07, 2002 at 01:43:54PM +0000, Alan Cox wrote:

> > I just upgraded from 2.4.8-pre3-ac2 to 2.4.19-pre2-ac2, and found that
> > for threaded programs like mozilla and xmms, files in /proc/<pid> are
> > owned by root, even if the process belongs to another user.  I
> > particularly wanted to be able to read /proc/<pid>/environ, but I can't.
> >
> > [ ... ]
> 
> Thanks - that will really help. There are several sets of thread related
> changes in -ac. Its all working for me however 8)

Ok, I found the responsible hunk, though I haven't any idea why it would
make a difference:

	diff -durp linux-2.4.18-pre7-ac2/kernel/kmod.c linux-2.4.18-pre7-ac3/kernel/kmod.c
	--- linux-2.4.18-pre7-ac2/kernel/kmod.c Tue Jul 17 18:23:50 2001
	+++ linux-2.4.18-pre7-ac3/kernel/kmod.c Thu Mar  7 23:05:34 2002
	@@ -111,15 +111,8 @@ int exec_usermodehelper(char *program_pa
			if (curtask->files->fd[i]) close(i);
		}

	-       /* Drop the "current user" thing */
	-       {
	-               struct user_struct *user = curtask->user;
	-               curtask->user = INIT_USER;
	-               atomic_inc(&INIT_USER->__count);
	-               atomic_inc(&INIT_USER->processes);
	-               atomic_dec(&user->processes);
	-               free_uid(user);
	-       }
	+       /* Become root */
	+       set_user(0, 1);

		/* Give kmod all effective privileges.. */
		curtask->euid = curtask->fsuid = 0;

This hunk shows up for the first time in 2.4.18-pre7-ac3, which shows
the behavior, while prior versions do not.  If I revert this hunk from
ac3, I get the behavior I expect.  It also fixes my problem when I
revert this from 2.4.19-pre2-ac2, which is where I first saw the
problems.

I don't see why mozilla would even touch this path of execution, so I
don't know why it would make a difference there, but it makes some sense
in the case of xmms, as my sound support is in modules.  But it shows up
both places.

I also checked to see if the CLONE_THREAD change in kernel/fork.c in the
same patch had any effect, because that looked more relevant to
threading, but it didn't.

So now I guess I get to help you reproduce it on your end.  Let me know
what you need from me.

Thanks,
Danek

  reply	other threads:[~2002-03-08 10:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-07  6:01 Danek Duvall
2002-03-07  7:43 ` Danek Duvall
2002-03-07 13:43 ` Alan Cox
2002-03-08 10:06   ` Danek Duvall [this message]
2002-03-08 13:33     ` Alan Cox
2002-03-08 18:59     ` Andreas Ferber
2002-03-08 20:31       ` Danek Duvall
2002-03-08 21:29         ` Andreas Ferber
2002-03-08 21:41           ` Danek Duvall
2002-03-08 22:30             ` Andreas Ferber
2002-03-09  3:09               ` Danek Duvall
2002-03-10 20:37                 ` Andreas Ferber
2002-03-08 21:47           ` J Sloan
2002-03-08 21:59             ` Danek Duvall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020308100632.GA192@lorien.emufarm.org \
    --to=duvall@emufarm.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®