Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0b6f665a authored by Luke Huang's avatar Luke Huang
Browse files

Fix wrong netId handle in ResNSendHandler

This error would cause a query with bypass private network bit only can go
on default network.
(Basically, we could treat this problem as using non-exists netId
 to getNetworkContext for dns part.)
Also could cause wrong app_mark if input netId == NETID_UNSET.

Error case:
1. wrong app_netId/mark case:
input netid = NETID_UNSET | 0x80000000

actual:
netid = 0x80000000
app_mark = 0xF0000

expect: (assume getNetworkForConnectLocked(uid) = 30 )
netid = 30
app_mark = 0xC001E

2. wrong dns_netId/mark case:
input netid = any | 0x80000000

actual:
check fail in checkUserNetworkAccessLocked(), so return defaultNetwork as
netNetId.
(assume defaultNetId = 30)
dns_netid = 30
dns_mark = 0xE001E

expect: (assume no vpn, defaultNetId = 30)
(If input netId == NETID_UNSET)
dns_netid = 30
dns_mark = 0xF001E
(If input netId != NETID_UNSET, assume netId = 31 and we have a network 31)
dns_netid = 31
dns_mark = 0xF001F

Test will be added in aosp/695922 after we could check if netId is valid
from NetworkController.

Bug: 132670008
Test: system/netd/tests/runtests.sh
Change-Id: I4c4ea6de8a2983f809e734baf479b9f71d514833
parent b2d6073c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment