Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add userspace namespace contexts to LTTng #55

Closed
wants to merge 2 commits into from

Conversation

mjeanson
Copy link
Member

No description provided.

static
gid_t get_vegid(void)
{
if (caa_unlikely(cached_vegid == (gid_t) -1)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think load shared/store shared are missing here. And we should ideally return the value we read from getegid() through a local variable rather than re-read the static variable when we initialize it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same pattern applies to other contexts.

{
gid_t vegid;

vegid = get_vegid();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could remove the local variable here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same applies to other contexts.


enum ns_ino_state {
NS_INO_UNAVAILABLE = 0x0,
NS_INO_UNPOPULATED = 0x1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UNPOPULATED -> UNINITIALIZED ?

Add a context for each available kernel namespace which currently are :
cgroup, ipc, mnt, net, pid, user and uts. The id chosen to identify the
namespaces is the inode number of the file representing each one of them
in the proc filesystem.

This was introduced in kernel v3.8.0, if any of these context are
enabled on a system running an older kernel, zero will be returned.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Add a context for each available namespaced user and group IDs

  * vuid : real user ID
  * veuid : effective user ID
  * vsuid : saved set-user ID

These are the IDs as seen in the current user namespace, see
user_namespaces(7) and credentials(7) for details on each type.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
@compudj
Copy link
Contributor

compudj commented Oct 18, 2019

Merged manually into lttng-ust master, thanks!

@compudj compudj closed this Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants