LinuxQuestions.org
Help answer threads with 0 replies.
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:29 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, 01:36 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,069

Rep: Reputation: 7363Reputation: 7363Reputation: 7363Reputation: 7363Reputation: 7363Reputation: 7363Reputation: 7363Reputation: 7363Reputation: 7363Reputation: 7363Reputation: 7363
duplicate of https://www.linuxquestions.org/quest...2A-4175667628/
 
  


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
Convert const wchar_t* to const char* to use in fprintf() coders123 Programming 1 01-17-2011 03:47 PM
invalid conversion from `const char*' to `char*' deepinlife Programming 22 08-05-2006 10:49 AM
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 08:19 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