offload.c - make tether_error_map read only.
Bug: 254543135 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I5d4c9cad66f59bd7eed54323ba72ea5a54ddf5e1
This commit is contained in:
@@ -91,8 +91,11 @@
|
|||||||
|
|
||||||
// ----- Tethering Error Counters -----
|
// ----- Tethering Error Counters -----
|
||||||
|
|
||||||
DEFINE_BPF_MAP_GRW(tether_error_map, ARRAY, uint32_t, uint32_t, BPF_TETHER_ERR__MAX,
|
// Note that pre-T devices with Mediatek chipsets may have a kernel bug (bad patch
|
||||||
TETHERING_GID)
|
// "[ALPS05162612] bpf: fix ubsan error") making it impossible to write to non-zero
|
||||||
|
// offset of bpf map ARRAYs. This file (offload.o) loads on T, but luckily this
|
||||||
|
// array is only written by bpf code, and only read by userspace.
|
||||||
|
DEFINE_BPF_MAP_RO(tether_error_map, ARRAY, uint32_t, uint32_t, BPF_TETHER_ERR__MAX, TETHERING_GID)
|
||||||
|
|
||||||
#define COUNT_AND_RETURN(counter, ret) do { \
|
#define COUNT_AND_RETURN(counter, ret) do { \
|
||||||
uint32_t code = BPF_TETHER_ERR_ ## counter; \
|
uint32_t code = BPF_TETHER_ERR_ ## counter; \
|
||||||
|
|||||||
Reference in New Issue
Block a user