-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ANDROID: fix overflow in /proc/uid_cputime/remove_uid_range
Writing large values to remove_uid_range can cause an overflow & system hang. To prevent this, read in the start and end of the range using kstrtouint to ensure the full range can fit in a uid_t, and use a u64 for our loop counters to avoid overflow when the range ends at UINT_MAX. Test: "echo '9223372036854775807-9223372036854775807' > \ /proc/uid_cputime/remove_uid_range" now returns error instead of hanging Bug: 139902843 Signed-off-by: Connor O'Brien <connoro@google.com> Change-Id: I30138f95a1c56366a79eec27bbc476c9ea5773ae
- Loading branch information
1 parent
35e6223
commit e69f300
Showing
2 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters