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
14c1904b
Unverified
Commit
14c1904b
authored
Aug 10, 2018
by
2xsec
Committed by
Christian Brauner
Aug 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tainted int loop bound issue
Signed-off-by:
2xsec
<
dh48.jeong@samsung.com
>
parent
4e194cee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
caps.c
src/lxc/caps.c
+6
-3
cgfsng.c
src/lxc/cgroups/cgfsng.c
+2
-2
pam_cgfs.c
src/lxc/pam/pam_cgfs.c
+2
-2
No files found.
src/lxc/caps.c
View file @
14c1904b
...
@@ -310,7 +310,7 @@ int lxc_caps_init(void)
...
@@ -310,7 +310,7 @@ int lxc_caps_init(void)
return
0
;
return
0
;
}
}
static
int
_real_caps_last_cap
(
void
)
static
long
int
_real_caps_last_cap
(
void
)
{
{
int
fd
,
result
=
-
1
;
int
fd
,
result
=
-
1
;
...
@@ -354,10 +354,13 @@ static int _real_caps_last_cap(void)
...
@@ -354,10 +354,13 @@ static int _real_caps_last_cap(void)
int
lxc_caps_last_cap
(
void
)
int
lxc_caps_last_cap
(
void
)
{
{
static
int
last_cap
=
-
1
;
static
long
int
last_cap
=
-
1
;
if
(
last_cap
<
0
)
if
(
last_cap
<
0
)
{
last_cap
=
_real_caps_last_cap
();
last_cap
=
_real_caps_last_cap
();
if
(
last_cap
<
0
||
last_cap
>
INT_MAX
)
last_cap
=
-
1
;
}
return
last_cap
;
return
last_cap
;
}
}
...
...
src/lxc/cgroups/cgfsng.c
View file @
14c1904b
...
@@ -397,7 +397,7 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized)
...
@@ -397,7 +397,7 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized)
/* Get maximum number of cpus found in possible cpuset. */
/* Get maximum number of cpus found in possible cpuset. */
maxposs
=
get_max_cpus
(
posscpus
);
maxposs
=
get_max_cpus
(
posscpus
);
if
(
maxposs
<
0
)
if
(
maxposs
<
0
||
maxposs
>=
INT_MAX
-
1
)
goto
on_error
;
goto
on_error
;
if
(
!
file_exists
(
__ISOL_CPUS
))
{
if
(
!
file_exists
(
__ISOL_CPUS
))
{
...
@@ -442,7 +442,7 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized)
...
@@ -442,7 +442,7 @@ static bool cg_legacy_filter_and_set_cpus(char *path, bool am_initialized)
/* Get maximum number of cpus found in isolated cpuset. */
/* Get maximum number of cpus found in isolated cpuset. */
maxisol
=
get_max_cpus
(
isolcpus
);
maxisol
=
get_max_cpus
(
isolcpus
);
if
(
maxisol
<
0
)
if
(
maxisol
<
0
||
maxisol
>=
INT_MAX
-
1
)
goto
on_error
;
goto
on_error
;
if
(
maxposs
<
maxisol
)
if
(
maxposs
<
maxisol
)
...
...
src/lxc/pam/pam_cgfs.c
View file @
14c1904b
...
@@ -1806,7 +1806,7 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
...
@@ -1806,7 +1806,7 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
/* Get maximum number of cpus found in possible cpuset. */
/* Get maximum number of cpus found in possible cpuset. */
maxposs
=
cg_get_max_cpus
(
posscpus
);
maxposs
=
cg_get_max_cpus
(
posscpus
);
if
(
maxposs
<
0
)
if
(
maxposs
<
0
||
maxposs
>=
INT_MAX
-
1
)
goto
on_error
;
goto
on_error
;
if
(
!
file_exists
(
__ISOL_CPUS
))
{
if
(
!
file_exists
(
__ISOL_CPUS
))
{
...
@@ -1856,7 +1856,7 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
...
@@ -1856,7 +1856,7 @@ static bool cg_filter_and_set_cpus(char *path, bool am_initialized)
/* Get maximum number of cpus found in isolated cpuset. */
/* Get maximum number of cpus found in isolated cpuset. */
maxisol
=
cg_get_max_cpus
(
isolcpus
);
maxisol
=
cg_get_max_cpus
(
isolcpus
);
if
(
maxisol
<
0
)
if
(
maxisol
<
0
||
maxisol
>=
INT_MAX
-
1
)
goto
on_error
;
goto
on_error
;
if
(
maxposs
<
maxisol
)
if
(
maxposs
<
maxisol
)
...
...
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