LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Closed Thread
  Search this Thread
Old 01-13-2020, 09:34 AM   #1
danielhaish
LQ Newbie
 
Registered: Jan 2020
Posts: 13

Rep: Reputation: Disabled
Unhappy hook the execve system call how to find the file path from the const char __user*


hi i hooked the execve system call with lkm and when i wrote a code that print alert each time process is been execute it work fine but when i tried to print the file name paramter it crashed my computer
Code:
asmlinkage long our_execl( const char __user* filename, const char __user* const __user* argv,
                    const char __user* const __user* envp )
{
    printk(filename);
    return orignal_execl( filename, argv, envp );
}
 
Old 01-14-2020, 08:36 AM   #2
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,604

Rep: Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

https://www.linuxquestions.org/quest...er-4175667619/
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i extract the file name from the const char __user type in the execve parmter danielhaish Linux - Software 6 01-16-2020 10:12 AM
hook the execve system call how to find the file path from the const char __user* danielhaish Linux - Kernel 1 01-14-2020 01:36 AM
Convert const wchar_t* to const char* to use in fprintf() coders123 Programming 1 01-17-2011 03:47 PM
If I get invalid conversion from `const char*' to `char' what should I be lookin for? RHLinuxGUY Programming 5 03-12-2006 10:35 PM
invalid conversion from `char' to `const char* bru Programming 6 05-09-2004 03:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration