LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Roland Dreier <rdreier@cisco.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	openfabrics-ewg@openib.org, openib-general@openib.org,
	raisch@de.ibm.com
Subject: Re: [PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()
Date: Fri, 12 Jan 2007 16:36:15 +0100	[thread overview]
Message-ID: <200701121636.15989.hnguyen@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070111192056.GB24623@infradead.org>

Hi,
> > +		if (my_cq->ownpid != cur_pid) {
> > +			ehca_err(device, "Invalid caller pid=%x ownpid=%x "
> > +				 "cq_num=%x",
> > +				 cur_pid, my_cq->ownpid, my_cq->cq_number);
> > +			return -EINVAL;
> > +		}
> 
> (for other reviewers: this is not new code, just moved around)
> 
> Owner tracking by pid is really dangerous.  File descriptors can be
> passed around by unix sockets, a single process can have files open
> more than once, etc..
> 
> It seems ehca wants to prevent threads other than the creating one
> from performing most operations.  Can you explain the reason for this?
you point to the right spot... This has a historic reason as we
have needed to support fork(), system("date") etc for kernel 2.6.9, 
hence those vma flags manipulation and this pid checking as proactive
protection/restriction. For newer kernel, I guess >=2.6.12, this checking
were not necessary, but we would feel better after we had tested user 
space stuff more thoroughly without this piece of code. Since this is 
not new code, can we pls handle this later?
Regards
Nam

      parent reply	other threads:[~2007-01-12 15:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11 19:08 Hoang-Nam Nguyen
2007-01-11 19:20 ` Christoph Hellwig
2007-01-11 19:40   ` Nathan Lynch
2007-01-11 19:43     ` Christoph Hellwig
2007-01-11 19:56     ` Roland Dreier
2007-01-12 15:23       ` Hoang-Nam Nguyen
2007-01-12 15:36   ` Hoang-Nam Nguyen [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=200701121636.15989.hnguyen@linux.vnet.ibm.com \
    --to=hnguyen@linux.vnet.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=openfabrics-ewg@openib.org \
    --cc=openib-general@openib.org \
    --cc=raisch@de.ibm.com \
    --cc=rdreier@cisco.com \
    --subject='Re: [PATCH/RFC 2.6.21 3/5] ehca: completion queue: remove use of do_mmap()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).