From: Srikar Dronamraju on
> > +/**
> > + * 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.
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/