From 8880cab65cd5ab2c3aca2249f41fd34d75b7d5de Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 13 Feb 2024 00:43:24 +0000 Subject: [PATCH] Admit to another LP32 bug. But explain why we're not going to bother fixing it. Test: treehugger Change-Id: Ib7358fceff10f80b9e359ea3f4d088c64d440021 --- docs/32-bit-abi.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/32-bit-abi.md b/docs/32-bit-abi.md index 3be6b1a8a..7a96e2fec 100644 --- a/docs/32-bit-abi.md +++ b/docs/32-bit-abi.md @@ -109,3 +109,15 @@ but 32-bit bionic's `pthread_mutex` is a total of 32 bits, leaving just mutexes for tids that don't fit in 16 bits. This typically manifests as a hang in `pthread_mutex_lock` if the libc startup code doesn't detect this condition and abort. + + +## `getuid()` and friends wrongly set errno for very large results + +This doesn't generally affect Android devices, because we don't have any +uids/gids/pids large enough, but 32-bit Android doesn't take into account +that functions like getuid() potentially have return values that cover the +entire 32-bit, and can't fail. This means that the usual "if the result is +between -1 and -4096, set errno and return -1" code is inappropriate for +these functions. Since LP32 is unlikely to be still supported long before +those limits could ever matter, although -- unlike the others in this +document -- this defect is actually fixable, it doesn't seem worth fixing.