Giter Site home page Giter Site logo

Comments (5)

v14dz avatar v14dz commented on June 26, 2024 1

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.

nbulischeck avatar nbulischeck commented on June 26, 2024

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.

nbulischeck avatar nbulischeck commented on June 26, 2024

@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.

v14dz avatar v14dz commented on June 26, 2024

@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.

nbulischeck avatar nbulischeck commented on June 26, 2024

Fixed in ae7988b. Please reopen if this is not the case.

from tyton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.