Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_packages_modules_Connectivity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
LMODroid
platform_packages_modules_Connectivity
Commits
116b91e0
Commit
116b91e0
authored
1 year ago
by
Maciej Żenczykowski
Committed by
Gerrit Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "netd.c: allow data saver egress from timewait sockets" into main
parents
796ea8b7
d54374fe
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bpf_progs/netd.c
+7
-6
7 additions, 6 deletions
bpf_progs/netd.c
with
7 additions
and
6 deletions
bpf_progs/netd.c
+
7
−
6
View file @
116b91e0
...
...
@@ -626,12 +626,13 @@ DEFINE_XTBPF_PROG("skfilter/allowlist/xtbpf", AID_ROOT, AID_NET_ADMIN, xt_bpf_al
uint32_t
sock_uid
=
bpf_get_socket_uid
(
skb
);
if
(
is_system_uid
(
sock_uid
))
return
BPF_MATCH
;
// 65534 is the overflow 'nobody' uid, usually this being returned means
// that skb->sk is NULL during RX (early decap socket lookup failure),
// which commonly happens for incoming packets to an unconnected udp socket.
// Additionally bpf_get_socket_cookie() returns 0 if skb->sk is NULL
if
((
sock_uid
==
65534
)
&&
!
bpf_get_socket_cookie
(
skb
)
&&
is_received_skb
(
skb
))
return
BPF_MATCH
;
// kernel's DEFAULT_OVERFLOWUID is 65534, this is the overflow 'nobody' uid,
// usually this being returned means that skb->sk is NULL during RX
// (early decap socket lookup failure), which commonly happens for incoming
// packets to an unconnected udp socket.
// But it can also happen for egress from a timewait socket.
// Let's treat such cases as 'root' which is_system_uid()
if
(
sock_uid
==
65534
)
return
BPF_MATCH
;
UidOwnerValue
*
allowlistMatch
=
bpf_uid_owner_map_lookup_elem
(
&
sock_uid
);
if
(
allowlistMatch
)
return
allowlistMatch
->
rule
&
HAPPY_BOX_MATCH
?
BPF_MATCH
:
BPF_NOMATCH
;
...
...
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