All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: Alexey Dobriyan <adobriyan@openvz.org>
Cc: linux-kernel@vger.kernel.org, devel@openvz.org
Subject: Re: Racy /proc creations interfaces
Date: Wed, 27 Dec 2006 13:56:24 +0000	[thread overview]
Message-ID: <20061227135624.GP17561@ftp.linux.org.uk> (raw)
In-Reply-To: <20061227134223.GA6044@localhost.sw.ru>

On Wed, Dec 27, 2006 at 04:42:23PM +0300, Alexey Dobriyan wrote:
> 
>    	struct proc_entry_raw foo_pe_raw = {
> 		.owner = THIS_MODULE,
> 		.name = "foo",
> 		.mode = 0644,
> 		.read_proc = foo_read_proc,
> 		.data = foo_data,
> 		.parent = foo_parent,
> 	};
> 
> 	pde = create_proc_entry(&foo_pe_raw);
> 	if (!pde)
> 		return -ENOMEM;
> 
>    where "struct proc_entry_raw" is cut down version of "struct proc_dir_entry"

Ewwwwwwwwwwwwwww

Please, please no.  Especially not .parent.  If anything, let's add a
helper saying "it's all set up now".  And turn create_proc_entry()
into a macro that would pass THIS_MODULE to underlying function and
call that helper, so that simple cases wouldn't have to bother at all.

  reply	other threads:[~2006-12-27 13:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-27 13:42 Racy /proc creations interfaces Alexey Dobriyan
2006-12-27 13:56 ` Al Viro [this message]
2006-12-28  8:21   ` Alexey Dobriyan
2007-01-15 15:39     ` [PATCH] Fix rmmod/read/write races in /proc entries Alexey Dobriyan
2007-01-23 20:58       ` Andrew Morton
2007-01-24 15:22         ` Alexey Dobriyan

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=20061227135624.GP17561@ftp.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=adobriyan@openvz.org \
    --cc=devel@openvz.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.