Skip to content

Change user and drop capabilities#475

Merged
AltraMayor merged 4 commits intoAltraMayor:masterfrom
cjdoucette:cap2
May 12, 2021
Merged

Change user and drop capabilities#475
AltraMayor merged 4 commits intoAltraMayor:masterfrom
cjdoucette:cap2

Conversation

@cjdoucette
Copy link
Collaborator

No description provided.

If a stage 3 entry corresponding to the master lcore
is present, it will be run after all other entries,
and therefore it is not necessary to add this entry
to the front of the list.

This patch also enforces that there is at most one
master lcore entry and no other entries in the list
by the time run_master_if_applicable() is called.
@cjdoucette cjdoucette added the bug label May 4, 2021
@cjdoucette cjdoucette added this to the First deployment milestone May 4, 2021
Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

net: fix user change

Please add libcap-dev to GitHub Actions, so this patch can pass the compiling test.

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

net: fix user change

In order to make this patch work, we need to call assert(prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) == 0); before rte_eal_init() in main/main.c. prctl() requires #include <sys/prctl.h>.

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

net: fix user change

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

README: update hugepages package name

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

net: allow per-block capabilities after user change

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

net: allow per-block capabilities after user change

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

net: allow per-block capabilities after user change

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

net: allow per-block capabilities after user change

Copy link
Owner

@AltraMayor AltraMayor left a comment

Choose a reason for hiding this comment

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

net: allow per-block capabilities after user change

Typo at the description of this patch: routign

If Gatekeeper is configured to run as a non-root
user, then privileges are dropped during startup.
However, some aspects of Gatekeeper (specifically,
being able to use a userspace nl_pid in the CPS
block for interacting with a routing daemon) require
elevated privileges.

In order to reduce privileges of Gatekeeper as a
whole while retaining this functionality, we use
capabilities(7). Each block expresses the capabilities
it needs via the needed_caps() API.

Since Gatekeeper is a multi-threaded system and
DPDK uses a pool of threads, we require calling
prctl(2) for PR_SET_KEEPCAPS for capabilities to
be retained after changing the UID.
@AltraMayor AltraMayor merged commit f160ad2 into AltraMayor:master May 12, 2021
@cjdoucette cjdoucette deleted the cap2 branch May 12, 2021 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants