From 3917d770db166df52e831afb69f6682119519a12 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 23 Feb 2023 12:29:00 -0800 Subject: [PATCH] ps: widen the VSIZE field for Android's default view. On LP64 systems, address space is effectively free, and the security folks have found a variety of ways to use large PROT_NONE regions. For example, Android currently spends 3GiB on the CFI shadow and 7GiB padding the scudo heap, meaning that even toybox cat has a VmSize around 10GiB. This means that the default ps output doesn't line up. Arguably this should be a change to the default width (currently 7) of the VSZ entry in the "typos" array, but as long as desktop Linux isn't using its address space for security mitigations, that seemed like it might be too contentious. --- toys/posix/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/posix/ps.c b/toys/posix/ps.c index 1fdfc17c..d43379c3 100644 --- a/toys/posix/ps.c +++ b/toys/posix/ps.c @@ -1348,7 +1348,7 @@ void ps_main(void) not_o = "F,S,UID,%sPPID,C,PRI,NI,BIT,SZ,WCHAN,TTY,TIME,CMD"; else if (CFG_TOYBOX_ON_ANDROID) sprintf(not_o = toybuf+128, - "USER,%%sPPID,VSIZE,RSS,WCHAN:10,ADDR:10,S,%s", + "USER,%%sPPID,VSIZE:10,RSS,WCHAN:10,ADDR:10,S,%s", FLAG(T) ? "CMD" : "NAME"); sprintf(toybuf, not_o, FLAG(T) ? "PID,TID," : "PID,"); -- 2.39.2