Comments (5)
This message says that Kprobe could be used to find the address associated with a kernel symbol. I wrote the following PoC that seems to work. Can we consider using this technique?
static struct kprobe kp;
unsigned long kprobe_lookup_name(const char *name) {
kp.symbol_name = name;
if (register_kprobe(&kp) < 0)
return 0;
unregister_kprobe(&kp);
return (unsigned long) kp.addr;
}
from tyton.
Mail Discussion: https://lwn.net/ml/linux-kernel/[email protected]/
Commit: torvalds/linux@0bd476e
They recently unexported kallsyms_lookup_name
and unfortunately, this project is slow to receive updates. Feel free to submit a PR that grabs the needed symbols and works for your kernel!
from tyton.
@v14dz Yeah that code looks good! I did some looking and register_kprobe is just a really roundabout way of calling kallsyms_lookup_name.
Do you know if there are any limitations across kernel versions for kprobes?
from tyton.
@nbulischeck Hi! I suggest to use kallsyms_lookup_name()
for kernel versions anterior to 5.7.0, and use the kprobe workaround only for recent kernels. This way we don't care about kprobe limitations across previous kernel versions. I'll soon propose a patch that should fixes this issue.
from tyton.
Fixed in ae7988b. Please reopen if this is not the case.
from tyton.
Related Issues (20)
- [Feature Request] Develop an RPM Package HOT 4
- [README Request] Add Fedora Dependencies HOT 1
- [README Request] Add CentOS Dependencies HOT 1
- [Feature Request] Module whitelist for netfilter hook HOT 17
- [Feature Request] Detect Syscall Hooking by KHOOK HOT 4
- Does not compile on 4.4.0-75 HOT 6
- Crash on Ubuntu 16.04 - 4.4.0-75 HOT 4
- [Feature Request] non-systemd linux support HOT 18
- Unable to resume after suspending HOT 1
- [Dev Request] Integrate Development and CI/CD with Out-of-Tree
- Module name can be easily tampered HOT 11
- Running tyton freeze my system HOT 2
- Doesn't work on macOS HOT 2
- Build fails HOT 2
- The kernel module could not be built with the linux>=5.7.6 HOT 2
- ERROR: modpost: "__module_address" [/home/blackarch/tyton/tyton.ko] undefined! HOT 2
- unable to compile with kernel 5.11.x
- error: ‘module_mutex’ undeclared (first use in this function); did you mean ‘module_put’?
- Arch linux AUR package error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tyton.