This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to change a string type argument of a system call?


I use method 2 and it does work.
I probe the "kernel.function("do_filp_open")". do_filp_open() function
executed after
the getname() function and the getname() function copy the filename
from the user space
to kernel space, at this point I can allocate a new page in the kernel
space and store
the new filename in it to replace original filename. I upload my new code in the
attachement.

But, I think the ability to allocate some new memory area in the user space is a
better way than this kernel way.

On Tue, Apr 6, 2010 at 11:59 AM, Frank Ch. Eigler <fche@redhat.com> wrote:
> Josh Stone <jistone@redhat.com> writes:
>
>> [...]
>> Correct -- the open syscall gets the filename using strncpy_from_user,
>> which verifies that the pointer is within the user's address space.
>>
>> I can think of a few options for you:
>> [...]
>
> 5) use set_fs(KERN_DS) in some entry-probe-time embedded-c, with
> Â a corresponding set_fs(USER_DS) or whatnot at return-probe-time.
>
>
> - FChE
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]