Giter VIP home page Giter VIP logo

devns-patches's Introduction

Device namespaces are an extension to existing Linux kernel namespaces,
developed by Cellrox as part of its Thinvisor technology for lightweight
virtualization for mobile devices.

Device namespaces are based on development done at Columbia University. Certain
portions are copyrighted by Columbia University.

Device namespaces create the illusion, for processes inside a namespace, that
they interact exclusively with a set of device drivers, hiding the fact that
there are other namespaces interacting with the same set of device drivers.

Device namespaces also introduce the concept of an active namespace, which is
a namespace with access to real devices/peripherals and with which the user
interacts, and the concept of switching namespaces to allow users to interact
with multiple namespaces, one at a time.

For more information, see https://github.com/Cellrox/devns-patches/wiki

devns-patches's People

Stargazers

Dolfly avatar  avatar Para avatar M4cr0v avatar bruce-bst avatar Joe avatar  avatar  avatar Dylan Gao avatar Dinesh Manajipet avatar  avatar Valerio avatar  avatar Like Ma avatar taogogo avatar Ilya guterman avatar Chao Niu avatar  avatar Sam Gaw avatar  avatar  avatar Gary Bisson avatar Geoffrey Thomas avatar

Watchers

Amir Goldstein avatar  avatar Oren Laadan avatar James Cloos avatar Huzefa Siyamwala avatar  avatar  avatar  avatar Para avatar  avatar

devns-patches's Issues

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)

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.

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.