Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
common
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
la
kernel
common
Commits
25b172db
Commit
25b172db
authored
16 years ago
by
Robert Love
Committed by
Brian Swetland
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
paranoid_network: Check euid and egid, not uid and gid.
Signed-off-by:
Robert Love
<
rlove@google.com
>
parent
bb39136d
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
net/bluetooth/af_bluetooth.c
+3
-6
3 additions, 6 deletions
net/bluetooth/af_bluetooth.c
net/ipv4/af_inet.c
+1
-1
1 addition, 1 deletion
net/ipv4/af_inet.c
with
4 additions
and
7 deletions
net/bluetooth/af_bluetooth.c
+
3
−
6
View file @
25b172db
...
...
@@ -141,13 +141,13 @@ static void bt_reclassify_sock_lock(struct socket *sock, int proto)
#ifdef CONFIG_ANDROID_PARANOID_NETWORK
static
inline
int
current_has_bt_admin
(
void
)
{
return
(
!
current
->
uid
||
current
->
gid
==
AID_NET_BT_ADMIN
||
return
(
!
current
->
e
uid
||
current
->
e
gid
==
AID_NET_BT_ADMIN
||
groups_search
(
current
->
group_info
,
AID_NET_BT_ADMIN
));
}
static
inline
int
current_has_bt
(
void
)
{
return
(
current_has_bt_admin
()
||
current
->
gid
==
AID_NET_BT
||
return
(
current_has_bt_admin
()
||
current
->
e
gid
==
AID_NET_BT
||
groups_search
(
current
->
group_info
,
AID_NET_BT
));
}
# else
...
...
@@ -166,15 +166,12 @@ static int bt_sock_create(struct net *net, struct socket *sock, int proto)
{
int
err
;
#ifdef CONFIG_ANDROID_PARANOID_NETWORK
if
(
proto
==
BTPROTO_RFCOMM
||
proto
==
BTPROTO_SCO
||
proto
==
BTPROTO_L2CAP
)
{
if
(
!
current_has_bt
())
return
-
EPERM
;
}
else
if
(
!
current_has_bt_admin
())
{
}
else
if
(
!
current_has_bt_admin
())
return
-
EPERM
;
}
#endif
if
(
net
!=
&
init_net
)
return
-
EAFNOSUPPORT
;
...
...
This diff is collapsed.
Click to expand it.
net/ipv4/af_inet.c
+
1
−
1
View file @
25b172db
...
...
@@ -250,7 +250,7 @@ EXPORT_SYMBOL(build_ehash_secret);
#ifdef CONFIG_ANDROID_PARANOID_NETWORK
static
inline
int
current_has_network
(
void
)
{
return
(
!
current
->
uid
||
current
->
gid
==
AID_INET
||
return
(
!
current
->
e
uid
||
current
->
e
gid
==
AID_INET
||
groups_search
(
current
->
group_info
,
AID_INET
));
}
# else
...
...
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