linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: John Levon <movement@marcelothewonderpenguin.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] oprofile 2.5.38 patch
Date: 24 Sep 2002 14:43:47 +0200	[thread overview]
Message-ID: <p73r8fjsgl8.fsf@oldwotan.suse.de> (raw)
In-Reply-To: John Levon's message of "24 Sep 2002 00:31:55 +0200"

John Levon <movement@marcelothewonderpenguin.com> writes:

> At :
> 
> http://oprofile.sourceforge.net/oprofile-2.5.html

+       page = (unsigned char *)__get_free_page(GFP_KERNEL);
+       if (!page)
+               return -ENOMEM;
+
+       spin_lock(&oprofilefs_lock);
+       len = sprintf(page, "%lu\n", *value);
+       spin_unlock(&oprofilefs_lock);

wouldn't an on stack buffer do nicely to format a single number ? 

ulong_write_file: 

it doesn't length limit count before passing to kmalloc - hole.
Also has overflow bugs (consider someone passing 0xffffffff-1). 

The sys_lookup_dcookie call looks like a security hole to me. After
all it could allow everybody to lookup random paths by trying all 
dcookies, even though the directories may be unreadable for him. It should 
be probably made root only

Adding a list_head to task_struct looks quite ugly to me. Is there
surely no better way ? e.g. you could just put it in a file private
structure and the daemon keeps the file open.

-Andi

       reply	other threads:[~2002-09-24 12:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020923222933.GA33523@compsoc.man.ac.uk.suse.lists.linux.kernel>
2002-09-24 12:43 ` Andi Kleen [this message]
2002-09-24 12:55   ` John Levon
2002-09-23 22:29 John Levon
2002-09-24 18:48 ` Christoph Hellwig
2002-09-24 12:23   ` John Levon
2002-09-26 16:08 ` Alan Cox

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=p73r8fjsgl8.fsf@oldwotan.suse.de \
    --to=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=movement@marcelothewonderpenguin.com \
    --subject='Re: [PATCH][RFC] oprofile 2.5.38 patch' \
    /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).