Skip to content
Commit 3b8b6553 authored by T.J. Mercier's avatar T.J. Mercier Committed by Jordibgzashtita
Browse files

Throw exception for negative UIDs/GIDs

UIDs and GIDs are unsigned on linux. Badly behaved callers are
occasionally passing negative integers for UIDs through JNI to uid_t
which is unsigned. Prevent this by throwing a JNI exception.

12-08 23:15:34.542  1000  3354  3388 I ActivityManager: Force stopping com.android.cts.install.lib.testapp.A appid=10109 user=-1: deletePackageX
12-08 23:15:34.543  1000  3354  3388 E libprocessgroup: No such cgroup attribute: /sys/fs/cgroup/uid_4294877405/cgroup.freeze
12-08 23:15:34.543  1000  3354  3388 W libprocessgroup: Failed to apply Frozen process profile: No such file or directory

Test: 12-11 18:43:23.145  3432  3466 I ActivityManager: Force stopping com.android.cts.install.lib.testapp.A appid=10109 user=-1: deletePackageX
Test: 12-11 18:43:23.146  3432  3466 E ActivityManager: Unable to freeze cgroup uid: -89891: java.lang.IllegalArgumentException: uid is negative: -89891
Test: 12-11 18:43:23.147  3432  3466 E ActivityManager: Unable to unfreeze cgroup uid: -89891: java.lang.IllegalArgumentException: uid is negative: -89891
Bug: 316198981
Change-Id: I24cb1e65e502ef6e09226538efe6ed54c8db7cdd
parent bfe57ab8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment