Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107157040
D42198.id128841.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
930 B
Referenced Files
None
Subscribers
None
D42198.id128841.diff
View Options
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c
--- a/lib/libprocstat/libprocstat.c
+++ b/lib/libprocstat/libprocstat.c
@@ -2414,7 +2414,6 @@
{
Elf_Auxinfo *auxv;
Elf32_Auxinfo *auxv32;
- void *ptr;
size_t len;
unsigned int i, count;
int name[4];
@@ -2448,8 +2447,17 @@
* necessarily true.
*/
auxv[i].a_type = auxv32[i].a_type;
- ptr = &auxv32[i].a_un;
- auxv[i].a_un.a_val = *((uint32_t *)ptr);
+ /*
+ * Don't sign extend values. Existing entries are positive
+ * integers or pointers. Under freebsd32, programs typically
+ * have a full [0, 2^32) address space (perhaps minus the last
+ * page) and treating this as a signed integer would be
+ * confusing since these are not kernel pointers.
+ *
+ * XXX: A more complete translation would be ABI and
+ * type-aware.
+ */
+ auxv[i].a_un.a_val = (uint32_t)auxv32[i].a_un.a_val;
}
*cntp = count;
out:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 12:07 AM (21 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15759097
Default Alt Text
D42198.id128841.diff (930 B)
Attached To
Mode
D42198: libprocstat: simplify auxv value conversion
Attached
Detach File
Event Timeline
Log In to Comment