Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
f8f3c3c0
Commit
f8f3c3c0
authored
May 02, 2014
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "cgfs: don't mount /sys/fs/cgroup readonly"
This reverts commit
8d783edc
.
parent
52b0a7d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
cgfs.c
src/lxc/cgfs.c
+16
-0
No files found.
src/lxc/cgfs.c
View file @
f8f3c3c0
...
...
@@ -1413,6 +1413,14 @@ static bool cgroupfs_mount_cgroup(void *hdata, const char *root, int type)
SYSERROR
(
"error bind-mounting %s to %s"
,
mp
->
mount_point
,
abs_path
);
goto
out_error
;
}
/* main cgroup path should be read-only */
if
(
type
==
LXC_AUTO_CGROUP_FULL_RO
||
type
==
LXC_AUTO_CGROUP_FULL_MIXED
)
{
r
=
mount
(
NULL
,
abs_path
,
NULL
,
MS_REMOUNT
|
MS_BIND
|
MS_RDONLY
,
NULL
);
if
(
r
<
0
)
{
SYSERROR
(
"error re-mounting %s readonly"
,
abs_path
);
goto
out_error
;
}
}
/* own cgroup should be read-write */
if
(
type
==
LXC_AUTO_CGROUP_FULL_MIXED
)
{
r
=
mount
(
abs_path2
,
abs_path2
,
NULL
,
MS_BIND
,
NULL
);
...
...
@@ -1479,6 +1487,14 @@ static bool cgroupfs_mount_cgroup(void *hdata, const char *root, int type)
parts
=
NULL
;
}
/* try to remount the tmpfs readonly, since the container shouldn't
* change anything (this will also make sure that trying to create
* new cgroups outside the allowed area fails with an error instead
* of simply causing this to create directories in the tmpfs itself)
*/
if
(
type
!=
LXC_AUTO_CGROUP_RW
&&
type
!=
LXC_AUTO_CGROUP_FULL_RW
)
mount
(
NULL
,
path
,
NULL
,
MS_REMOUNT
|
MS_RDONLY
,
NULL
);
free
(
path
);
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment