No description. Add one?
  • Java 78%
  • Kotlin 11.8%
  • AIDL 4.4%
  • C++ 3.7%
  • C 1.5%
  • Other 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Maciej Żenczykowski f7eb2bf2bc NetBpfLoad: workaround for Xiaomi kernel uapi bug
See https://b.corp.google.com/issues/414570528#comment96
which can be summarized as
https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/vayu-r-oss/include/uapi/linux/bpf.h has:

enum bpf_cmd {
  BPF_MAP_CREATE,          <-- UAPI 0
  BPF_MAP_LOOKUP_ELEM,     <-- UAPI 1
  BPF_MAP_UPDATE_ELEM,     <-- UAPI 2
  BPF_MAP_DELETE_ELEM,     <-- UAPI 3
  BPF_MAP_GET_NEXT_KEY,    <-- UAPI 4
  BPF_PROG_LOAD,           <-- UAPI 5
  BPF_OBJ_PIN,             <-- UAPI 6
  BPF_OBJ_GET,             <-- UAPI 7
  BPF_PROG_ATTACH,         <-- UAPI 8
  BPF_PROG_DETACH,         <-- UAPI 9
  BPF_GET_COMM_HASH,       <-- breaks Linux uapi (uses 10)
  BPF_PROG_TEST_RUN,       <-- UAPI 10 becomes 11 (aka. BPF_PROG_RUN)
  BPF_PROG_GET_NEXT_ID,    <-- UAPI 11 becomes 12
  BPF_MAP_GET_NEXT_ID,     <-- UAPI 12 becomes 13
  BPF_PROG_GET_FD_BY_ID,   <-- UAPI 13 becomes 14
  BPF_MAP_GET_FD_BY_ID,    <-- UAPI 14 becomes 15
  BPF_OBJ_GET_INFO_BY_FD,  <-- UAPI 15 becomes 16
};

this addition in the middle of the userspace api enum,
causes all following enum values to be greater by one.

In particular this increases the value of
BPF_OBJ_GET_INFO_BY_FD from 15 to 16, thus break it.

It also causes UAPI 12 (BPF_MAP_GET_NEXT_ID)
to actually execute BPF_PROG_GET_NEXT_ID (normally UAPI 13)

As such this can be detected via finding the index of
the last map (on buggy kernels this will actually find
the index of the last program), then creating a map,
then checking if the last map index has changed
(on buggy kernels this will not be the case because
we did not create another program).

Bug: 414570528
Test: TreeHugger
Flag: EXEMPT mainline
Change-Id: Iecad121ac624df2d123a13e90a46792bd567a4c6
Signed-off-by: Maciej Żenczykowski <maze@google.com>
2025-06-10 02:43:28 -07:00
bpf NetBpfLoad: workaround for Xiaomi kernel uapi bug 2025-06-10 02:43:28 -07:00
clatd clatd: disable seccomp 2025-06-04 00:54:30 -07:00
common Extend QosFilter address matching function 2025-05-08 22:37:32 -07:00
framework Merge "Add NetworkCapabilities transport types into NetworkIdentity." into main 2025-05-27 00:41:35 -07:00
framework-t Add NetworkTemplate get/set transport type methods 2025-06-09 14:09:46 +08:00
nearby Replace .toList() with .collect() am: 725078a6bd am: 6586d080f6 2025-02-03 17:40:50 -08:00
networksecurity Remove v1 compatibility version 2025-05-14 13:18:27 +10:00
remoteauth [owners] Remove derekjedral@google.com from remoteauth/OWNERS 2025-05-25 09:49:50 -07:00
service Add NetworkTemplate get/set transport type methods 2025-06-09 14:09:46 +08:00
service-b Conditionally include VCN in Tethering module 2024-12-09 12:04:12 -08:00
service-t Make function void and remove outdated TODOs 2025-06-09 19:43:36 -07:00
staticlibs Merge "Add getInterfaceMtu method in ProcfsParsingUtils" into main 2025-06-10 00:31:57 -07:00
tests Merge "Add NetworkTemplate get/set transport type methods" into main 2025-06-09 00:35:49 -07:00
Tethering Merge "Increase WAIT_RA_TIMEOUT_MS" into main 2025-06-04 16:17:57 -07:00
thread Remove RecorderCallback. 2025-05-19 16:35:53 +09:00
tools Remove dependencies on the 1-variant fallback 2024-10-22 16:31:00 -07:00
.clang-format Add .clang-format 2025-03-23 19:59:10 -07:00
.gitignore Ignores vim temporary files from git 2023-12-23 17:45:32 +08:00
OWNERS Move the owner of xfrm netlink source code to its own directory. 2023-11-22 18:50:00 +09:00
OWNERS_core_networking Add jimictw@ to core networking OWNERS. 2025-01-24 01:06:33 -08:00
OWNERS_core_networking_xts Add yuyanghuang@ to OWNERS_core_networking_xts for APF firmware tests 2025-03-14 13:16:04 +09:00
PREUPLOAD.cfg Add alint hook to Connectivity repo 2025-05-30 11:36:49 +00:00
preupload_hook_script.py Refactor: apply pyformat for coding style consistency 2025-05-28 12:44:57 +00:00
rustfmt.toml Add rustfmt to p/m/C 2025-03-28 10:06:13 -07:00
TEST_MAPPING Add connectivity tests for presubmit on tv 2025-04-03 09:13:40 -07:00