Giter VIP home page Giter VIP logo

devns-patches's Issues

patches don't compile without CONFIG_DEV_NS

If the kernel config does not contain CONFIG_DEV_NS, then it will not build.

Quick list of issues:

  1. You need to define put_dev_ns() (and probably get_dev_ns)
  2. get_dev_ns_tag needs a return type (presumably void)
  3. need ifdef CONFIG_DEV_NS around all invocations of is_active_dev_ns() or define it in linux/dev_namespace.h as a static inline returning 1.

Memory Leak / Refcount Error: copy_dev_ns

When you create a new device namespace (via clone), you assign dev_ns->pid_ns in the create_dev_ns function by getting a reference to the pid namespace associated with tsk. This is actually the pid namespace of the task being cloned, and it gets replaced further up the call chain (in create_namespaces).

Additionally, you re-assign dev_ns->pid_ns (without taking a reference) in create_namepaces (kernel/nsproxy.c). This assignment leaks a reference to the original task's pid namespace, and leaves you one-reference short on the pid namespace you want.

kernel doesn't boot without CONFIG_DEV_NS

Without CONFIG_DEV_NS the current_dev_ns() function returns NULL. This triggers a BUG_ON in drivers/staging/android/logger.c:459

The same logic would eventually trigger a BUG_ON in logger_open() as well.

Perhaps a careful look at where current_dev_ns is used is in order. If there are assumptions about pointer validity then perhaps assigning init_dev_ns to NULL is not the right way to go.

Also, the construction of current_dev_ns() without CONFIG_DEV_NS set is quite awkward. It comes out to something like: &(*(struct dev_namespace *)NULL)

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.