BPF: timeInState: fix possible bad data accounting

The bpf_get_current_uid_gid helper returns a 64bit value or -EINVAL in
the error case. This patch handles the error case by skipping time
accounting. The error case should only occur if something bad happend in
the kernel and there is a problem with the task struct.

Bug: 355147109
Test: treehugger
Change-Id: I74a0c0b19ac06754815abad1d21c98c950878d6b
Signed-off-by: Neill Kapron <nkapron@google.com>
1 file changed
tree: 6f5828583967f74fc70b56a7e1664ba45f08b5a2
  1. test/
  2. Android.bp
  3. fuseMedia.c
  4. LICENSE
  5. METADATA
  6. OWNERS
  7. PREUPLOAD.cfg
  8. TEST_MAPPING
  9. time_in_state_test.cpp
  10. timeInState.c