lkml.org 
[lkml]   [2010]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v5 3/14] User Space Breakpoint Assistance Layer
    > > +/**
    > > + * user_bkpt_write_data - Write @nbytes from @kbuf at @vaddr in @tsk.
    > > + * Can be used to write to stack or data VM areas, but not instructions.
    > > + * Not exported, but available for use by arch-specific user_bkpt code.
    > > + * @tsk: The probed task
    > > + * @vaddr: Destination address, in user space.
    > > + * @kbuf: Source address, in kernel space to be read.
    >
    > I'm curious. Anything prevent this from being called on instructions, or
    > is this just "Don't do that?".
    >

    Both,
    copy_to_user doesnt work on writes to text.
    And if I am right, copy_to_user isnt preferred while writing to text
    pages too.

    > > +
    > > + memcpy(vaddr_new, vaddr_old, PAGE_SIZE);
    > > + /* poke the new insn in, ASSUMES we don't cross page boundary */
    > > + vaddr = vaddr & (PAGE_SIZE - 1);
    >
    > This should probably be vaddr = vaddr & ~PAGE_MASK;

    Okay, I will make the corresponding change.
    >
    >


    \
     
     \ /
      Last update: 2010-06-22 07:51    [W:4.460 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site