Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linux-msm
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
qsdk
oss
kernel
linux-msm
Commits
3d157fc3
Commit
3d157fc3
authored
4 days ago
by
Stephen Rothwell
Browse files
Options
Downloads
Plain Diff
Merge branch 'caps-next' of
git://git.kernel.org/pub/scm/linux/kernel/git/sergeh/linux.git
parents
7ca1d5b7
4ae89b1f
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/linux/capability.h
+0
-5
0 additions, 5 deletions
include/linux/capability.h
kernel/capability.c
+0
-16
0 additions, 16 deletions
kernel/capability.c
security/commoncap.c
+5
-4
5 additions, 4 deletions
security/commoncap.c
with
5 additions
and
25 deletions
include/linux/capability.h
+
0
−
5
View file @
3d157fc3
...
...
@@ -139,7 +139,6 @@ static inline kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a,
}
#ifdef CONFIG_MULTIUSER
extern
bool
has_capability
(
struct
task_struct
*
t
,
int
cap
);
extern
bool
has_ns_capability
(
struct
task_struct
*
t
,
struct
user_namespace
*
ns
,
int
cap
);
extern
bool
has_capability_noaudit
(
struct
task_struct
*
t
,
int
cap
);
...
...
@@ -150,10 +149,6 @@ extern bool ns_capable(struct user_namespace *ns, int cap);
extern
bool
ns_capable_noaudit
(
struct
user_namespace
*
ns
,
int
cap
);
extern
bool
ns_capable_setid
(
struct
user_namespace
*
ns
,
int
cap
);
#else
static
inline
bool
has_capability
(
struct
task_struct
*
t
,
int
cap
)
{
return
true
;
}
static
inline
bool
has_ns_capability
(
struct
task_struct
*
t
,
struct
user_namespace
*
ns
,
int
cap
)
{
...
...
This diff is collapsed.
Click to expand it.
kernel/capability.c
+
0
−
16
View file @
3d157fc3
...
...
@@ -285,22 +285,6 @@ bool has_ns_capability(struct task_struct *t,
return
(
ret
==
0
);
}
/**
* has_capability - Does a task have a capability in init_user_ns
* @t: The task in question
* @cap: The capability to be tested for
*
* Return true if the specified task has the given superior capability
* currently in effect to the initial user namespace, false if not.
*
* Note that this does not set PF_SUPERPRIV on the task.
*/
bool
has_capability
(
struct
task_struct
*
t
,
int
cap
)
{
return
has_ns_capability
(
t
,
&
init_user_ns
,
cap
);
}
EXPORT_SYMBOL
(
has_capability
);
/**
* has_ns_capability_noaudit - Does a task have a capability (unaudited)
* in a specific user ns.
...
...
This diff is collapsed.
Click to expand it.
security/commoncap.c
+
5
−
4
View file @
3d157fc3
...
...
@@ -115,10 +115,11 @@ static inline int cap_capable_helper(const struct cred *cred,
* Determine whether the nominated task has the specified capability amongst
* its effective set, returning 0 if it does, -ve if it does not.
*
* NOTE WELL: cap_has_capability() cannot be used like the kernel's capable()
* and has_capability() functions. That is, it has the reverse semantics:
* cap_has_capability() returns 0 when a task has a capability, but the
* kernel's capable() and has_capability() returns 1 for this case.
* NOTE WELL: cap_capable() has reverse semantics to the capable() call
* and friends. That is cap_capable() returns an int 0 when a task has
* a capability, while the kernel's capable(), has_ns_capability(),
* has_ns_capability_noaudit(), and has_capability_noaudit() return a
* bool true (1) for this case.
*/
int
cap_capable
(
const
struct
cred
*
cred
,
struct
user_namespace
*
target_ns
,
int
cap
,
unsigned
int
opts
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment