The CL has caused a memory regression in the Zygote, See: b/396156852
Test: Compile
Bug: 396156852
Change-Id: I0ca4cd430a6537d689a1b04739656afc84c43ce1
Currently, WIFI_AP_STATE_CHANGED for LOHS will use any pending Wifi
TetheringRequest to start the IpServer. This is a bug, since pending
Wifi requests are always for tethered SoftAP, not LOHS. This means if
there's already a pending request for tethered SoftAP, we will
mistakenly use the tethered SoftAP request for LOHS. Then, when the
WIFI_AP_STATE_CHANGED event for the tethered SoftAP arrives, the pending
request for it will already be gone.
Fix this by always having LOHS use an implicit LOHS TetheringRequest
instead of taking the request from the pending list.
Bug: 216524590
Test: atest
Change-Id: Ic349e0b0688addf6a41b3de0528d444d716846a2
Quang Anh Luongcommited 2025-02-13 10:25:20 +09:00
If there are pending pan requests for an enable but a disable request
comes (or vice versa), remove all the pending requests and pre-emptively
fail their result listeners. This simplifies the logic and helps us
keep track of which request the future link layer event should be long
to.
Technically this is an app-visible behaviour change. In particular, if
something disables bluetooth tethering while the service is
disconnected and request(s) to enable tethering are queued, then the new
code will immediately send onTetheringFailed to all those requests,
whereas the old code would wait until the service connects, enable
tethering (and send the enabler an onTetheringStarted), and then disable
it. Given that this situation is very rare, and Bluetooth tethering is
itself so uncommon (<1% of total tethering sessions) this is an
acceptable trade-off.
Bug: 216524590
Test: atest TetheringTest
Change-Id: I061733d714894b741e7d686810dd39f054e85476
Quang Anh Luongcommited 2025-02-13 10:24:42 +09:00
This commit updates the timerfd JNI function calls to use
ErrnoException instead of IOException to handle exceptions
correctly.
Bug: 393169546
Test: m
Change-Id: I56385a0e9f20c778eb2c2d2c4fe43cbf12753d93
RESERVATION requests are effectively equivalent to REQUESTs in
NetworkAgent contexts.
Change-Id: I7534c4755543365153a9348ef7c6d0ada1b70cd5
Test: TH, though I am working on a CSL2capNetworkProviderTest
We already log on init start, and we log all failures,
we don't need an extra log in the middle of init.
I NetdUpdatable: libnetd_updatable_init: Initializing
I NetdUpdatable: initMaps successfully
E NetdUpdatable: libnetd_updatable_init: Failed: (1) [Operation not permitted] : Failed to change RLIMIT_MEMLOCK to 2 GiB
while success looks like:
I netd : netd 1.0 starting
I netd : Pid file removed
I netd : SIGPIPE is blocked
I netd : setCloseOnExec(dnsproxyd)
I netd : setCloseOnExec(fwmarkd)
I NetdUpdatable: libnetd_updatable_init: Initializing
I NetdUpdatable: BPF programs are loaded
I NetdUpdatable: initMaps successfully
I netd : libnetd_updatable_init success
I netd : NetlinkManager instanced
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8bca9b59363c1f31ecf3de80b9d280a28cce4a14
Maciej Żenczykowskicommited 2025-02-11 14:27:03 -08:00
Make sure _Alignof(unsigned long long) is 4 on i386
and 8 on all other archs.
This should be a no-op, as it should be trivially true on
any 64-bit architectures (aarch64/riscv64/x86-64), and is
also true on 32-bit arm.
btw. currently failing targets if you just == 8 unconditionally
include at least:
cf_gwear_x86-trunk_staging-userdebug:git_main
test_suites_x86_64-trunk_staging:aosp-main
test_suites_x86_64-trunk_staging:git_main
test_suites_x86_64-trunk_staging_coverage:aosp-main
test_suites_x86_64-trunk_staging_coverage:git_main
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2fac89d552232150b167e9f67fe1bd0cf2c129ee
Maciej Żenczykowskicommited 2025-02-10 22:50:45 -08:00
This intentionally does not block 32-bit userspace,
but it does mean existing 32-on-32 devices will need to
upgrade to 32-on-64 to upgrade to 25Q2+. Even Wear/TV.
This will allow us to unconditionally start using 64-bit
cli binaries for network admin tasks and avoid the entire
insanity that is 32-bit kernel net admin ABI of
iptables/netfilter & xfrm/ipsec.
Note: on at least x86 there's already code in netd that is outright incorrect if the kernel is not 64-bit.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9c18f82b38adeb223ffe3c6aebda50f057f3c818
Maciej Żenczykowskicommited 2025-02-10 21:54:34 -08:00
* changes:
Move reserved offer teardown into a function
Store reserved offers in a Set instead
Allocate a BluetoothServerSocket for the ReservedServerOffer
Maciej Żenczykowskiauthored and Gerrit Code Reviewcommited 2025-02-10 16:54:47 -08:00
* changes:
Move L2capNetworkProvider#start() onto Handler thread
Mark globals as private
Move the common set of NetworkCapabilities to the provider class
Add L2capNetwork class
Maciej Żenczykowskiauthored and Gerrit Code Reviewcommited 2025-02-10 14:44:22 -08:00
libremotauth_jni_rust doesn't need to be available to an apex.
Bug: 394664568
Test: compare out/soong/installs-${TARGET_PRODUCT}.mk
Change-Id: I16269bf4bc6fd947b7c3efe2848455ccb0ca758f
The signature should be logged _before_ decoded from the Base64
encoding in order to properly compare with what is published on gstatic.
Bug: 391327942
Bug: 378626065
Flag: com.android.net.ct.flags.certificate_transparency_service
Test: atest NetworkSecurityUnitTests
Change-Id: Ibde2d4f45b998f764e2cb8d0772a0536ff763a4a
This CL adds the parsed log list timestamp from the JSON log list, as
well as logging a SUCCESS event (with timestamp and signature) when the
log list has been successfully updated.
Fixes: 391327942
Fixes: 394278886
Bug: 378626065
Flag: com.android.net.ct.flags.certificate_transparency_service
Test: atest NetworkSecurityUnitTests
Change-Id: I8f0d96ca96cd89dce5da588cb478f9332537df48
This is done to ensure the blanket offer is always needed. Marking it as
primary should ensure it always outranks the server network created by
the reserved offer. If the blanket offer receives an onNetworkUnneeded,
the associated reservation is torn down.
Test: TH
Change-Id: I324345884fcf805a06e3251fc51b0ea9ea52b3b7
Adds a function to create a tun interface configured for blocking i/o.
Also adds a helper function to create an L2capNetwork which calls
createTunInterface(). createL2capNetwork() requires the caller to pass a
*connected* BluetoothSocket and will be used for both server and client
networks.
Note that this split isn't particularly logical (because this function
does not get called yet), but was the easiest way to make the code more
reviewable.
Test: atest L2capNetworkProviderTest
Change-Id: I61efbedbf56fe9b4ba6d0050eaa29ead3023da3f
This function will also be called from the ReservedServerOffer itself
when it encounters an error that should release the reservation.
Test: TH
Change-Id: Icf49147dd5f1335e9a3b8706da5bbba03c556758
ReservedOffers should be identified by the reservationId, not the
requestId. Furthermore, a reserved offer can be torn down outside of
onNetworkUnneeded() at which point there is not request to reference.
This change replaces the Map of requestId -> reservedOffer to a Set of
reservedOffers.
Test: TH
Change-Id: I622c86fe238b2412664add55ce491eb5baf6033f
This change allocates a BluetoothServerSocket as a response to the
reservation. The resulting PSM is used to create the reserved
capabilities stored in ReservedServerOffer.
Test: TH
Change-Id: I3e789541474a492bb1c015d6316db12a3c995995
These will be used in the blanket, reserved, and client offers and any
associated networks.
Test: TH
Change-Id: I8cdc80042ff08385f3d333c894c7c325768b7ed0
The L2capNetwork class keeps track of the IpClient (configured in IPv6
link-local only mode), NetworkAgent, and L2capPacketForwarder.
Test: mm
Change-Id: Icfba2964dec7e8260973591395a391d30bbae6c2
L2capPacketForwarder forwards packets between an L2CAP BluetoothSocket
and a tun fd.
It uses blocking i/o to do so, since the BluetoothSocket API does not
expose a file descriptor to poll() on.
It remains to be seen whether shutdown() on a tun interface fd is
actually implemented. Currently, the test uses a pair of SOCK_SEQPACKET
sockets which require to be shutdown to interrupt the blocking read.
Test: L2capPacketForwarderTest
Change-Id: I03d2a2dd76ec2b71fdb9e3ea7008daa6d1d124fe
Revert submission 3477737-move_apex_shortcut
Reason for revert: Likely culprit for b/394990888 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted changes: /q/submissionid:3477737-move_apex_shortcut
Change-Id: I8acc4fe8628cdef2f58f3423576fe5c582fcb023
Chaitanya Cheemala (xWF)authored and Gerrit Code Reviewcommited 2025-02-07 01:38:05 -08:00
Current test was mistakenly added to the unit test version of
ConnectivityManagerTest instead of the CTS test. Move this to the CTS
test instead.
Bug: 392986269
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: Id64d21929fb6b6c42f46a821a3cd28bbcaf77cda
Quang Anh Luongcommited 2025-02-07 12:42:12 +09:00
com.android.remoteauth doesn't exist, but the value wasn't being
checked because no apexes depended on the module, triggering a shortcut
that skipped the apex_available check.
Bug: 394664568
Test: builds
Change-Id: I25fd078093fd71a0e0df01fb31be9f2b811108ff
Ignore this error code during DEL operations.
It is returned when the specific thing to be deleted
is not found and is therefore a valid response.
Gets rid of 30+ logs worth of:
E TcUtils : NLMSG_ERROR message return error: -2
during netd startup (cleanup phase).
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie542f8ff418dbed604eea5b31b87f9b974ccdbcb
Maciej Żenczykowskicommited 2025-02-06 12:56:09 -08:00