mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: BlaisorBlade <blaisorblade_spam@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, uml@hno.marasystems.com,
	mcr@sandelman.ottawa.on.ca
Subject: Re: [uml-devel] [patch 1/1] SKAS3: fix mm->dumpable handling
Date: Sat, 16 Oct 2004 17:08:26 +0200	[thread overview]
Message-ID: <200410161708.27369.blaisorblade_spam@yahoo.it> (raw)
In-Reply-To: <20041014161758.C4CF444BE@zion.localdomain>

On Thursday 14 October 2004 18:17, blaisorblade_spam@yahoo.it wrote:
> From: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>, Henrik
> Nordstrom <uml@hno.marasystems.com>, Michael Richardson
> <mcr@sandelman.ottawa.on.ca>

> When a child mm is created by opening /proc/mm, without this patch its
> mm->dumpable flag is left set to 0, even when there is no reason to do so.
>
> This way, for instance, if <pid> is the pid of a userspace thread,
> /proc/<pid> is only readable by root (which was the original reason letting
> this be diagnosed by Michael Richardson).

> Paolo and Henrik discussed about this in detail, finally Paolo wrote the
> patch and sent it for comment.
And Paolo (myself) fucked it up:

> +		/* Let's be safe. If we are ptraced from a non-dumpable process,
> +		 * let's not be dumpable. Don't try to be smart and turn
> +		 * current->dumpable to 1: it may be unsafe.*/
> +		if (!current->dumpable) {
This should be current->mm->dumpable, not current->dumpable.
> +			new->dumpable = 0;
> +			wmb();
> +		}
> +
>  		atomic_inc(&new->mm_users);
>  		child->mm = new;
>  		child->active_mm = new;
> _
Also, we have not studied the case of another process trying to ptrace and 
SWITCH_MM a process already having some mm's (it cannot give it any already 
existing mm, because it has not the file descriptor). It seems safe to me, 
but I'm going to study this and put the result in next patch version.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729


      reply	other threads:[~2004-10-18 15:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-14 16:17 blaisorblade_spam
2004-10-16 15:08 ` BlaisorBlade [this message]

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=200410161708.27369.blaisorblade_spam@yahoo.it \
    --to=blaisorblade_spam@yahoo.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcr@sandelman.ottawa.on.ca \
    --cc=uml@hno.marasystems.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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®