public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: fcorneli@elis.rug.ac.be
Cc: Daniel Jacobowitz <dan@debian.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ptrace PTRACE_READDATA/WRITEDATA, kernel 2.5.62
Date: Tue, 25 Feb 2003 18:35:37 +0100	[thread overview]
Message-ID: <3E5BA969.5000905@colorfullife.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0302251113050.2572-100000@tom.elis.rug.ac.be>

fcorneli@elis.rug.ac.be wrote:

>But since the ptrace_readdata 
>lives in the kernel tree for some time now and nobody is complaining about 
>it I assume the sparc usage of ptrace_readdata is OK. I did test it on 
>i386 and it works just fine.
>  
>
Sorry, my fault. I remembered that someone must do double buffering. 
I've overlooked that ptrace_readdata does the double buffering.

>When I look at the implementation of ptrace_readdata the dst (3th arg) has 
>to be a pointer to user space; see: copy_to_user(dst, buf, retval). Only 
>access_process_vm wants a kernel pointer. Anyway access_process_vm has 
>some known issues, see:
>http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.5/2.5.62/2.5.62-mm3/broken-out/ptrace-flush.patch
>but it's getting fixed I hope.
>  
>
This patch seems to be wrong.
flush_dcache_page is not a replacement for flush_page_to_ram(): It's an 
optimized cache flush function, only valid for page cache pages:
If a page is mapped only once, then no aliasing can occur and the flush 
is not required.
For page cache pages, "mapped once" is equivalient to an empty 
page->mapping->i_mmap{,_shared}. The pages are mapped once in the page 
cache, and _if_ they are mapped in user space, then 
page->mapping->i_mmap{,_shared} is not empty.

ptrace can be called on random addresses - sysv shm, anonymous pages, 
etc. page->mapping->i_mmap{,_shared} is meaningless.
If you think about it, if ptrace accesses a page, then it's guaranteed 
to be mapped twice: once in user space, once by the kmap_atomic() for 
the kernel space access.

--
    Manfred




  reply	other threads:[~2003-02-25 17:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-24 18:21 [PATCH] ptrace PTRACE_READDATA/WRITEDATA, kernel 2.5.62 Manfred Spraul
2003-02-25 10:36 ` fcorneli
2003-02-25 17:35   ` Manfred Spraul [this message]
2003-02-25 21:36     ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2003-02-24 14:05 fcorneli
2003-02-24 14:16 ` Daniel Jacobowitz
2003-02-24 14:51   ` fcorneli
2003-02-24 15:02     ` Daniel Jacobowitz

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=3E5BA969.5000905@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=dan@debian.org \
    --cc=fcorneli@elis.rug.ac.be \
    --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